如何在Eclipse中查找键绑定的命令ID? [英] How to find a command ID for a key binding in Eclipse?
问题描述
在Eclipse(针对此问题为3.x)中,您可以使用插件间谍和菜单选择间谍来查找有关可通过以下方式访问的UI元素的信息:
In Eclipse (3.x for that matter) you can use the Plug-in Spy and Menu Selection Spy to find out information about UI elements which are accessible via the mouse.
我现在正面临一个问题,我想了解由某个键绑定触发的命令(我需要命令ID),因为我想在自定义UI(视图/编辑器)中为此命令创建一个菜单项。
I am now facing the problem that I want to find out about the command (I need the command id) which is triggered by a certain key binding, because I want to create a menu item for this command in my custom UI (view/editor)).
在我的具体情况下,我正在寻找全部展开children 命令,该命令由 Numpad + Plus 在通用导航器中触发。但是,我对寻找有关键绑定的一般方法感兴趣。
In my concrete case I am looking for the Expand All children command which is triggered by Numpad+Plus in a common navigator. However, I am interested in a general way to find out about key bindings.
我知道我可以通过首选项对话框或键绑定QuickView(在Windows中为 CTRL + SHIFT + L );但是在那里,我只能找到有关命令名称的信息,而不是有关命令的ID或贡献性插件的信息。
I know that I can access the key bindings via the preferences dialog or the key binding QuickView (CTRL+SHIFT+L in Windows); but there, I can only find out about the command name, not the ID or the contributing plug-in of the command.
推荐答案
您可以使用Eclipse 搜索/插件搜索
搜索扩展点。在这种情况下,请搜索 org.eclipse.ui.bindings
来查看键绑定:
You can use the Eclipse Search / Plug-in Search
to search for an extension point. In this case search for org.eclipse.ui.bindings
to see the key bindings:
搜索将给出插件列表,打开一个列表项以查看plugin.xml突出显示扩展点的插件。您将需要搜索插件和条目以找到所需的内容。
The search will give to a list of plug-ins, open a list item to see the plugin.xml for the plug-in with the extension point highlighted. You will have to search through the plug-ins and entries to find what you want.
全部展开
键绑定在 org.eclipse.ui
插件中定义,并具有命令ID org.eclipse.ui.navigate.expandAll
The Expand All
key binding is defined in the org.eclipse.ui
plug-in and has command id org.eclipse.ui.navigate.expandAll
您可能需要检查在<$ c中包括来自Java搜索中目标的所有插件 $ c>首选项>插件开发
,以使搜索在目标平台(需要是Eclipse)中进行。
You may need to check the Include all plug-ins from target in Java search
in Preferences > Plug-in Development
to get the search to look in the target platform (which needs to be Eclipse).
这篇关于如何在Eclipse中查找键绑定的命令ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!