Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How can I add submenus for pop up menu programatically?
How can I add submenus for pop up menu programatically? [message #894760] Tue, 10 July 2012 12:31 Go to next message
becks m is currently offline becks mFriend
Messages: 59
Registered: June 2012
Member
Hi,
In my plugin, I have a pop up menu with menu item 'X' and I want to add submenu to this menu item

and the number and labels of menu items in the submenu and their action will change.

I think I can't do this from plugin.xml, so how to do this programatically?
Re: How can I add submenus for pop up menu programatically? [message #895122 is a reply to message #894760] Wed, 11 July 2012 18:18 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Do you create the entire context menu in one of your views, and register it? You could add an IMenuListener to the appropriate MenuManager in that case.

You can also still use org.eclipse.ui.menus/menuContribution. Just contribute a dynamic element and implement org.eclipse.ui.actions.CompoundContributionItem

PW


Re: How can I add submenus for pop up menu programatically? [message #895274 is a reply to message #895122] Thu, 12 July 2012 10:41 Go to previous message
becks m is currently offline becks mFriend
Messages: 59
Registered: June 2012
Member
Paul Webster wrote on Wed, 11 July 2012 14:18
Do you create the entire context menu in one of your views, and register it? You could add an IMenuListener to the appropriate MenuManager in that case.

You can also still use org.eclipse.ui.menus/menuContribution. Just contribute a dynamic element and implement org.eclipse.ui.actions.CompoundContributionItem

PW

Thanks Paul,
I did it with dynamic and it fits what I wanted Smile
Previous Topic:Export Product to Mac (Carbon)
Next Topic:Enable/Disable menu item in eclipse plugin
Goto Forum:
  


Current Time: Thu Apr 18 02:25:32 GMT 2024

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

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

Back to the top