English 中文(简体)
RCP 申请“指挥不明确”错误
原标题:RCP application "the command is undefined" error

当我试图管理申请时,我总是例外。 除此以外,一切都非常有用

java.lang.Exception
    at org.eclipse.jface.action.ExternalActionManager$CommandCallback.isActive(ExternalActionManager.java:370)
    at org.eclipse.jface.action.ActionContributionItem.isCommandActive(ActionContributionItem.java:647)
    at org.eclipse.jface.action.ActionContributionItem.isVisible(ActionContributionItem.java:703)
    at org.eclipse.jface.action.MenuManager.isChildVisible(MenuManager.java:999)
    at org.eclipse.jface.action.MenuManager.isVisible(MenuManager.java:567)
    at org.eclipse.jface.action.MenuManager.isChildVisible(MenuManager.java:999)
    at org.eclipse.jface.action.MenuManager.update(MenuManager.java:763)
    at org.eclipse.jface.action.MenuManager.update(MenuManager.java:682)
    at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:197)
    at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:213)
    at org.eclipse.ui.internal.WorkbenchWindow.createDefaultContents(WorkbenchWindow.java:1069)
    at org.eclipse.ui.internal.WorkbenchWindowConfigurer.createDefaultContents(WorkbenchWindowConfigurer.java:623)
    at org.eclipse.ui.application.WorkbenchWindowAdvisor.createWindowContents(WorkbenchWindowAdvisor.java:300)
    at org.eclipse.ui.internal.WorkbenchWindow.createContents(WorkbenchWindow.java:1036)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.ui.internal.Workbench$22.runWithException(Workbench.java:1211)
    at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
问题回答

That means a command definition is missing.
You will find example of similar error in this bug report or in EclipseZone.
You should have a The command ("org.eclipse.ui.file.closeAllSaved") is undefined preceding this exception.
("org.eclipse.ui.file.closeAllSaved" is only there as an example: it your case, it could be a different command)

In the case of the first one, the proposed patch "omit default handler as we don t have xxx support".

For the second one:

A simple workaround for an RCP app would be to include a useful definition in one of your plugins (or in a separate throw-away plugin).

类似:

categoryId="org.eclipse.ui.category.file"
id="org.eclipse.ui.file.closeAllSaved"    # replace by your missing command
name="Close All Saved"/> 

As VonC said, a command definition is missing. You should add something like this:

  <command
        name="Close All Saved"
        description="Close All Saved"
        categoryId="org.eclipse.ui.category.file"
        id="org.eclipse.ui.file.closeAllSaved">
  </command>

页: 1

还确保这一类 d 是指已经定义的一类,或将获得这样的警告:

!MESSAGE Commands should really have a category: plug-in= xxxxx , id= xxxx , categoryId= xxxxx 




相关问题
Extend ExportWizard defined in Plugin A in a depending Plugin

I m having Plugin A which extends the Export Wizard via the org.eclipse.ui.exportWizard ExtensionPoint. Plugin B depends on Plugin A, is it possible to add WizardPages defined in Plugin B to Plugin ...

Eclipse RCP: Only one Job runs at a time?

The Jobs API in Eclipse RCP apparently works much differently than I expected. I thought that creating and scheduling multiple Jobs would actually cause multiple worker threads to be created, ...

Plugin version on log4j log file

I m developing an RCP application and use log4j to generate logs. Whenever an exception is logged, I want to include a line on the log file to identify the application version. I could do that by ...

Two Eclispse projects -> One Eclipse Plug-in

Background I m a developer of the Vrapper project. Vrapper contains of 2 major parts Vim-emulation library (vrapper.core) Eclipse part that makes a good use of it We want vrapper.core to be ...

Setting network options in a RCP Application

We have a RCP application that does sometimes get some data from URLs in the internet. Our customer uses a Proxy-Server, and we can t get to the information we need unless the network-settings are ...

热门标签