Creating an EMF Model using a Graphical Editor
Top
Previous: Prerequisites
Next: Creating Classes
Step 1: Creating a New Model
We first create a Java project and then use the wizard to create a new EMF model.
-
In the Navigator view in the Resource perspective, right-click on the blank area and select New > Project...:
-
Select "Java" and "Java Project". Click the "Next" button.
- Enter library as the project name. Click the Finish button.
-
Click the "Add Folder" button.
-
Click the "Create New Folder" button.
-
Type "src" and click the "OK" button.
-
Click the "OK" button.
-
When asked if you want to remove the project as source folder and update the
build output folder to "library/bin", click the "Yes" button.
-
Specify "library/runtime" as the build default output folder. Click the
"Finish" button.
-
The newly created Java project can be seen in the Package Explorer.
- On the Navigator view, right-click on the src folder and select New > Folder.
- Enter model as the folder name. Click the Finish button.
- With the model folder selected, select File > New > Other....
- Select EMF Diagrams on the left pane and EMF Class Diagram on the right. Click the Next button.
- Change the file name to library.ecd and the package name to org.ecilpse.example.library. You can also add some description if your like. Click the Finish button.
- A pair of files, the .ecore and the .ecd files, will be created and the graphical editor will be opened in the main view.
The .ecore file contains the structure of the model while the .ecd file contains the graphical layout information.
Top
Previous: Prerequisites
Next: Creating Classes