Eclipse plugin 向RCP应用程序添加插件间谍功能时出现问题

Eclipse plugin 向RCP应用程序添加插件间谍功能时出现问题,eclipse-plugin,eclipse-rcp,Eclipse Plugin,Eclipse Rcp,你们中的一些人可能知道,EclipseIDE有一个很好的特性,叫做“插件间谍” 我想将此功能添加到我自己的RCP应用程序中。现在,我将org.eclipse.pde.runtime添加到我的依赖项列表中,由于我定义了一个不同的键绑定模式,我还创建了一个指向SpyHandler的命令,并定义了一个键绑定,它绑定给定上下文中的某个键组合 现在问题是,命令已执行,但我得到以下异常: KEYS >>> WorkbenchKeyboard.executeCommand(commandId

你们中的一些人可能知道,EclipseIDE有一个很好的特性,叫做“插件间谍”
我想将此功能添加到我自己的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
KEYS>>>WorkbenchKeyboard.executeCommand(commandId='org.eclipse.pde.ui.spy.commands.spyCommand',参数={})
16:00:52107警告[ErrorReporter]-调用Error Reporter以处理java.lang.ExceptionInInitializeError
位于org.eclipse.pde.internal.runtime.spy.dialogs.SpyDialog.createDialogArea(SpyDialog.java:82)
位于org.eclipse.pde.internal.runtime.spy.dialogs.SpyDialog.createContents(SpyDialog.java:71)
位于org.eclipse.jface.window.window.create(window.java:431)
位于org.eclipse.pde.internal.runtime.spy.handler.SpyHandler.execute(SpyHandler.java:38)
位于org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
位于org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
位于org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
位于org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
位于org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
在org.eclipse.ui.internal.keys.WorkbenchKeyboard.press上(WorkbenchKeyboard.java:786)
位于org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
位于org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
位于org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
位于org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
位于org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
位于org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
位于org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
位于org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
位于org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
位于org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
位于org.eclipse.swt.widgets.Shell.sendKeyEvent(Shell.java:1361)
位于org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
位于org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
位于org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
位于org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
位于org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
位于org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
位于org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
位于org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
位于org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
位于org.eclipse.swt.internal.win32.OS.DispatchMessageW(本机方法)
位于org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)上
位于org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
位于org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
位于org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
位于org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
位于org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
位于org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
位于org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在org.eclipse.equinox.internal.app.eclipseeapphandle.run上(eclipseeapphandle.java:196)
位于org.eclipse.core.runtime.internal.adapter.eclipseeappluncher.runApplication(eclipseeappluncher.java:110)
位于org.eclipse.core.runtime.internal.adapter.eclipseeappluncher.start(eclipseeappluncher.java:79)
位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:369)
位于org.eclipse.core.runtime.adapter.EclipseStarter.run(EclipseStarter.java:179)
位于org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
位于org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
位于org.eclipse.equinox.launcher.Main.run(Main.java:1407)
位于org.eclipse.equinox.launcher.Main.Main(Main.java:1383)
原因:java.lang.NullPointerException
位于org.eclipse.pde.internal.runtime.PDERuntimePluginImages.makeiconur(PDERuntimePluginImages.java:117)
位于org.eclipse.pde.internal.runtime.PDERuntimePluginImages.create(PDERuntimePluginImages.java:106)
位于org.eclipse.pde.internal.runtime.PDERuntimePluginImages(PDERuntimePluginImages.java:43)
... 50多


有人能帮我吗?有没有可能我的目标中遗漏了什么(这是一个定制的目标)?如果是的话,是什么?我添加了org.eclipse.pde.runtime,据我所知,不需要其他插件。

为什么需要创建新命令?您可以在keybinding架构中绑定现有命令并分配新密钥。

我尝试过这样做,但没有成功。我尝试同时指定org.eclipse.pde.ui.spy.commands.spyCommand和org.eclipse.pde.runtime.spy.commands.spyCommand。这些都不起作用。我必须使用该id创建一个命令,并将SpyHandler指定为默认处理程序。命令现在已执行,但正如您所见,我得到一个错误。org.eclipse.pde.runtime.spy.commands.spyCommand是正确的id。您可以粘贴plugin.xml吗?可能是