org.eclipse.graphiti.ui.editor
Interface IDiagramContainerUI

All Superinterfaces:
IDiagramContainer, IDiagramEditor
All Known Implementing Classes:
DiagramComposite, DiagramEditor

public interface IDiagramContainerUI
extends IDiagramContainer

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
static String DIAGRAM_CONTEXT_ID
          The ID of the context as it is registered with the org.eclipse.ui.contexts extension point.
 
Method Summary
 void commandStackChanged(EventObject event)
          Notification that the command stack changed.
 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.
 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.
 GraphicalViewer getGraphicalViewer()
          Returns the GEF GraphicalViewer as it is needed in some Graphiti feature implementations.
 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 setEditDomain(DefaultEditDomain editDomain)
          Sets the GEF edit domain to the container.
 void setGraphicalViewer(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
 

Field Detail

DIAGRAM_CONTEXT_ID

static final 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

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(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

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()

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.

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

ActionRegistry getActionRegistry()
Returns the GEF action registry for the container.

Returns:
The ActionRegistry

getSelectionActions

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(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(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


Copyright (c) SAP AG 2005, 2012.