【发布时间】:2011-06-20 12:44:05
【问题描述】:
我想将 Toggle Breakpoint 命令 org.eclipse.debug.ui.commands.ToggleBreakpoint 绑定到 F9 键。
我是这样扩展org.eclipse.ui.bindings的:
<extension point="org.eclipse.ui.bindings">
<scheme
description="Default scheme for xvr"
id="org.xvr.scheme"
name="xvr.scheme"
parentId="org.eclipse.ui.defaultAcceleratorConfiguration">
</scheme>
<key
commandId="org.eclipse.debug.ui.commands.ToggleBreakpoint"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.xvr.scheme"
sequence="F9">
</key>
但是当我启动我的 RCP 应用程序时,如果我按下 F9,什么也不会发生。
我做错了什么?
编辑
抱歉造成误会,但我正在从 eclipse 开发新产品,无法使用 eclipse 的偏好窗口。
我必须通过 org.eclipse.ui.bindings 扩展点提供绑定。
EDIT2
感谢 Paul,使用跟踪我看到按 F9
时引发了异常COMMANDS >>> execute >>> starting: id=org.eclipse.debug.ui.commands.ToggleBreakpoint; event=ExecutionEvent(Command(org.eclipse.debug.ui.commands.ToggleBreakpoint,Toggle Breakpoint,
Creates or removes a breakpoint,
Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true),
,
,,true),{},Event {type=1 StyledText {} time=25349140 data=null x=0 y=0 width=0 height=0 detail=0},org.eclipse.core.expressions.EvaluationContext@ffa7e1)
COMMANDS >>> execute >>> not handled: id=org.eclipse.debug.ui.commands.ToggleBreakpoint; exception=org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.debug.ui.commands.ToggleBreakpoint
【问题讨论】:
-
您的错误日志中有什么内容吗?
<workspace>/.metadata/.log或者您可以将 -consoleLog 添加到您的启动参数中。您还可以设置一些跟踪选项以查看按 F9 时会发生什么 - wiki.eclipse.org/Platform_Command_Framework#Tracing_Option -
感谢 Paul!使用跟踪选项我看到抛出了一个异常......更多关于编辑
-
这意味着在您的 RCP 中没有提供该命令的实现。在你的 Eclipse 中运行跟踪,你就会知道是什么在做这项工作。
标签: java eclipse eclipse-plugin eclipse-rcp