Out of interest what is the context of the operation you are performing currently? For example, if you are writing an action you can get the current editor from the supplied event with e.getData(PlatformDataKeys.EDITOR)
Also, to answer your second question, you can use FileEditorManager.getInstance(project).getAllEditors() which will return all currently open editors Similiarly there are more useful methods in this class that may be beneficial to look at.
i have my custom editor: public class MyEditor implements FileEditor, FileEditorManagerListener and in MyAction.update i want to see if the active editor is of MyEditor type . In function of this i make my action visible or not.
Hi,
Out of interest what is the context of the operation you are performing currently?
For example, if you are writing an action you can get the current editor from the supplied event with e.getData(PlatformDataKeys.EDITOR)
Alan
Also, to answer your second question, you can use FileEditorManager.getInstance(project).getAllEditors() which will return all currently open editors
Similiarly there are more useful methods in this class that may be beneficial to look at.
i have my custom editor: public class MyEditor implements FileEditor, FileEditorManagerListener
and in MyAction.update i want to see if the active editor is of MyEditor type . In function of this i make my action visible or not.
Thank you for the fast answer!
1) FileEditorManager.getInstance(e.getProject()).getAllEditors();
2) FileEditorManager.getInstance(e.getProject()).getSelectedEditors();