org.eclipse.graphiti.ui.editor

## Interface IDiagramContainerUI

All Superinterfaces:
  IAdaptable, IDiagramContainer

All Known Implementing Classes:
  DiagramComposite, DiagramEditor

    public interface IDiagramContainerUI
    extends IDiagramContainer, IAdaptable

This is the main UI interface for the Graphiti diagram containers. It can be implemented by any class that would like to display a Graphiti diagram. A DiagramContainer takes in a `DiagramEditorInput` that points to the diagram to display. This input is not technically an IEditorInput, as diagrams may be displayed in non-editor parts. As a temporary workaround for Bugzilla 407510 a class implementing IDiagramContainerUI must additionally implement the methods 'public void configureGraphicalViewer()' and 'public void initializeGraphicalViewer()' that initialize the GEF editor used inside the container. This methods should have been added to the interface, but that was no longer possible because the bug was only detected in a late phase after API freeze. This will be fixed with the 0.11.0 version of Graphiti.

Since:
  0.10

### Field Summary

Fields
`static java.lang.String` `DIAGRAM_CONTEXT_ID` The ID of the context as it is registered with the org.eclipse.ui.contexts extension point.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `commandStackChanged(java.util.EventObject event)` Notification that the command stack changed.
`void` `configureGraphicalViewer()` Called to configure the `GraphicalViewer` of this container, before it receives its content.
`org.eclipse.gef.ui.actions.ActionRegistry` `getActionRegistry()` Returns the GEF action registry for the container.
`DiagramBehavior` `getDiagramBehavior()` Returns the `DiagramBehavior` instance associated with this container.
`IDiagramEditorInput` `getDiagramEditorInput()` Returns the `IDiagramEditorInput` instance used for this container.
`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.gef.GraphicalViewer` `getGraphicalViewer()` Returns the GEF `GraphicalViewer` as it is needed in some Graphiti feature implementations.
`java.util.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.
`IWorkbenchPartSite` `getSite()` Returns the `IWorkbenchPartSite` of the Eclipse `IWorkbenchPart` that displays this container.
`IWorkbenchPart` `getWorkbenchPart()` Returns the instance of the Eclipse `IWorkbenchPart` that displays this container.
`void` `hookGraphicalViewer()` Hooks the `GraphicalViewer` to be used inside the container.
`void` `initializeGraphicalViewer()` Called to initialize the `GraphicalViewer` of this container with its content.
`void` `setEditDomain(org.eclipse.gef.DefaultEditDomain editDomain)` Sets the GEF edit domain to the container.
`void` `setGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer)` Sets the `GraphicalViewer` to be used inside the container.

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

`close, doSave, getDiagramTypeProvider, getSelectedPictogramElements, getTitle, getTitleToolTip, isDirty, refreshTitle, refreshTitleToolTip, selectPictogramElements, setPictogramElementForSelection, setPictogramElementsForSelection, updateDirtyState`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Field Detail

#### DIAGRAM_CONTEXT_ID

    static final java.lang.String DIAGRAM_CONTEXT_ID

The ID of the context as it is registered with the org.eclipse.ui.contexts extension point.

Since:
  0.10
See Also:
  Constant Field Values

### Method Detail

#### getEditDomain

    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.

Returns:
  the `DefaultEditDomain` used in this editor
See Also:
  `GraphicalEditor.getEditDomain()`

#### setEditDomain

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

Sets the GEF edit domain to the container. Needed for initializing the container from the `DiagramBehavior` instance.

Parameters:
  `editDomain` - The `DefaultEditDomain` to set
See Also:
  `GraphicalEditor#setEditDomain()`

#### getGraphicalViewer

    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.

Returns:
  the `GraphicalViewer` used within this editor instance
See Also:
  `GraphicalEditor.getGraphicalViewer()`

#### configureGraphicalViewer

    void configureGraphicalViewer()

Called to configure the `GraphicalViewer` of this container, 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.

Since:
  0.12

#### initializeGraphicalViewer

    void initializeGraphicalViewer()

Called to initialize the `GraphicalViewer` of this container with its content. Here everything is done, which is dependent of the IConfigurationProviderInternal.

Since:
  0.12
See Also:
  `GraphicalEditorWithFlyoutPalette.initializeGraphicalViewer()`

#### getWorkbenchPart

    IWorkbenchPart getWorkbenchPart()

Returns the instance of the Eclipse `IWorkbenchPart` that displays this container. E.g. for an editor this will be the editor itself.

Returns:
  The `IWorkbenchPart` that is displaying the diagram.
Since:
  0.12

#### getSite

    IWorkbenchPartSite getSite()

Returns the `IWorkbenchPartSite` of the Eclipse `IWorkbenchPart` that displays this container. E.g. for an editor this will be the editor site.

Returns:
  The site for the `IWorkbenchPart` that is displaying the diagram.

#### getDiagramEditorInput

    IDiagramEditorInput getDiagramEditorInput()

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.

Returns:
  The input containing the URI for the diagram

#### getActionRegistry

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

Returns the GEF action registry for the container.

Returns:
  The `ActionRegistry`

#### getSelectionActions

    java.util.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.

Returns:
  A `List` containing the selection actions
See Also:
  `GraphicalEditor.getSelectionActions()`

#### commandStackChanged

    void commandStackChanged(java.util.EventObject event)

Notification that the command stack changed. This might e.g. trigger an update of the dirty state of the container.

Parameters:
  `event` - An event instance describing what happened
See Also:
  `GraphicalEditor.commandStackChanged(EventObject event)`

#### setGraphicalViewer

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

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.

Parameters:
  `viewer` - The viewer to use.
See Also:
  `GraphicalEditor.setGraphicalViewer(GraphicalViewer viewer)`

#### hookGraphicalViewer

    void hookGraphicalViewer()

Hooks the `GraphicalViewer` to be used inside the container.

Parameters:
  `viewer` - The viewer to use.
See Also:
  `GraphicalEditor#hookGraphicalViewer(GraphicalViewer viewer)`

#### getDiagramBehavior

    DiagramBehavior getDiagramBehavior()

Returns the `DiagramBehavior` instance associated with this container.

Specified by:
  `getDiagramBehavior` in interface `IDiagramContainer`
Returns:
  The associated `DiagramBehavior` instance