我刚刚开始使用Eclipse Modeling Framework(EMF),并且在以下教程中遇到了一些麻烦:
http://www.vogella.com/tutorials/EclipseEMF/article.html
直到我尝试生成编辑器代码(步骤5.1),一切都进行得很顺利。当我这样做时,新生成的代码中充满了错误,因为Eclipse无法找到大多数必需的类。我已经通过多种方式导入了EMF库,但是可能的问题是我没有使用正确的库。谁能告诉我在哪里下载正确的文件?还是只是发现我可能做错了什么?下面是混乱的Eclipse导入列表。...
提前致谢!
编辑:我应该使用RAP作为目标应用程序!
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.action.ValidateAction;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.SubContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
最佳答案
我终于摆脱了错误。为此,我只需要检查genmodel Properties视图下的Rich Ajax Platform标志,如下面的屏幕快照所示:
关于java - EMF:生成编辑器代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21832567/