SUMMARY
Summary ................................................................................................................................... 3
Introduction .............................................................................................................................. 4
Part 1: Creation of a RCP plug-in ............................................................................................. 5
Part 2: Creation of the model .................................................................................................. 12
Part 3: First interaction with the graph .................................................................................... 24
Part 4: Undo/Redo ................................................................................................................... 30
Part 5: Zoom and keyboard shortcuts ...................................................................................... 36
Part 6: Outline ......................................................................................................................... 39
Part 7: Miniature view ............................................................................................................. 45
Part 8: Context menu ............................................................................................................... 47
Part 9: Creating a custom action ............................................................................................. 49
Wizard creation ................................................................................................................................. 49
Command creation ............................................................................................................................ 50
Action creation .................................................................................................................................. 51
EditPolicy creation ........................................................................................................................... 53
Associate the new EditPolicy with the EditParts .............................................................................. 53
Last, property activation to update views ......................................................................................... 54
Part 10: Property Sheet ............................................................................................................ 56
Adding the color of the services in the model ................................................................................... 56
Define a property source ................................................................................................................... 57
Integration of the property sheet ....................................................................................................... 61
Part 11: Adding new graphical elements ................................................................................ 63
Palette insertion ................................................................................................................................ 63
Adding a service ................................................................................................................................ 64
Adding an employee in a service ....................................................................................................... 69
Part 12 : Drag and drop ........................................................................................................... 72
Part 13 : Cut and paste ............................................................................................................ 74
Conclusion ............................................................................................................................... 82
References ............................................................................................................................... 82
Introduction
GEF (Graphical Editing Framework) is a Java technology, it is a part of the Eclipse
framework developed by IBM. It gives developers a full solution for graphical modeling of a
java object model, and it can be used in conjunction with other technologies such as EMF
(Eclipse Modeling Framework) or GMF (Graphical Modeling Framework), to be able to gain
abstraction levels in application development.
We created this tutorial because we encountered a lot of problems during the development of
a GEF application, and moreover, the main documentation we found about GEF on the
Internet and in books (like the IBM Redbook) was more about GEF theoretical concepts
rather than practical application about how to use GEF classes. That is the main motivation
we had in writing this tutorial, that means to be very pragmatic and useful for the
programmer, hopefully.
If you prefer a French version, you can access it at this address:
http://www.psykokwak.com/blog/index.php/tag/gef
You can download all source codes at the end of each french chapters on the website.