Sunday, March 1, 2009

Generating Strongly-Typed Properties Classes With openArchitectureWare, Part 1 Addendum: Graphical Ecore Editor

Last time I showed how to build an Ecore metamodel in Eclipse using the Sample Ecore Model Editor. Ed Merks from the EMF team (whose EMF book is out in a new edition, by the way) commented that I could be using the Graphical Ecore Editor, which is a part of the Ecore Tools subproject. He is absolutely correct. (Thanks Ed.) There are a couple of steps to go through to do that, so I'll talk about those here.

First, you need to install the Ecore Tools package, which you can find on the Ganymede Update Site (assuming you're using Eclipse 3.4) under "Models and Model Development". After you do that, you can select File | New | Other in Eclipse, and there will be an "Ecore Tools" folder available. Underneath that, choose "Ecore Diagram". A wizard appears, and you can select your .ecore file as the domain model.

This will add a file to your project which has the extension ".ecorediag", and when you open it up, you'll get a Rose-like boxes-lines-and-properties editor which is far more user-friendly than the sample editor. Here is what my Properties Generator metamodel looks like in diagram form after some slight rearrangement:

No comments: