In my Eclipse plugin, I need to know when the editor that is visible on the screen has changed. I am currently getting the active editor as follows:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
This works for most cases except for when the green Continue button is pressed:
If I use the F8 shortcut then the active editor is updated as expected.
It seems that the active editor property is not updated until the editor tab gets focus (which doesn't happen when the Continue button is pressed).
Is there any other route that I can take to get the "visible editor"?
Thanks in advance.
Alan
Show activity on this post. If I use the F8 shortcut then the active editor is updated as expected. It seems that the active editor property is not updated until the editor tab gets focus (which doesn't happen when the Continue button is pressed).
If you are using eclipse and you have declared the “main” method in your program and you have written it inside the class then you have to check that you have added the build path or not. If you have not added then:- go to project properties -> Choose java build path -> Click on the source.
to right click on the HTML file in package explorer > Open With > choose another editor (e.g. text editor). This only associates with current file. If you want to change file association for all HTMLs: goto Preferences (under menu Window) > General > Editor > File Associations and change HTML file association there.
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With