我正在使用自己的视图扩展eclipse平台。这个视图在其工具栏中包含一个操作。
我想要为这个操作创建一个与Ctrl+R相关联的快捷键绑定。为此,我创建了一个my.context(我的上下文扩展org.eclipse.ui.window context)、my.command和my.command.binding扩展。
然后,在createPartControl(*)方法中创建我的视图时,我激活了我的上下文:
IContextService contextService = (IContextService) getSite()
.getService(IContextService.class);
contextService.activateContext(VIEW_CONTEXT_ID);
当我的视图在调试模式下打开时,我会收到以下警告:
Warning: A conflict occurred for CTRL+R:
Binding(CTRL+R,
ParameterizedCommand(Command(org.eclipse.debug.ui.commands.RunToLine,Run to Line,
Resume and break when execution reaches the current line,
Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true),
ActionDelegateHandlerProxy(null,org.eclipse.debug.internal.ui.actions.RetargetRunToLineAction),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.debug.ui.debugging,,,system)
Binding(CTRL+R,
ParameterizedCommand(Command(RestoreAction,Restore Chart (T-Charts),
Restore the initial chart display,
Category(TChartsActions,T-Charts Actions,null,true),
ActionHandler(com.st.tcharts.internal.actions.RestoreChartAction@1997b8a),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
com.st.tcharts.ui.view,,,system)
我不确定为什么会出现这个警告...
是否有多个活动上下文同时存在?
如果我将我的快捷键更改为Ctrl+C,例如,我就没有这个警告,但是在调试上下文中,Ctrl+C也绑定到另一个命令(复制)...为什么呢?
我在网上没有找到关于Eclipse上下文的清晰资源...
提前感谢!
Manu