O'Reilly logo

The Eclipse Graphical Editing Framework (GEF) by Eric Clayberg, Jaime Wren, Dan Rubel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Commands and Tools

In the prior chapter, we constructed a GEF Editor and added the ability to select graphical elements in the editor. Now we explore adding commands to manipulate those selected elements, where each command encapsulates a single change to the model. EditParts use a collection of EditPolicy instances to specify what commands can be performed on which graphical elements. After a command is executed, it is placed on the command stack so that the user can choose to undo or redo the command at a later time.

13.1 Listening for Model Changes

We do not manipulate the graphical elements directly but rather modify the model and have the EditParts listen for model changes and update the graph accordingly. If a person is removed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required