Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enumerating all my Eclipse editors?

I have built a simple Eclipse plugin where a user may use a TableViewer of database resources to open an editor on any of those resources.

Users may therefore have zero upwards instances of the editor running.

Is there an API available to get a list of those editor instances?

like image 456
Martin Cowie Avatar asked Feb 05 '09 16:02

Martin Cowie


1 Answers

You can get references to all open editors with:

PlatformUI.getWorkbench().getActiveWorkbenchWindow()
    .getActivePage().getEditorReferences();

And then check these to select the ones that reference instances of your editor type.

like image 147
Fabian Steeg Avatar answered Oct 01 '22 17:10

Fabian Steeg