简体   繁体   English

如何在Eclipse中将新项目添加到现有菜单?

[英]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.

相关问题 如何在Eclipse插件开发中向现有的“File”菜单添加上下文菜单? - How to add a context menu to existing “File” menu in Eclipse Plugin development? WTP Eclipse JavaScript 编辑器 - 如何添加上下文菜单项? - WTP Eclipse JavaScript editor - how to add context menu items? 如何在Eclipse中的“文件”>“新建”>“_____”菜单中添加“Android项目”? - How do I add “Android Project” to the File>New>_____ Menu in Eclipse? 在运行菜单项中添加 Eclipse 默认菜单项 - Add Eclipse default menu items in Run Menu Item 将自定义向导添加到eclipse插件中的新菜单 - Add custom wizards to new menu in eclipse plugin 将新的maven run配置添加到Eclipse中的菜单 - add new maven run configuration to menu in Eclipse 如何在弹出菜单中添加项目? - How to add items in popup menu? Eclipse RCP:如何在工具栏中的默认Java下拉菜单中添加新元素(新Java类) - Eclipse RCP: How to add a new element to a default Java dropdown menu in the toolbar(New Java Class) Eclipse如何在Eclipse中添加新的Web服务运行时 - Eclipse how to add new webservice runtime in Eclipse Eclipse PDT:如何将“ Javascript”作为选项添加到PHP Explorer的Ne​​w…弹出菜单? - Eclipse PDT: How to add 'Javascript' as an option to the PHP explorer New… popup menu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM