GMF
GMF is the Graphical Modelling Framework used in Eclipse; also see EMF for the framework itself.
Some key tutorials that I have found to be helpful when working out how the crazy beast called GMF works:
- The cheat sheet in Eclipse itself: Help > Cheat Sheets
- http://wiki.eclipse.org/index.php/GMF_Tutorial – the basics
- http://wiki.eclipse.org/GMF_Documentation – especially the rest of the tutorial parts
- http://www.eclipse.org/articles/Article-FromFrontendToCode-MDSDInPractice/article.html – integrating GMF etc into an actual project
These might be helpful, because GMF is a little rough around the edges:
- Creating a new GMF Editor
- GMF Diagram Partitioning
- GMF Drag Drop (Shortcuts)
- GMF Static Labels
- Enabling Dynamic Templates in GMF
- Migrating Dynamic Templates to GMF 2.2
- Having Multiple Containments of the Same Domain Element in GMF
- GMF Code Samples (lots in here)
- GMF Refactoring
- Using EOpposite in GMF
- Ecore
- GMFGraph
- Using Platform Resources as EReferences in GMF
- GMF Custom Figures
Troubleshooting:
- GMF Troubleshooting
- GMF Troubleshooting 2
- GMF Troubleshooting 3
- GMF Troubleshooting 4
- GMF Troubleshooting 5
- GMF Troubleshooting 6
- GMF Troubleshooting 7
- GMF Troubleshooting 8
- GMF Troubleshooting 9
- GMF Troubleshooting 10
Advanced tutorials:
- How to have both a visual outline view and a tree outline view simultaneously
- How to have icons in the outline view
- Hiding unnecessary properties
- Different EMF model versions in GMF editors
- EMF model documentation: using <!– begin-model-doc –>
- Representing a node with a JPEG image
- Loading .ecore Resources through Browse Registered Packages
Advanced references:
- Eclipse Development with GEF and EMF (256 page PDF)
- GMF Labels
Adding the GMF source files to your source path
The easiest way to do this is to go to the software update manager thing, and download the GMF SDK – similar to the method used to install EMF/GMF in the first place.
Cannot insert new nodes into an EMF editor
If you cannot right click and add children to a wizard-generated model in your EMF-generated plugin workspace, ensure that the properties “children”, “create child” and “notify” in the .genmodel are set to true. (This may be because “Containment” isn’t set to true in the underlying .ecore model: See GMF Troubleshooting.)
DanglingHREFException
If when creating a new model, trying to add a child to a node, you get a DanglingHREFException, make sure that in the .ecore model, the particular EReference has the “containment” property set to true. (ref)
This has the effect of setting a reference from merely an association into an aggregation.
You can set this property in annotated Java by adding
@model containment="true"
(ref)
Top level node ‘Containment Feature’ must be available in the diagram ‘Domain Element’ or its super-class
I think this means that you are trying to make GMF create an editor for a model element that can’t actually be displayed in the current editor. e.g. You are trying to make a model, based in Map, which displays both Topic and TopicConcept, but you cannot currently create TopicConcept in the Map object. Or something… I haven’t quite worked this one out yet :)
The object ‘SomethingImpl’ (text: content) is not contained in a resource
This error occurs in the Eclipse workspace when you try to save a model which has an invalid structure – commonly when it refered to an old .ecore metamodel. The solution to this is to edit the model with a text editor and remove the invalid model elements.