Eclipse plugin Eclipse编辑器插件键绑定未显示在命令的菜单中
我有一个键绑定,可以在自定义Eclipse编辑器插件中触发命令:Eclipse plugin Eclipse编辑器插件键绑定未显示在命令的菜单中,eclipse-plugin,contextmenu,key-bindings,Eclipse Plugin,Contextmenu,Key Bindings,我有一个键绑定,可以在自定义Eclipse编辑器插件中触发命令: <key commandId="my.plugin.ui.MyCommand" contextId="my.plugin.ui.mycontext" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+M2+O"> </key> 我正在使用一
<key
commandId="my.plugin.ui.MyCommand"
contextId="my.plugin.ui.mycontext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M1+M2+O">
</key>
我正在使用一个新定义的contextmycontext
来覆盖已经存在的键绑定以组织导入mycontext
是org.eclipse.ui.contexts.window的子上下文
为该命令创建菜单项时,键盘快捷键不会显示在标签旁边,因为绑定的上下文不是org.eclipse.ui.contexts.window
,而是它的子项
右键单击.java
文件时,所需的演示文稿与默认绑定的演示文稿类似:
组织导入按Ctrl+Shift+O键
是否有方法显示自定义上下文的绑定?是否尝试在视图的“创建零件”控件方法中激活上下文
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
PlatformUI.getWorkbench().getService(IContextService.class).activateContext("custom.context.id");
}
});
只有当您的上下文实际处于活动状态时,才会显示(并且只使用)密钥绑定。是的,就是这样。谢谢你的建议!