【问题标题】:Problem with adding plug-in spy capabilities to an RCP application向 RCP 应用程序添加插件间谍功能时出现问题
【发布时间】:2011-03-11 15:10:42
【问题描述】:

你们中的一些人可能知道,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,据我所知,不需要其他插件。

【问题讨论】:

标签: eclipse-plugin eclipse-rcp


【解决方案1】:

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

【讨论】:

  • 我试图这样做,但没有奏效。我尝试同时指定 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吗?
猜你喜欢
  • 2012-05-07
  • 1970-01-01
  • 2011-12-22
  • 1970-01-01
  • 2013-06-10
  • 2011-01-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多