Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Editor Action Initialization for Pop-up Menu
Editor Action Initialization for Pop-up Menu [message #308902] Mon, 09 October 2006 16:26
Eclipse UserFriend
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
Previous Topic:How to set an editor to use custom line separators during startup?
Next Topic:How to open multipe instances of a plugin view?
Goto Forum:
  


Current Time: Sun Jul 28 03:16:45 GMT 2024

Powered by FUDForum. Page generated in 0.02924 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top