Develop and plug-in a Graphical Model Editor

Home > Develop and plug-in a Graphical Model Editor

OOMEGA provides a textual editor out-of-the-box for your individual textual syntax that is based on your metamodel, i.e. you can model right-away without even the need of programming an editor. Anyway, sometimes it's very nice to have a graphical editor in addition so you can drag around some nice boxes and get a high-level overview of the model you are looking at. For sure, that's supported by OOMEGA, too.

You can do this by programming a graphical editor with the Eclipse Graphical Editing Framework (GEF) and inject your implementation by some plug-in extension points provided by Eclipse and the OOMEGA Core Plug-in. The purpose of this chapter is not to explain the details of the Graphical Editing Framework - as there are already good sources in the internet available. It's rather to highlight that OOMEGA is not restricted to textual modelling. Moreover it is shown how you can extend the given OOMEGA editor so that you can see an additional editor tab for your custom graphical editor implementation.

We have implemented a graphical editor for the meta-metamodel, namely "M2L Diagram". Here's a screenshot of that editor in action so that you can get a first impression how your custom editor could look like and how it will integrate in the overall OOMEGA modelling environment.

In fact the open source implementation of the "M2L Diagram" editor is probably the best source to look at when you plan to develop your own graphical editor. It is the project "OOMEGA-M2LEditor-Plugin" that you can find in OOMEGA's SVN repository. Please contact welcome@oomega.net to get the link to that repository. By the way, the open source project "OOMEGA-Core-Plugin" contains various classes that facilitate the development of custom graphical editors. Those are used by the "M2L Diagram" editor so you can see them in action. Two examples are "AbstractDiagramEditor" and "AbstractDiagramPalette".

Please have a look at the following screenshots that show parts of the Eclipse plug-in configuration which is needed for injecting your custom editor implementation into the OOMEGA modelling environment. Finally the last screenshot highlights the source code of the "M2LEditorPage" class where you can see the call to the "addPage()" method; this is an essential entry point of the "MultiPageEditor" and leads to inclusion of an additional editor tab for your custom graphical editor.

Next chapter: Object Persistency API

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.