正如你们中的一些人所知,Eclipse IDE有一个很好的功能叫做“Plug-in Spy”。
我想将此功能添加到我自己的RCP应用程序中。现在,我将org.eclipse.pde.runtime添加到我的依赖项列表中,并且由于我定义了一个不同的键绑定模式,我还创建了一个指向SpyHandler的命令,并且我定义了一个绑定某个键组合的键绑定在给定的背景下。
现在问题是,命令被执行,但我得到以下异常:
KEYS >>> WorkbenchKeyboard.executeCommand(commandId = 'org.eclipse.pde.ui.spy.commands.spyCommand', parameters = {})
16:00:52,107 WARN [ErrorReporter] - Error Reporter invoked to handle java.lang.ExceptionInInitializerError
at org.eclipse.pde.internal.runtime.spy.dialogs.SpyDialog.createDialogArea(SpyDialog.java:82)
at org.eclipse.pde.internal.runtime.spy.dialogs.SpyDialog.createContents(SpyDialog.java:71)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.pde.internal.runtime.spy.handlers.SpyHandler.execute(SpyHandler.java:38)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Shell.sendKeyEvent(Shell.java:1361)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.NullPointerException
at org.eclipse.pde.internal.runtime.PDERuntimePluginImages.makeIconURL(PDERuntimePluginImages.java:117)
at org.eclipse.pde.internal.runtime.PDERuntimePluginImages.create(PDERuntimePluginImages.java:106)
at org.eclipse.pde.internal.runtime.PDERuntimePluginImages.<clinit>(PDERuntimePluginImages.java:43)
... 50 more
任何人都可以帮我吗?是否有可能我在目标中缺少某些东西(它是一个自定义构建的目标)?如果是这样,什么?我添加了org.eclipse.pde.runtime,据我所知,不需要其他插件。
答案 0 :(得分:0)
为什么需要创建新命令?您可以在键绑定模式中绑定现有命令并分配新键。