Editor Action Initialization for Pop-up Menu [message #308902] |
Mon, 09 October 2006 16:26 |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: aron.soartech.com
I am implementing breakpoints for a custom editor/debugger in Eclipse 3.2.
As of right now, I have gotten them to the point where they can be
toggled on and off and enabled/disabled by right-clicking on the
vertical ruler and selecting the proper button in the pop-up menu (the
functionality is exactly like it is in the java editor).
It works like it should in every case except for in the editor that is
initially opened by Eclipse...the one where if you have a file open when
you exit Eclipse, it will save that state and open the file back up for
you when you restart.
What I have found is that this 'initial editor' gets created differently
than the others and therefore does not correctly initialize the actions
in the pop-up menu.
In the class org.eclipse.ui.internal.WorkbenchPartReference there is a
method called getPart() which ends up getting called when Eclipse is
setting a part as visible.
public final IWorkbenchPart getPart(boolean restore) {
if (isDisposed()) {
return null;
}
if (part == null && restore) {
...
//initialization stuff
...
}
return part;
}
Normally in this method if it is the first time a particular editor is
being shown, 'part' will be null (because the editor's constructor
hasn't been called yet) and it will initialize all the ui stuff correctly.
In the case of the 'initial editor' however, its constructor has already
been called by the time getPart() is called for the first time. This
means that 'part' is no longer null, it does not go into the if-block,
and the ui initialization does not happen.
This means that the actions for for setting breakpoints in the pop-up
menu do not work correctly because they have never been created. So the
question is how do I fix this?
Thanks!
Kyls Aron
|
|
|
Powered by
FUDForum. Page generated in 0.03532 seconds