简体   繁体   中英

EMF: Generate Editor Code

I just started using Eclipse Modeling Framework (EMF), and I'm having some troubles with the following tutorial:

http://www.vogella.com/tutorials/EclipseEMF/article.html

Everything was going smooth until I tried to Generate Editor Code (step 5.1). When I did that, the newly generated code just came out filled of errors because Eclipse couldn't find most of the required classes. I already imported EMF libraries from multiple ways, but probably my problem is that I'm not using the correct ones. Can anyone tell me where to download the correct ones? Or simply spot what I may be doing wrong? Below you have the list of imports that are messing up with Eclipse....

Thanks in advance!

EDIT: I am supposed to use RAP as a target application!

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;

I finally got rid from the errors. To do that, I just needed to check the Rich Ajax Platform flag under the genmodel Properties view, as shown in the screenshot below:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM