문제

I want to add a new item to a menu. For example

File > New > New item

or

Project > Build > Working set > New item

I've got this far with my plugin.xml:

<menuContribution
            allPopups="false"
            locationURI="i don't know id">
         <command
               commandId="testcommand"
               icon="icons/menu_icon01.jpg"
               label="test"
               style="push">
         </command>
</menuContribution>

How can I find out the IDs of existing commands in Eclipse menus.

도움이 되었습니까?

해결책

When you view your menuContribution in the editor, you can add a new command and click browse next to the commandId in the Extension Element Details. You'll get a list of all possible comands (at least in my Juno Version).

If you are looking for a specific item, Alt+Shift+F2, then click on the menu entry you want to inspect.

The menu File -> New however consists of Wizards. You can add to that using the org.eclipse.ui.newWizards extension point and pointing it to your Wizard implementation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top