Reputation:
In eclipse plugin development i could add files in toolbar, menu and popupmenu by using menu contribution.
In my project I want to add a set of files in the popupsubmenu,
eg : Like the following
Project Explorer -> Right Click -> New -> Annotation, Class, Enum ....
I want to add my files abc,def and xyz.. under the new menu item
What is the locationuri for popupsubmenu ?
Help me on this
Thanks in advance
Regards Mathan
Upvotes: 1
Views: 3331
Reputation: 1323263
For the first part, see "How to add items in popup menu?" (from justinmreina) for more on adding an entry to a menu.
Note the second part of this answer is for package explorer.
For project explorer, the location uri would be:
menu:common.new.menu?after=new
(Example, but for package explorer)
Something like (if you follow this thread):
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:new?after=myGroup1">
<command
commandId="com.mycpy.myproject.ui.pluginXX.commands.openNewWizard"
disabledIcon="icons/disabled/new.gif"
icon="icons/enabled/new.gif"
id="com.mycpy.myproject.ui.pluginXX.menus.openNewWizard"
label="PluginXX"
tooltip="PluginXX"
mnemonic="XX">
</command>
</menuContribution>
</extension>
I would use as locationuri:
menu:new?after=additions
(no need to define a custom group here)
See also Wiki "Menu Contributions"
Upvotes: 1