I'm try to create a eclipse plugin... but how can I add a my new popup menu in the new context?
for example I right-click on the project and put my menu inside of New->MyNewMenu
to add a new item on menu File-New I'm using this
<extension point="org.eclipse.ui.menus"> <menuContribution locationURI="menu:new?after=additions"> <menu id="Test1.menus.sampleMenu"
but if I try popup:menu:new?after=additions on locationURI this not work...
when I use the Spy plugin of RCP eclipse to know the popup id is returned
menu:null?after=additions
how can I solve this problem?
To get something in the File > New menu you must use the org.eclipse.ui.newWizards
extension point to define a New wizard. On its own this will just make the New wizard appear in the 'Other...' section.
To add to the list of new wizards shown in the main part of the New menu you must use the org.eclipse.ui.perspectiveExtensions
extension point to define a newWizardShortcut
for your new wizard.
An example of a new wizard and shortcut from the JDT JUnit plugin:
<extension point="org.eclipse.ui.newWizards"> <category name="%WizardCategory.name" parentCategory="org.eclipse.jdt.ui.java" id="org.eclipse.jdt.junit"> </category> <wizard name="%TestCaseWizard.name" icon="$nl$/icons/full/etool16/new_testcase.gif" category="org.eclipse.jdt.ui.java/org.eclipse.jdt.junit" id="org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard"> <class class="org.eclipse.jdt.internal.junit.wizards.NewTestCaseCreationWizard"> </class> <description> %TestWizard.description </description> </wizard> </extension> <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective"> <newWizardShortcut id="org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard"> </newWizardShortcut> </perspectiveExtension> </extension>