Search code examples
eclipseeclipse-rcpjfaceeclipse-pde

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?


Solution

  • 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.