How to get a list of all open files in eclipse editor?

My RCP application has an editor, almost like in Eclipse. The class editor extends from org.eclipse.ui.texteditor.AbstractTextEditor and is added to the extension in plugin.xml -> org.eclipse.ui.editors . I would like to make a view that contains open files in an editor. The question is, how do I get a list of all open files (see. Screen) enter image description here

+6
source share
2 answers

I have not tested it, but you should get it starting with the PlatformUI class.

 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences() 
+8
source

In your workspace, the following file contains information about your workplace:

.metadata / .plugins / org.eclipse.ui.workbench / workbench.xml It can be deleted (or edited, but it takes some rotation around, I suppose) without breaking your workspace, the file is restored by Eclipse. When you delete all settings related to the workbench, they are lost (i.e. all editors are closed), but your projects of this workspace remain untouched.

from which you can get a list of files.

0
source

Source: https://habr.com/ru/post/921198/


All Articles