Part of (Creating a new GMF Editor)[Creating_a_new_GMF Editor.md] and GMF Diagram Partitioning. Also see GMF.

  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

If you end up with items in your generated tool palette that have no icons and cannot be dragged onto the canvas:

You’ve tried to add too many elements to the definition. For example, the diagram on the right was generated with the following code:

  • .gmfgraph:
    • Page: set as node
      • title: set as label
      • content: set as label
      • links: set as link **-- shouldn't be selected**
    • Link: set as node **-- should be a link**
      • link: set as link **-- shouldn't be selected**
  • .gmfgraph:
    • Page: set as node
      • links: set as link **-- shouldn't be selected**
    • Link: set as node **-- should be a link**
      • set as link **-- shouldn't be selected**

To edit the model after generating the application…

  • After changing the .ecore file
    • Right click .gmfmodel
    • Select "Reload..." and select your .ecore file
    • It should load the model again
    </li>

However, my version of GMF doesn’t properly reload changes, especially to attributes of the .ecore (for example, setting ‘Containment’ to true). The best solution in this case is to just delete the whole .genmodel and recreate it. Make sure you set the base package again!!!


Cannot place a new object onto the Canvas

This problem occurs when you try and place something on the canvas, which cannot be contained in it. For example, you’re trying to insert a HTML into a SPAN.

The solution is to open the .ecore model for the canvas element (e.g. Application), and set it’s ‘Containment’ property for the problematic reference to true, like so:

Make sure you then properly re-generate the .genmodel and re-generate the diagram code.


Error: Save could not be completed: The object [..] is not contained in a resource.

This error occurs when you try to save a model like so:

[code] [/code]

But items of ‘‘b’’ cannot be contained in ‘‘a’’. The solution to this is to set the ‘Containment’ property for ‘‘a**s ‘‘b’’ to true. You then have to recreate the .genmodel (follow instructions above) and go through the rest of the generation instructions.

Alternatively, if you have been changing the Ecore model around and are trying to open an old model file, it may be because GMF no longer knows what to do with the old elements - it doesn’t want to delete them, but it can’t place them anywhere else, so it crashes out. You might have to edit your model manually.