Java – how to get the activity editor in the Eclipse Plug-in?

In my eclipse plug - in, I need to know if the editor visible on the screen has changed I'm getting the following active editors:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()

This applies in most cases, except after pressing the green continue button:

If I use the F8 shortcut, the active editor will update as expected

It seems that the active editor properties will not be updated until the editor tab gets focus (not when the Continue button is pressed)

Is there any other route you can take to get the "visible editor"?

Thank you in advance

Allen

Solution

>An editor works only when there is focus, so you get the correct output of the API Users of plug-ins will not run in debug mode, so don't care about end users

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

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>