I'm struggling with developing an Eclipse plugin. In general, you should be able to select some lines of Java code in the Java editor, then click a button and do something with the selected code.
How can I actually access this particular Java editor and the selection from the plugin? As a skeleton, I'm using this simple Hello World example, which adds a button to the toolbar, popping up a dialog box when clicking it.
The only thing I have is an instance of IWorkbenchWindow
. Using this API, I will get an IEditorPart
calling window.getActivePage().getActiveEditor()
, which seems to be pretty useless for my purpose ...
Any help is highly appreciated
Cheers -Frank