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:

  1. The cheat sheet in Eclipse itself: Help > Cheat Sheets
  2. http://wiki.eclipse.org/index.php/GMF_Tutorial – the basics
  3. http://wiki.eclipse.org/GMF_Documentation – especially the rest of the tutorial parts
  4. 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:

  1. Creating a new GMF Editor
  2. GMF Diagram Partitioning
  3. GMF Drag Drop (Shortcuts)
  4. GMF Static Labels
  5. Enabling Dynamic Templates in GMF
  6. Migrating Dynamic Templates to GMF 2.2
  7. Having Multiple Containments of the Same Domain Element in GMF
  8. GMF Code Samples (lots in here)
  9. GMF Refactoring
  10. Using EOpposite in GMF
  11. Ecore
  12. GMFGraph
  13. Using Platform Resources as EReferences in GMF
  14. GMF Custom Figures

Troubleshooting:

  1. GMF Troubleshooting
  2. GMF Troubleshooting 2
  3. GMF Troubleshooting 3
  4. GMF Troubleshooting 4
  5. GMF Troubleshooting 5
  6. GMF Troubleshooting 6
  7. GMF Troubleshooting 7
  8. GMF Troubleshooting 8
  9. GMF Troubleshooting 9
  10. GMF Troubleshooting 10

Advanced tutorials:

  1. How to have both a visual outline view and a tree outline view simultaneously
  2. How to have icons in the outline view
  3. Hiding unnecessary properties
  4. Different EMF model versions in GMF editors
  5. EMF model documentation: using <!– begin-model-doc –>
  6. Representing a node with a JPEG image
  7. Loading .ecore Resources through Browse Registered Packages

Advanced references:

  1. Eclipse Development with GEF and EMF (256 page PDF)
  2. 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.

Some random helpful images