|Re: Reuse of Menu Elements / MenuContributions [message #1173443 is a reply to message #870392]
||Wed, 06 November 2013 14:25
| Cedric Marin
Registered: November 2013
I bring back the subject to life because I found in the Eclipse source code other ways to share menus that look like Eclipse 3 menu contributions.|
I have tested them in my project and it works:
You can add MMenuContribution to a MApplication 'menuContributions' feature.
This MMenuContribution has a 'parentId' : the menu ID of the menu you want to complete and
menu items that will be added to a menu.
You can also add "popup:an.identifier" tags to MMenu and MPopupMenu elements.
With all these elements, the MMenuContribution will be added to a MMenu if:
- the MMenu identifier equals the contribution parentId
- parentId is 'popup' : the contribution will be added to ALL popup menus
- the MMenu has a "popup:an.identifier" tag equals to the MMenuContribution parentId "an.identifier"
So to share a MMenuContribution to many MMenu elements you:
- put a "popup:an.identifier" tags to MMenu
- set parentId "an.identifier" on the MMenuContribution
The MMenuContribution also has a position attribute to specify where the contribution will be inserted.
Powered by FUDForum
. Page generated in 0.02255 seconds