This cheat sheet is a step-by-step description of how to generate an EMF
model and editor from a set of annotated Java interfaces.
-
Your environment must be set up before you can perform the steps in this cheat sheet.
Delete or rename the following projects if they exist in your workspace: "library.java", "library.java.edit", "library.java.editor".
-
First, you must create a new "library.java" empty EMF project to house the annotated Java.
-
Create the interfaces and class in the "library.java" project that describe the model.
The model consists of three interfaces ("Library", "Writer", and "Book") and
a class ("BookCategory"), all in the "org.eclipse.example.library" package.
You can click on (?) to see the contents of the interfaces and class.
-
Create an EMF model from the annotated Java.
-
Generate the code to implement the model and an editor for it. The generator is automatically opened on completion of the wizard in the previous step.
-
Now, you are set to run the generated editor and create a new library instance.
Congratulations! You have succesfully created an EMF model from annotated Java interfaces, generated the code, and created an instance of the model.