org.eclipse.graphiti.ui.editor

## Class DiagramEditor

- java.lang.Object
- - org.eclipse.core.commands.common.EventManager
  - - org.eclipse.ui.part.WorkbenchPart
    - - org.eclipse.ui.part.EditorPart
      - - org.eclipse.gef.ui.parts.GraphicalEditor
        - - org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
          - - org.eclipse.graphiti.ui.editor.DiagramEditor

All Implemented Interfaces:
  EventListener, IAdaptable, IExecutableExtension, org.eclipse.emf.edit.domain.IEditingDomainProvider, org.eclipse.gef.commands.CommandStackListener, IDiagramContainer, IDiagramContainerUI, IEditorPart, ISaveablePart, ISelectionListener, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation, ITabbedPropertySheetPageContributor

    public class DiagramEditor
    extends org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
    implements IDiagramContainerUI, ITabbedPropertySheetPageContributor, org.eclipse.emf.edit.domain.IEditingDomainProvider

This is the main class for the Graphiti diagram editor. It represents the editor to Eclipse and therefore implements `IEditorPart`. The implementation is based upon a GEF editor implementation ( `GraphicalEditorWithFlyoutPalette`) and enhances it with Graphiti-specific stuff.
This editor is registered as an Eclipse editor using the extension point org.eclipse.ui.editors. Therefore the Eclipse standard methods can be used to open a new diagram editor. The associated `IEditorInput` object is a subclass of `DiagramEditorInput`, but using another type of input is also ok as long as it can be adapted to an IFile that can be reolved within the workspace of is a `URIEditorInput`. These types of input objects will be converted to a corresponding `DiagramEditorInput` when the editor is initialized (see `init(IEditorSite, IEditorInput)`).
Any clients extending this class should also contribute their editor to the Eclipse editor extension point to gain full advantage of the Eclipse editor integration of Graphiti.
There are a lot of aspects this class needs to deal with; the larger aspects are separated into other classes which share the lifecycle with the `DiagramEditor` instance. This means they are instantiated when a new diagram editor is created and exist until the editor is closed again. There are default implementations for all of these aspects, see the Default*Behavior classes in this package. The following aspects are separated:

- Markers: Handles everything about markers in the editor. See `DefaultMarkerBehavior` for the default implementation. Override `#createMarkerBehavior()` to change the default behavior.
- Palette: Handles everything about the palette in the editor. See `DefaultPaletteBehavior` for the default implementation. Override `#createPaletteBehaviour()` to change the default behavior.
- Persistence: Handles everything about loading, saving and the dirty state in the editor. See `DefaultPersistencyBehavior` for the default implementation. Override `#createPersistencyBehavior()` to change the default behavior.
- Refreshing: Handles everything about refreshing the editor (refreshing means that the editor shows what's defined in the pictogram model). See `DefaultRefreshBehavior` for the default implementation. Override `#createRefreshBehavior()` to change the default behavior.
- Update: Handles everything about updating the editor (updating means that the pictogram model is updated to reflect any changes done to the domain model - your business objects - or to the way objects shall be visualized). See `DefaultMarkerBehavior` for the default implementation. Override `#createMarkerBehavior()` to change the default behavior.

All the other aspects are dealt with directly within this class. One of the larger aspects implemented here is selection handling, which would have been awkward if separated out.

Since:
  0.10

### Field Summary

Fields
`static String` `DIAGRAM_EDITOR_ID` The ID of the `DiagramEditor` as it is registered with the org.eclipse.ui.editors extension point.

### Fields inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI

`DIAGRAM_CONTEXT_ID`

### Fields inherited from interface org.eclipse.ui.IEditorPart

`PROP_DIRTY, PROP_INPUT`

### Fields inherited from interface org.eclipse.ui.IWorkbenchPart

`PROP_TITLE`

### Constructor Summary

Constructors
Constructor and Description
`DiagramEditor()` Creates a new diagram editor and cares about the creation of the different behavior extensions by delegating to the various create*Behavior() methods.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Notify the container that it should shut down or clear it's state.
`void` `commandStackChanged(EventObject event)` Notification that the command stack changed.
`void` `configureGraphicalViewer()` Called to configure the editor, before it receives its content.
`void` `createPartControl(Composite parent)` Creates the UI of the editor by delegating to the `super.createPartControl` method.
`void` `dispose()` Disposes this `DiagramEditor` instance and frees all used resources and clears all references.
`void` `doSave(IProgressMonitor monitor)` Called to perform the saving of the editor.
`org.eclipse.gef.ui.actions.ActionRegistry` `getActionRegistry()` Returns the GEF action registry for the container.
`Object` `getAdapter(Class type)` Implements the Eclipse `IAdaptable` interface.
`String` `getContributorId()` Returns the ID for contributions in the tabbed property sheets by delegating to the method `IToolBehaviorProvider.getContributorId()` .
`DiagramBehavior` `getDiagramBehavior()` Returns the associated `DiagramSupport` instance to this editor.
`IDiagramEditorInput` `getDiagramEditorInput()` Returns the `IDiagramEditorInput` instance used for this container.
`IDiagramTypeProvider` `getDiagramTypeProvider()` Returns the `IDiagramTypeProvider` instance associated with this `DiagramEditor`.
`org.eclipse.gef.DefaultEditDomain` `getEditDomain()` Returns the GEF edit domain as needed for some of the feature functionality in Graphiti; simply a public rewrite of the GEF editor super method.
`org.eclipse.emf.transaction.TransactionalEditingDomain` `getEditingDomain()` Returns the EMF `TransactionalEditingDomain` used within this editor by delegating to the update behavior extension, by default `DefaultUpdateBehavior.getEditingDomain()`.
`org.eclipse.gef.GraphicalViewer` `getGraphicalViewer()` Returns the GEF `GraphicalViewer` as it is needed in some Graphiti feature implementations.
`PictogramElement[]` `getSelectedPictogramElements()` Returns the `PictogramElement`s that are currently selected in the diagram editor.
`List` `getSelectionActions()` Returns the actions used for selection of the parent GEF editor, for an editor based upon the GEF editor this simply returns the standard GEF selection actions by delegating to the super editor class.
`String` `getTitleToolTip()` Returns the tooltip that shall be displayed when hovering over the editor title tab.
`IWorkbenchPart` `getWorkbenchPart()` Returns the `IWorkbenchPart` for this container.
`void` `hookGraphicalViewer()` Hooks the `GraphicalViewer` to be used inside the container.
`void` `init(IEditorSite site, IEditorInput input)` Does the initialization of the editor.
`void` `initializeGraphicalViewer()` Called to initialize the editor with its content.
`boolean` `isDirty()` Returns if the editor is currently dirty and needs to be saved or not.
`void` `refreshTitle()` Refreshes the editor title to show the name of the diagram
`void` `refreshTitleToolTip()` Refreshes the tooltip displayed for the editor title tab according to what is returned in `getTitleToolTip()`.
`void` `selectionChanged(IWorkbenchPart part, ISelection selection)` Handles a selection changed event that is triggered by any selection source, e.g.
`void` `selectPictogramElements(PictogramElement[] pictogramElements)` Selects the given `PictogramElement`s in the diagram.
`void` `setEditDomain(org.eclipse.gef.DefaultEditDomain editDomain)` Sets the GEF edit domain to the container.
`void` `setFocus()` Sets the focus by delegating to the super class implementation in the GEF editor and additionally triggers a update of the diagram by delegating to `DefaultUpdateBehavior.handleActivate()`.
`void` `setGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer)` Sets the `GraphicalViewer` to be used inside the container.
`void` `setPictogramElementForSelection(PictogramElement pictogramElement)` Sets one `PictogramElement` for later selection.
`void` `setPictogramElementsForSelection(PictogramElement[] pictogramElements)` Sets `PictogramElement`s for later selection.
`void` `updateDirtyState()` Updates the UI to correctly reflect the dirty state of the editor.

### Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor

`doSaveAs, isSaveAsAllowed`

### Methods inherited from class org.eclipse.ui.part.EditorPart

`getEditorInput, getEditorSite, isSaveOnCloseNeeded, setInitializationData`

### Methods inherited from class org.eclipse.ui.part.WorkbenchPart

`addPartPropertyListener, addPropertyListener, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI

`getSite`

### Methods inherited from interface org.eclipse.graphiti.platform.IDiagramContainer

`getTitle`

### Methods inherited from interface org.eclipse.ui.IWorkbenchPart

`addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener`

### Field Detail

#### DIAGRAM_EDITOR_ID

    public static final String DIAGRAM_EDITOR_ID

The ID of the `DiagramEditor` as it is registered with the org.eclipse.ui.editors extension point.

See Also:
  Constant Field Values

### Constructor Detail

#### DiagramEditor

    public DiagramEditor()

Creates a new diagram editor and cares about the creation of the different behavior extensions by delegating to the various create*Behavior() methods.

### Method Detail

#### getDiagramBehavior

    public DiagramBehavior getDiagramBehavior()

Returns the associated `DiagramSupport` instance to this editor.

Specified by:
  `getDiagramBehavior` in interface `IDiagramContainer`
Specified by:
  `getDiagramBehavior` in interface `IDiagramContainerUI`
Returns:
  The associated `DiagramSupport` instance
Since:
  0.10

#### init

    public void init(IEditorSite site,
                     IEditorInput input)
              throws PartInitException

Does the initialization of the editor. The default implementation cares about:

1. converting the passed `IEditorInput` to a `DiagramEditorInput`. In case this fails, a `PartInitException` is thrown.
2. creating the editing domain by delegating to the update behavior extension, see `DefaultUpdateBehavior.createEditingDomain(IDiagramEditorInput)` for details
3. initializing the underlying GEF editor by delegating to super
4. initializing the update behavior extension (the order is important here as this must happen after initializing the GEF editor!)
5. triggering the migration of diagram data if necessary

Any clients overriding this method have to make sure that they they always call `super.init(site, input)`.

Specified by:
  `init` in interface `IEditorPart`
Overrides:
  `init` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Parameters:
  `site` - the Eclipse `IEditorSite` that will host this editor
  `input` - the editor input that shall be used. Note that this method will exchange the input instance in case it is no `DiagramEditorInput`.
Throws:
  `PartInitException`
See Also:
  `IEditorPart.init(IEditorSite, IEditorInput)`

#### createPartControl

    public void createPartControl(Composite parent)

Creates the UI of the editor by delegating to the `super.createPartControl` method. The default implementation here also registers the command stack listener to correctly reflect the dirty state of the editor.

Specified by:
  `createPartControl` in interface `IWorkbenchPart`
Overrides:
  `createPartControl` in class `org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette`

#### initializeGraphicalViewer

    public void initializeGraphicalViewer()

Called to initialize the editor with its content. Here everything is done, which is dependent of the IConfigurationProviderInternal.

Specified by:
  `initializeGraphicalViewer` in interface `IDiagramContainerUI`
Overrides:
  `initializeGraphicalViewer` in class `org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette`
Since:
  0.10
See Also:
  `GraphicalEditorWithFlyoutPalette.initializeGraphicalViewer()`

#### configureGraphicalViewer

    public void configureGraphicalViewer()

Called to configure the editor, before it receives its content. The default-implementation is for example doing the following: configure the ZoomManager, registering Actions... Here everything is done, which is independent of the IConfigurationProviderInternal.

Specified by:
  `configureGraphicalViewer` in interface `IDiagramContainerUI`
Overrides:
  `configureGraphicalViewer` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Since:
  0.12
See Also:
  `GraphicalEditor.configureGraphicalViewer()`

#### updateDirtyState

    public void updateDirtyState()

Updates the UI to correctly reflect the dirty state of the editor. The default implementation does this by firing a `IEditorPart.PROP_DIRTY` property change.

Specified by:
  `updateDirtyState` in interface `IDiagramContainer`
Since:
  0.9

#### doSave

    public void doSave(IProgressMonitor monitor)

Called to perform the saving of the editor. The default implementation delegates via `DiagramSupport` to `DefaultPersistencyBehavior.saveDiagram(IProgressMonitor)`.

Specified by:
  `doSave` in interface `IDiagramContainer`
Specified by:
  `doSave` in interface `ISaveablePart`
Specified by:
  `doSave` in class `EditorPart`
Parameters:
  `monitor` - the Eclipse progress monitor to report progress with.

#### isDirty

    public boolean isDirty()

Returns if the editor is currently dirty and needs to be saved or not. The default implementation delegates to `DiagramSupport#isDirty()`.

Specified by:
  `isDirty` in interface `IDiagramContainer`
Specified by:
  `isDirty` in interface `ISaveablePart`
Overrides:
  `isDirty` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Returns:
  `true` in case the editor is dirty, `false` otherwise.

#### refreshTitle

    public void refreshTitle()

Refreshes the editor title to show the name of the diagram

Specified by:
  `refreshTitle` in interface `IDiagramContainer`
Since:
  0.9

#### refreshTitleToolTip

    public void refreshTitleToolTip()

Refreshes the tooltip displayed for the editor title tab according to what is returned in `getTitleToolTip()`.

Specified by:
  `refreshTitleToolTip` in interface `IDiagramContainer`
Since:
  0.9

#### getAdapter

    public Object getAdapter(Class type)

Implements the Eclipse `IAdaptable` interface. This implementation first delegates to the `IToolBehaviorProvider.getAdapter(Class)` method and checks if something is returned. In case the return value is `null` it returns adapters for ZoomManager, IPropertySheetPage, Diagram, KeyHandler, SelectionSynchronizer and IContextButtonManager. It also delegates to the super implementation in `GraphicalEditorWithFlyoutPalette.getAdapter(Class)`.

Specified by:
  `getAdapter` in interface `IAdaptable`
Overrides:
  `getAdapter` in class `org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette`
Parameters:
  `type` - the type to which shall be adapted
Returns:
  the adapter instance

#### dispose

    public void dispose()

Disposes this `DiagramEditor` instance and frees all used resources and clears all references. Also delegates to all the behavior extensions to also free their resources (e.g. and most important is the `TransactionalEditingDomain` held by the `DefaultPersistencyBehavior`. Always delegate to `super.dispose()` in case you override this method!

Specified by:
  `dispose` in interface `IWorkbenchPart`
Overrides:
  `dispose` in class `org.eclipse.gef.ui.parts.GraphicalEditor`

#### setFocus

    public void setFocus()

Sets the focus by delegating to the super class implementation in the GEF editor and additionally triggers a update of the diagram by delegating to `DefaultUpdateBehavior.handleActivate()`.

Specified by:
  `setFocus` in interface `IWorkbenchPart`
Overrides:
  `setFocus` in class `org.eclipse.gef.ui.parts.GraphicalEditor`

#### getSelectedPictogramElements

    public PictogramElement[] getSelectedPictogramElements()

Returns the `PictogramElement`s that are currently selected in the diagram editor.

Specified by:
  `getSelectedPictogramElements` in interface `IDiagramContainer`
Returns:
  an array of `PictogramElement`s.
Since:
  0.9

#### selectionChanged

    public void selectionChanged(IWorkbenchPart part,
                                 ISelection selection)

Handles a selection changed event that is triggered by any selection source, e.g. a browser with "Link to Editor" enabled.
Checks if the currently active editor is a `MultiPageEditorPart` with an opened diagram editor inside, tries to find any `PictogramElement` for the objects in the selection and selects them in the diagram.
Note that in case of the `CommonNavigator` as event source, its editor linking mechanism must be enabled.

Specified by:
  `selectionChanged` in interface `ISelectionListener`
Overrides:
  `selectionChanged` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Parameters:
  `part` - the source `IWorkbenchPart` that triggered the event
  `selection` - the new selection (mostly a `IStructuredSelection` instance.
Since:
  0.9

#### selectPictogramElements

    public void selectPictogramElements(PictogramElement[] pictogramElements)

Selects the given `PictogramElement`s in the diagram.

Specified by:
  `selectPictogramElements` in interface `IDiagramContainer`
Parameters:
  `pictogramElements` - an array of `PictogramElement`s to select.
Since:
  0.9

#### setPictogramElementForSelection

    public void setPictogramElementForSelection(PictogramElement pictogramElement)

Sets one `PictogramElement` for later selection.

The methods `#getPictogramElementsForSelection()`, `setPictogramElementForSelection(PictogramElement)`, `setPictogramElementsForSelection(PictogramElement[])` and `DiagramSupport#selectBufferedPictogramElements()` offer the possibility to use a deferred selection mechanism: via the setters, `PictogramElement`s can be stored for a selection operation that is triggered lateron during a general refresh via the method `DiagramSupport#selectBufferedPictogramElements()`. This mechanism is used e.g. in the Graphiti framework in direct editing to restore the previous selection, but can also be used by clients.

Specified by:
  `setPictogramElementForSelection` in interface `IDiagramContainer`
Parameters:
  `pictogramElement` - the `PictogramElement` that shall be stored for later selection
Since:
  0.9

#### setPictogramElementsForSelection

    public void setPictogramElementsForSelection(PictogramElement[] pictogramElements)

Sets `PictogramElement`s for later selection.

The methods `#getPictogramElementsForSelection()`, `setPictogramElementForSelection(PictogramElement)`, `setPictogramElementsForSelection(PictogramElement[])` and `DiagramSupport#selectBufferedPictogramElements()` offer the possibility to use a deferred selection mechanism: via the setters, `PictogramElement`s can be stored for a selection operation that is triggered lateron during a general refresh via the method `DiagramSupport#selectBufferedPictogramElements()`. This mechanism is used e.g. in the Graphiti framework in direct editing to restore the previous selection, but can also be used by clients.

Specified by:
  `setPictogramElementsForSelection` in interface `IDiagramContainer`
Parameters:
  `pictogramElements` - the `PictogramElement`s that shall be stored for later selection
Since:
  0.9

#### getContributorId

    public String getContributorId()

Returns the ID for contributions in the tabbed property sheets by delegating to the method `IToolBehaviorProvider.getContributorId()` .

Specified by:
  `getContributorId` in interface `ITabbedPropertySheetPageContributor`
Returns:
  the contributor id as a `String`
Since:
  0.9

#### getDiagramTypeProvider

    public IDiagramTypeProvider getDiagramTypeProvider()

Returns the `IDiagramTypeProvider` instance associated with this `DiagramEditor`. There is always a 1:1 relation between the editor and the provider.

Note that this is a pure delegation method. Overrides should happen in `DiagramBehavior`.

Specified by:
  `getDiagramTypeProvider` in interface `IDiagramContainer`
Returns:
  the associated `IDiagramTypeProvider` instance.
Since:
  0.9

#### getEditDomain

    public org.eclipse.gef.DefaultEditDomain getEditDomain()

Returns the GEF edit domain as needed for some of the feature functionality in Graphiti; simply a public rewrite of the GEF editor super method.

Specified by:
  `getEditDomain` in interface `IDiagramContainerUI`
Overrides:
  `getEditDomain` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Returns:
  the `DefaultEditDomain` used in this editor
Since:
  0.9
See Also:
  `GraphicalEditor.getEditDomain()`

#### getGraphicalViewer

    public org.eclipse.gef.GraphicalViewer getGraphicalViewer()

Returns the GEF `GraphicalViewer` as it is needed in some Graphiti feature implementations. This is simply a public rewrite of the according super method.

Specified by:
  `getGraphicalViewer` in interface `IDiagramContainerUI`
Overrides:
  `getGraphicalViewer` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Returns:
  the `GraphicalViewer` used within this editor instance
See Also:
  `GraphicalEditor.getGraphicalViewer()`

#### getTitleToolTip

    public String getTitleToolTip()

Returns the tooltip that shall be displayed when hovering over the editor title tab.

Specified by:
  `getTitleToolTip` in interface `IDiagramContainer`
Specified by:
  `getTitleToolTip` in interface `IWorkbenchPart`
Overrides:
  `getTitleToolTip` in class `EditorPart`
Returns:
  the tooltip as a `String`

#### getEditingDomain

    public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()

Returns the EMF `TransactionalEditingDomain` used within this editor by delegating to the update behavior extension, by default `DefaultUpdateBehavior.getEditingDomain()`.

Specified by:
  `getEditingDomain` in interface `org.eclipse.emf.edit.domain.IEditingDomainProvider`
Returns:
  the `TransactionalEditingDomain` instance used in the editor
Since:
  0.9

#### getDiagramEditorInput

    public IDiagramEditorInput getDiagramEditorInput()

Description copied from interface: `IDiagramContainerUI`
Returns the `IDiagramEditorInput` instance used for this container. Basically it is used as an Eclipse `IEditorInput` object only in case the container is an editor; for other types of containers the input is simply used as a holder for a URI pointing to a diagram.

Specified by:
  `getDiagramEditorInput` in interface `IDiagramContainerUI`
Returns:
  The input containing the URI for the diagram
Since:
  0.10

#### getWorkbenchPart

    public IWorkbenchPart getWorkbenchPart()

Returns the `IWorkbenchPart` for this container. Since this editor itself is already a part the default implementation simply returns this.

Specified by:
  `getWorkbenchPart` in interface `IDiagramContainerUI`
Returns:
  This part
Since:
  0.10

#### close

    public void close()

Description copied from interface: `IDiagramContainer`
Notify the container that it should shut down or clear it's state.

Specified by:
  `close` in interface `IDiagramContainer`
Since:
  0.10

#### setEditDomain

    public void setEditDomain(org.eclipse.gef.DefaultEditDomain editDomain)

Description copied from interface: `IDiagramContainerUI`
Sets the GEF edit domain to the container. Needed for initializing the container from the `DiagramBehavior` instance.

Specified by:
  `setEditDomain` in interface `IDiagramContainerUI`
Overrides:
  `setEditDomain` in class `org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette`
Parameters:
  `editDomain` - The `DefaultEditDomain` to set
Since:
  0.10
See Also:
  `GraphicalEditor#setEditDomain()`

#### getActionRegistry

    public org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()

Description copied from interface: `IDiagramContainerUI`
Returns the GEF action registry for the container.

Specified by:
  `getActionRegistry` in interface `IDiagramContainerUI`
Overrides:
  `getActionRegistry` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Returns:
  The `ActionRegistry`

#### getSelectionActions

    public List getSelectionActions()

Description copied from interface: `IDiagramContainerUI`
Returns the actions used for selection of the parent GEF editor, for an editor based upon the GEF editor this simply returns the standard GEF selection actions by delegating to the super editor class.

Specified by:
  `getSelectionActions` in interface `IDiagramContainerUI`
Overrides:
  `getSelectionActions` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Returns:
  A `List` containing the selection actions
See Also:
  `GraphicalEditor.getSelectionActions()`

#### commandStackChanged

    public void commandStackChanged(EventObject event)

Description copied from interface: `IDiagramContainerUI`
Notification that the command stack changed. This might e.g. trigger an update of the dirty state of the container.

Specified by:
  `commandStackChanged` in interface `org.eclipse.gef.commands.CommandStackListener`
Specified by:
  `commandStackChanged` in interface `IDiagramContainerUI`
Overrides:
  `commandStackChanged` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Parameters:
  `event` - An event instance describing what happened
See Also:
  `GraphicalEditor.commandStackChanged(EventObject event)`

#### setGraphicalViewer

    public void setGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer)

Description copied from interface: `IDiagramContainerUI`
Sets the `GraphicalViewer` to be used inside the container. The viewer is created by the `DiagramBehavior` instance and needs to be set in the GEF container.

Specified by:
  `setGraphicalViewer` in interface `IDiagramContainerUI`
Overrides:
  `setGraphicalViewer` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
Parameters:
  `viewer` - The viewer to use.
See Also:
  `GraphicalEditor.setGraphicalViewer(GraphicalViewer viewer)`

#### hookGraphicalViewer

    public void hookGraphicalViewer()

Description copied from interface: `IDiagramContainerUI`
Hooks the `GraphicalViewer` to be used inside the container.

Specified by:
  `hookGraphicalViewer` in interface `IDiagramContainerUI`
Overrides:
  `hookGraphicalViewer` in class `org.eclipse.gef.ui.parts.GraphicalEditor`
See Also:
  `GraphicalEditor#hookGraphicalViewer(GraphicalViewer viewer)`