2011-06-01 183 views
1

我有以下類蝕類型AddEntryAction的層次結構是不一致的(JFACE)

class AddEntryAction extends Action { 
    public AddEntryAction() { 
    super("Add Entry"); 
    setToolTipText("Add Entry"); 
    } 
    public void run() { 
    WizardDialog dlg = new WizardDialog(MainClass.mainWindow.getShell(), 
     new AddEntryWizard()); 
    dlg.open(); 
    } 
} 

和行動類擴展AbstractAction其中實習生延伸eventmanager進行類。這兩個父類是Eclipse的SWT/JFace庫的一部分......我得到上面的類聲明

The project was not built since its build path is incomplete. Cannot find the class file for org.eclipse.core.commands.common.EventManager. Fix the build path then try building this project DisplayExample Unknown Java Problem

The type org.eclipse.core.commands.common.EventManager cannot be resolved. It is indirectly referenced from required .class files MainClass.java /DisplayExample/src line 94 Java Problem

AddEntryAction是相同的源文件MainClass.java內聲明下面的錯誤。其實,這是一個Java2s.com的例子...我有庫/罐子,因爲我可以看到所有這些類的編譯類

回答

3

錯誤「該項目不是自建立以來... org.eclipse.core。 「command.common.EventManager無法解析......」除了org.eclipse.swt和org.eclipse.jface包之外,swt/jface依賴可能由缺少引用源或包含org.eclipse.core包的二進制文件引起。

例如建立在我的情況路徑包括: SWT.JAR org.eclipse.jface_3.4.2.M20090107-0800.jar

以下JAR是缺失,造成上述錯誤: org.eclipse.core.commands_3.4.0.I20080509 -2000.jar