5. Create EMF Editor plug-ins #
See the YouTube playlist for all videos.
EMF can generate plug-ins which provide wizards for creating new model instances and an editor which allows you to enter your model information.
The following assumes that you have already have knowledge in developing Eclipse plug-ins. For more information about Eclipse plug-in development please see Eclipse Plugin Tutorial
5.1. Generating edit / editor code #
Eclipse EMF allow you to create a editor for your model. Select your .genmodel file, right-click on it and select Generate Edit Code and afterwards Generate Editor Code.
Two Eclipse plugin projects have been created, “de.vogella.emf.webpage.model.edit” and “de.vogella.emf.webpage.model.editor”.
5.2. Run your plugins #
Select the *.editor project and start a new Eclipse instance with your new plug-in via right mouse-click on it and by selecting Run-As > Eclipse application.
This should start a new Eclipse runtime instance. If you cannot see this entry in the menu, you will need to install Eclipse Plug-in Development Environment.
5.3. Create your model #
In new Eclipse instance create a new project of type General called testing and a folder called website.
Select this folder, right click on it, select New > Other… > Example EMF Model Creation Wizards > Webpage Model.
Name your model My.webpage
.
Select as the Model Object Web
and press finish.
5.4. Edit your model #
You should now see an editor for your website.model.
Right-click on "My Web" and create a new elements. To edit the elements use the "Properties View" which can be found under Window > Show View > Properties.
Save your created model.
Hint: If you cannot see the menu “New Child” make sure that you have created the association as a composition by selecting “Containment” as shown on page 14.