Creating an EMF Model using a Graphical Editor
Top
Previous: Generating the Model and Editor
Next
Step 5: Modifying the Model
When you modify the EMF model in the graphical editor, it will sychronize the changes with the corresponding GenModel model.
-
Working in the Resource perspective, double-click on the library.genmodel in the Navigator view to open it so that both the EMF model and GenModel model are shown.
If you have closed the EMF model, double-click on the library.ecore file or the library.ecd file in the Navigator view to open the EMF model.
- Go to the EMF model view, select the Book class, right-click and select New > Attribute to add a new attribute. Enter isbn as the name and click the OK button.
- You can see that the EMF model and the GenModel model are not synchronized. The newly added attribute isbn is not in the GenModel model.
- To synchronize, save the EMF model by selecting File > Save or simply pressing the Ctrl+S key.
- The
change still does not show up in the GenModel model yet. You have to switch
the GenModel model view into focus. It will then be reloaded. When you expand
to the Book class in the GenModel model again, you will find the new attribute.
Top
Previous: Generating the Model and Editor
Next