[英]How to add new items to an existing menu in Eclipse?
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: 我的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. 如何在Eclipse菜单中找到现有命令的ID。
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. 在编辑器中查看menuContribution
时,可以添加一个新命令,然后单击“扩展元素详细信息”中commandId旁边的浏览 。 You'll get a list of all possible comands (at least in my Juno Version). 您将获得所有可能的命令的列表(至少在我的Juno版本中)。
If you are looking for a specific item, Alt+Shift+F2, then click on the menu entry you want to inspect. 如果要查找特定项目,Alt + Shift + F2,然后单击要检查的菜单项。
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. 您可以使用org.eclipse.ui.newWizards扩展点添加该点并将其指向Wizard
实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.