How do you find the locationURI of menu contributions?(你如何找到菜单贡献的 locationURI?)
问题描述
当用户在项目资源管理器中右键单击文件时,我已经设法通过添加如下内容将一个项目添加到弹出菜单中:
I've managed to add an item to the popup menu when the user right-clicks on a file in the Project Explorer by adding something like this:
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions">
<command
commandId="commands.mycmd"
label="do foo"
style="push">
</command>
</menuContribution>
</extension>
现在,我知道使用 org.eclipse.ui.navigator.ProjectExplorer 的唯一原因是因为其他人似乎都在这样做(Eclipse PDE 文档中没有记录).问题是我希望在导航器和包资源管理器视图中也具有相同的功能(右键单击文件,您可以像在项目资源管理器中一样执行do foo".如何找到这另外两个视图(包资源管理器和导航器)?
Now, the only reason I knew to use org.eclipse.ui.navigator.ProjectExplorer is because that is what everyone else seems to be doing (there is no record of this in Eclipse PDE documentation). The problem is that I want the same functionality in the Navigator and the Package Explorer views as well (right-click on a file and you can do "do foo" as in the Project Explorer. How do I find the locationURI of these other two views (Package Explorer and Navigator)?
我已尝试使用 alt+shift+F2 提示来查找此类信息,但 Eclipse 不允许您在激活此模式时获取选项卡本身的信息.
I've tried the alt+shift+F2 tip to find such information but Eclipse does not allow you to get the information of the tab itself when you activate this mode.
推荐答案
使用
locationURI="popup:org.eclipse.ui.navigator.any?after=additions">
它会成功的.
这篇关于你如何找到菜单贡献的 locationURI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:你如何找到菜单贡献的 locationURI?
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 存储 20 位数字的数据类型 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
