Skip to main content



      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 08:31 Go to next message
Eclipse UserFriend
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 14:18 Go to previous messageGo to next message
Eclipse UserFriend
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 06:41 Go to previous message
Eclipse UserFriend
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: Sun Apr 27 23:57:52 EDT 2025

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

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

Back to the top