Package org.eclipse.graphiti.ui.editor
Interface IDiagramContainerUI
-
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable,IDiagramContainer
- All Known Implementing Classes:
DiagramComposite,DiagramEditor
public interface IDiagramContainerUI extends IDiagramContainer, org.eclipse.core.runtime.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 aDiagramEditorInputthat 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 Modifier and Type Field Description static java.lang.StringDIAGRAM_CONTEXT_IDThe ID of the context as it is registered with the org.eclipse.ui.contexts extension point.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommandStackChanged(java.util.EventObject event)Notification that the command stack changed.voidconfigureGraphicalViewer()Called to configure theGraphicalViewerof this container, before it receives its content.org.eclipse.gef.ui.actions.ActionRegistrygetActionRegistry()Returns the GEF action registry for the container.DiagramBehaviorgetDiagramBehavior()Returns theDiagramBehaviorinstance associated with this container.IDiagramEditorInputgetDiagramEditorInput()Returns theIDiagramEditorInputinstance used for this container.org.eclipse.gef.DefaultEditDomaingetEditDomain()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.GraphicalViewergetGraphicalViewer()Returns the GEFGraphicalVieweras it is needed in some Graphiti feature implementations.java.util.ListgetSelectionActions()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.IWorkbenchPartSitegetSite()Returns theIWorkbenchPartSiteof the EclipseIWorkbenchPartthat displays this container.org.eclipse.ui.IWorkbenchPartgetWorkbenchPart()Returns the instance of the EclipseIWorkbenchPartthat displays this container.voidhookGraphicalViewer()Hooks theGraphicalViewerto be used inside the container.voidinitializeGraphicalViewer()Called to initialize theGraphicalViewerof this container with its content.voidsetEditDomain(org.eclipse.gef.DefaultEditDomain editDomain)Sets the GEF edit domain to the container.voidsetGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer)Sets theGraphicalViewerto 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 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
DefaultEditDomainused 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 theDiagramBehaviorinstance.- Parameters:
editDomain- TheDefaultEditDomainto set- See Also:
GraphicalEditor#setEditDomain()
-
getGraphicalViewer
org.eclipse.gef.GraphicalViewer getGraphicalViewer()
Returns the GEFGraphicalVieweras it is needed in some Graphiti feature implementations. This is simply a public rewrite of the according super method.- Returns:
- the
GraphicalViewerused within this editor instance - See Also:
GraphicalEditor.getGraphicalViewer()
-
configureGraphicalViewer
void configureGraphicalViewer()
Called to configure theGraphicalViewerof 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 theGraphicalViewerof 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 EclipseIWorkbenchPartthat displays this container. E.g. for an editor this will be the editor itself.- Returns:
- The
IWorkbenchPartthat is displaying the diagram. - Since:
- 0.12
-
getSite
org.eclipse.ui.IWorkbenchPartSite getSite()
Returns theIWorkbenchPartSiteof the EclipseIWorkbenchPartthat displays this container. E.g. for an editor this will be the editor site.- Returns:
- The site for the
IWorkbenchPartthat is displaying the diagram.
-
getDiagramEditorInput
IDiagramEditorInput getDiagramEditorInput()
Returns theIDiagramEditorInputinstance used for this container. Basically it is used as an EclipseIEditorInputobject 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
Listcontaining 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 theGraphicalViewerto be used inside the container. The viewer is created by theDiagramBehaviorinstance 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 theGraphicalViewerto be used inside the container.- Parameters:
viewer- The viewer to use.- See Also:
GraphicalEditor#hookGraphicalViewer(GraphicalViewer viewer)
-
getDiagramBehavior
DiagramBehavior getDiagramBehavior()
Returns theDiagramBehaviorinstance associated with this container.- Specified by:
getDiagramBehaviorin interfaceIDiagramContainer- Returns:
- The associated
DiagramBehaviorinstance
-
-