Creating an EMF Model using a Graphical Editor
Top
Previous: Prerequisites
Next: Creating Classes
Step 1: Creating a New Model
We first create a simple 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 Simple on the left pane and Project on the right. Click the Next button.
- Enter library as the project name. Click the Finish button.
- We are going to create the subfolders src/model and place the ecore model in there so that the file system structure is the same as in the earlier tutorials.
On the Navigator view, right-click on the library project and select New > Folder.
- Enter src as the folder name. Click the Finish button.
- 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