views:

238

answers:

1

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

A: 

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"

VonC
Thanks a lot Vonc
This locationuri is working for main menu, however its not working for popup which is coming from project explorer.Also i tried with this locationuri "popup:new?after=additions".How to bring my submenuId in popup ?