Package org.eclipse.graphiti.ui.editor
Interface IDiagramContainerUI
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
,IDiagramContainer
- All Known Implementing Classes:
DiagramComposite
,DiagramEditor
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
Modifier and TypeFieldDescriptionstatic final String
The ID of the context as it is registered with the org.eclipse.ui.contexts extension point. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commandStackChanged
(EventObject event) Notification that the command stack changed.void
Called to configure theGraphicalViewer
of this container, before it receives its content.org.eclipse.gef.ui.actions.ActionRegistry
Returns the GEF action registry for the container.Returns theDiagramBehavior
instance associated with this container.Returns theIDiagramEditorInput
instance used for this container.org.eclipse.gef.DefaultEditDomain
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
Returns the GEFGraphicalViewer
as it is needed in some Graphiti feature implementations.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.org.eclipse.ui.IWorkbenchPartSite
getSite()
Returns theIWorkbenchPartSite
of the EclipseIWorkbenchPart
that displays this container.org.eclipse.ui.IWorkbenchPart
Returns the instance of the EclipseIWorkbenchPart
that displays this container.void
Hooks theGraphicalViewer
to be used inside the container.void
Called to initialize theGraphicalViewer
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 theGraphicalViewer
to be used inside the container.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.graphiti.platform.IDiagramContainer
close, doSave, getDiagramTypeProvider, getSelectedPictogramElements, getTitle, getTitleToolTip, isDirty, refreshTitle, refreshTitleToolTip, selectPictogramElements, setPictogramElementForSelection, setPictogramElementsForSelection, updateDirtyState
-
Field Details
-
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:
-
-
Method Details
-
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 theDiagramBehavior
instance.- Parameters:
editDomain
- TheDefaultEditDomain
to set- See Also:
-
GraphicalEditor#setEditDomain()
-
getGraphicalViewer
org.eclipse.gef.GraphicalViewer getGraphicalViewer()Returns the GEFGraphicalViewer
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 theGraphicalViewer
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 theGraphicalViewer
of this container with its content. Here everything is done, which is dependent of the IConfigurationProviderInternal.- Since:
- 0.12
- See Also:
-
GraphicalEditorWithFlyoutPalette.initializeGraphicalViewer()
-
getWorkbenchPart
org.eclipse.ui.IWorkbenchPart getWorkbenchPart()Returns the instance of the EclipseIWorkbenchPart
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
org.eclipse.ui.IWorkbenchPartSite getSite()Returns theIWorkbenchPartSite
of the EclipseIWorkbenchPart
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 theIDiagramEditorInput
instance used for this container. Basically it is used as an EclipseIEditorInput
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
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
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 theGraphicalViewer
to be used inside the container. The viewer is created by theDiagramBehavior
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 theGraphicalViewer
to be used inside the container.- Parameters:
viewer
- The viewer to use.- See Also:
-
GraphicalEditor#hookGraphicalViewer(GraphicalViewer viewer)
-
getDiagramBehavior
DiagramBehavior getDiagramBehavior()Returns theDiagramBehavior
instance associated with this container.- Specified by:
getDiagramBehavior
in interfaceIDiagramContainer
- Returns:
- The associated
DiagramBehavior
instance
-