Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » MultiPageEditorPart with Tree page loses context menu on page change
MultiPageEditorPart with Tree page loses context menu on page change [message #333259] Tue, 02 December 2008 15:57 Go to next message
Travis Haagen is currently offline Travis HaagenFriend
Messages: 1
Registered: July 2009
Junior Member
Hello,

[Sorry if this is a repost... the Eclipse newsgroups were giving me
errors on Dec 1st and it doesn't look like this was posted.]

I'm working on an editor that extends MultiPageEditorPart. It has two
pages, one contains a Tree from a TreeViewer and the other has a
TextEditor. The Tree is on the default page, and the popup context menu
displays properly, but when I switch to the page with the TextEditor and
then back to the Tree page, the popup context menu doesn't display
anymore. Note: It always works fine on the TextEditor page.

When I hit ALT-SHIFT-F1 to display "The Plugin Spy," the popup context
menu is somehow reinitialized and works again.

I'm creating an empty popup context menu in my editor class, and
populating it with Command Framework extensions in the plugin.xml.
Here's the code that creates the empty context menu:

MenuManager treeMenuManager = new MenuManager("#PopupMenu");
treeMenuManager.add(
new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

Tree tree = treeViewer.getTree();
Menu treeContextMenu =
treeMenuManager.createContextMenu(tree);
tree.setMenu(treeContextMenu);

getEditorSite().registerContextMenu(
treeMenuManager, treeViewer, false);

I found the following bug that might be related to this issue. It
highlights the fact that when a page change occurs, MultiPageEditorPart
seems to do more behind-the-scenes work for pages consisting of Editors
as opposed to pages composed of Components. (Be sure to take a look at
activateSite() and deactivateSite() which are called by pageChange(int)
and also do more for editors.)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=177333

My questions are... is the problem I'm seeing a new bug or related to
the above bug? How can I programmatically get my context menu to work
again on my Tree page when I switch back to it? For example, what should
I be doing in the overridden method pageChange(int) before/after I call
super.pageChange(int)?

Thanks for any help you can provide,

Travis Haagen
Re: MultiPageEditorPart with Tree page loses context menu on page change [message #333295 is a reply to message #333259] Wed, 03 December 2008 15:24 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Travis,

I would open a bug at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&short_desc=[Contributions]

Include your description, and it would help if you included a bare-bones
MPEP that worked the way you describe (attach an exported project).

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:no visible progress-monitor with IWorkbenchSiteProgressService?
Next Topic:Reusing a propertyTester outside expressions
Goto Forum:
  


Current Time: Fri Apr 26 07:12:48 GMT 2024

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

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

Back to the top