erwan
erwan

Reputation: 1305

Adding an entry in a submenu of a popup

I'm building a plugin, and adding an entry to the context menu (right-click on a folder in the project tree).

So far it works, following this tutorial: http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html

The problem is that it's adding my entry in the root of the context menu. Since my entry refers to a "New XXX" wizard, I want it to go to the "New" submenu.

It seems like I would have to set the correct locationURI or menuPath in my plugin.xml. However I can't find the locationURI or menuPath corresponding to that submenu. How can I find that?

Upvotes: 3

Views: 2656

Answers (2)

VonC
VonC

Reputation: 1323263

The new contributions are menu ID based, not menu path based. So it should be something like:

<menuContribution
locationURI="menu:file?after=additions" />

See this SO answer for an example of locationUri.
See Menu Extension for more. The exact id is either:

  • found in the existing plugin.xml from the menu or
  • determined with plugin Spy

alt text

See "How to add items in popup menu?" (from justinmreina) for more on adding an entry to a menu.

Upvotes: 5

Ambar
Ambar

Reputation: 35

If you've created a plugin for a 'New XXX' wizard, you can add it inside the 'New' menu that you see when you right-click inside the Navigator by customizing the perspective.

Go to Window -> Customize Perspective and click on the Shortcuts tab. You should see 'New XXX'. Select it and you're good to go.

enter image description here

Upvotes: 0

Related Questions