如何在Eclipse中扩展源菜单? (或:它的位置是什么?) [英] How to extend the source menu in Eclipse? (or: What is its locationURI?)
问题描述
由于旧的扩展点不推荐,文档说依赖于 不幸的是,当运行我的开发IDE的插件时,不会显示任何命令,也没有错误消息。什么也没有发生当我将locationURI设置为menu:help时,新的命令出现在帮助菜单中,所以问题似乎是locationURI。 我遇到同样的问题。我终于弄清楚,使用(推荐)扩展点 原因是在旧样式 所以坚持使用旧的API(由VonC建议)可能是最好的选择,直到 I am developing an eclipse plugin and trying to extend the source menu (mainMenubar/Source - visible when editing in the java-editor) in Eclipse 3.7. The documentation says to rely on the Unfortunately, when running the plugin for my development IDE no command appears, and also no error message. Just nothing happens. When I set the locationURI to "menu:help", the new command appears in the help menu, so the problem seems to be really the locationURI. I ran into the same problem. I finally figured out that extending the Source menu using the (recommended) extension point The reason is that a menu defined in an old style So sticking to the old API (as suggested by VonC) is probably the best option until the 这篇关于如何在Eclipse中扩展源菜单? (或:它的位置是什么?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! org.eclipse.ui.menus
-extension点。这是一个完整的秘密,我在哪里获得可靠的locationURI,但我终于设法找到一些似乎合理的URI与插件间谍(遵循一个建议 here )。
因此,以下应该是/ / / / / / / / / / / / / / / / / / / / / / / / / / < extension
point =org.eclipse.ui.menus>
< menuContribution
locationURI =menu:org.eclipse.jdt.ui.source.menu>
< command
commandId =some.command.id
label =某些标签
style =push>
< / command>
< / menuContribution>
< / extension>
org.eclipse.ui.menus
扩展源菜单是不可能的。
actionSet
(像Source菜单)中定义的菜单是在处理 org.eclipse.ui.menus
-extensions。这样一来,这些扩展只能帮助已经存在的菜单。
jdt
插件迁移到新的方法... org.eclipse.ui.menus
-extension point since the older extension points are deprecated. It is a complete secret to me where to obtain reliable locationURIs, but I finally managed to find some plausible URI with the Plugin Spy (following an advice here).
So the following should be the extension snippet for the plugin.xml:<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.jdt.ui.source.menu">
<command
commandId="some.command.id"
label="Some label"
style="push">
</command>
</menuContribution>
</extension>
org.eclipse.ui.menus
is not possible. actionSet
(like the Source menu) is created after the processing of org.eclipse.ui.menus
-extensions. The way it is, these extensions can only contribute to already existing menus.jdt
plugin is migrated to the new approach...