Class DiagramEditor
- All Implemented Interfaces:
EventListener,org.eclipse.core.runtime.IAdaptable,org.eclipse.core.runtime.IExecutableExtension,org.eclipse.emf.edit.domain.IEditingDomainProvider,org.eclipse.gef.commands.CommandStackEventListener,org.eclipse.gef.commands.CommandStackListener,IDiagramContainer,IDiagramContainerUI,org.eclipse.ui.IEditorPart,org.eclipse.ui.ISaveablePart,org.eclipse.ui.ISelectionListener,org.eclipse.ui.IWorkbenchPart,org.eclipse.ui.IWorkbenchPart2,org.eclipse.ui.IWorkbenchPart3,org.eclipse.ui.part.IWorkbenchPartOrientation,org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor
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
DefaultMarkerBehaviorfor the default implementation. Override#createMarkerBehavior()to change the default behavior. - Palette: Handles everything about the palette in the editor. See
DefaultPaletteBehaviorfor the default implementation. Override#createPaletteBehaviour()to change the default behavior. - Persistence: Handles everything about loading, saving and the dirty state
in the editor. See
DefaultPersistencyBehaviorfor 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
DefaultRefreshBehaviorfor 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
DefaultMarkerBehaviorfor the default implementation. Override#createMarkerBehavior()to change the default behavior.
- Since:
- 0.10
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette.CustomPalettePage -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe ID of theDiagramEditoras it is registered with the org.eclipse.ui.editors extension point.Fields inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI
DIAGRAM_CONTEXT_IDFields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new diagram editor and cares about the creation of the different behavior extensions by delegating to the various create*Behavior() methods. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Notify the container that it should shut down or clear it's state.voidcommandStackChanged(EventObject event) Notification that the command stack changed.voidCalled to configure the editor, before it receives its content.protected DiagramEditorInputconvertToDiagramEditorInput(org.eclipse.ui.IEditorInput input) Is called by theinit(IEditorSite, IEditorInput)method in case theIEditorInputinstance passed is noDiagramEditorInput.protected DiagramBehaviorCreates the behavior object that cares about the common (behavioral) coding shared between editors, views and other composites.protected voidcreateGraphicalViewer(org.eclipse.swt.widgets.Composite parent) Creates the GraphicalViewer on the specifiedCompositeand initializes it.protected final org.eclipse.gef.ui.palette.PaletteViewerProviderDelegates to the method (or the method in a subclass of)#createPaletteViewerProvider()to create thePaletteViewerProviderused inside the GEF editor.voidcreatePartControl(org.eclipse.swt.widgets.Composite parent) Creates the UI of the editor by delegating to thesuper.createPartControlmethod.voiddispose()Disposes thisDiagramEditorinstance and frees all used resources and clears all references.voiddoSave(org.eclipse.core.runtime.IProgressMonitor monitor) Called to perform the saving of the editor.org.eclipse.gef.ui.actions.ActionRegistryReturns the GEF action registry for the container.getAdapter(Class type) Implements the EclipseIAdaptableinterface.Returns the ID for contributions in the tabbed property sheets by delegating to the methodIToolBehaviorProvider.getContributorId().Returns the associatedDiagramSupportinstance to this editor.Returns theIDiagramEditorInputinstance used for this container.Returns theIDiagramTypeProviderinstance associated with thisDiagramEditor.org.eclipse.gef.DefaultEditDomainReturns 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.TransactionalEditingDomainReturns the EMFTransactionalEditingDomainused within this editor by delegating to the update behavior extension, by defaultDefaultUpdateBehavior.getEditingDomain().org.eclipse.gef.GraphicalViewerReturns the GEFGraphicalVieweras it is needed in some Graphiti feature implementations.protected final org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferencesDelegates to the method (or the method in a subclass of)DefaultPaletteBehavior.getPalettePreferences().protected final org.eclipse.gef.palette.PaletteRootReturns thePaletteRootto use in the GEF editor by delegating toDefaultPaletteBehavior.getPaletteRoot().Returns thePictogramElements that are currently selected in the diagram editor.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 the tooltip that shall be displayed when hovering over the editor title tab.org.eclipse.ui.IWorkbenchPartReturns theIWorkbenchPartfor this container.voidHooks theGraphicalViewerto be used inside the container.voidinit(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) Does the initialization of the editor.voidCalled to initialize the editor with its content.booleanisDirty()Returns if the editor is currently dirty and needs to be saved or not.voidRefreshes the editor title to show the name of the diagramvoidRefreshes the tooltip displayed for the editor title tab according to what is returned ingetTitleToolTip().voidselectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection) Handles a selection changed event that is triggered by any selection source, e.g.voidselectPictogramElements(PictogramElement[] pictogramElements) Selects the givenPictogramElements in the diagram.voidsetEditDomain(org.eclipse.gef.DefaultEditDomain editDomain) Sets the GEF edit domain to the container.voidsetFocus()Sets the focus by delegating to the super class implementation in the GEF editor and additionally triggers a update of the diagram by delegating toDefaultUpdateBehavior.handleActivate().voidsetGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer) Sets theGraphicalViewerto be used inside the container.protected voidsetInput(org.eclipse.ui.IEditorInput input) Sets the givenIEditorInputobject as the input for this editor.voidsetPictogramElementForSelection(PictogramElement pictogramElement) Sets onePictogramElementfor later selection.voidsetPictogramElementsForSelection(PictogramElement[] pictogramElements) SetsPictogramElements for later selection.voidstackChanged(org.eclipse.gef.commands.CommandStackEvent event) voidUpdates the UI to correctly reflect the dirty state of the editor.Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
createPaletteComposite, createPalettePage, getGraphicalControl, getPaletteViewerProviderMethods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
createActions, doSaveAs, firePropertyChange, getCommandStack, getPropertyActions, getSelectionSynchronizer, getStackActions, initializeActionRegistry, isSaveAsAllowed, setActionRegistry, updateActionsMethods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.platform.IDiagramContainer
getTitleMethods inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI
getSiteMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Field Details
-
DIAGRAM_EDITOR_ID
The ID of theDiagramEditoras it is registered with the org.eclipse.ui.editors extension point.- See Also:
-
-
Constructor Details
-
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 Details
-
getDiagramBehavior
Returns the associatedDiagramSupportinstance to this editor.- Specified by:
getDiagramBehaviorin interfaceIDiagramContainer- Specified by:
getDiagramBehaviorin interfaceIDiagramContainerUI- Returns:
- The associated
DiagramSupportinstance - Since:
- 0.10
-
init
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException Does the initialization of the editor. The default implementation cares about:- converting the passed
IEditorInputto aDiagramEditorInput. In case this fails, aPartInitExceptionis thrown. - creating the editing domain by delegating to the update behavior
extension, see
DefaultUpdateBehavior.createEditingDomain(IDiagramEditorInput)for details - initializing the underlying GEF editor by delegating to super
- initializing the update behavior extension (the order is important here as this must happen after initializing the GEF editor!)
- triggering the migration of diagram data if necessary
super.init(site, input).- Specified by:
initin interfaceorg.eclipse.ui.IEditorPart- Overrides:
initin classorg.eclipse.gef.ui.parts.GraphicalEditor- Parameters:
site- the EclipseIEditorSitethat will host this editorinput- the editor input that shall be used. Note that this method will exchange the input instance in case it is noDiagramEditorInput.- Throws:
org.eclipse.ui.PartInitException- See Also:
-
IEditorPart.init(IEditorSite, IEditorInput)
- converting the passed
-
createDiagramBehavior
Creates the behavior object that cares about the common (behavioral) coding shared between editors, views and other composites. SeeDiagramBehaviorfor details and the default implementation. Override to change the behavior.- Returns:
- a new instance of
DiagramBehavior - Since:
- 0.10
-
convertToDiagramEditorInput
protected DiagramEditorInput convertToDiagramEditorInput(org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException Is called by theinit(IEditorSite, IEditorInput)method in case theIEditorInputinstance passed is noDiagramEditorInput. This method should try to convert the passed input object to aDiagramEditorInputor throw anPartInitExceptionin case the conversion can (or should) not be done for any reason. The default implementation uses theEditorInputAdapter.adaptToDiagramEditorInput(IEditorInput)method to do the conversion. Clients may adapt to do additional conversions or to prohibit any conversion by simply throwing aPartInitException.- Parameters:
input- the original input- Returns:
- a
DiagramEditorInputcorresponding to the passed input instance in case a conversion is possible. This method must not returnnull, otherwise the editor initialization will fail. - Throws:
org.eclipse.ui.PartInitException- in case the passed input object cannot or should not be converted to aDiagramEditorInputinstance.- Since:
- 0.9
-
setInput
protected void setInput(org.eclipse.ui.IEditorInput input) Sets the givenIEditorInputobject as the input for this editor. It must be of typeDiagramEditorInputotherwise anIllegalArgumentExceptionis thrown.
The default implementation here cares about loading the diagram from the EMFResourcethe input points to, sets the ID of theIDiagramTypeProviderfor the diagram given in the input, registers listeners (by delegating to#registerDiagramResourceSetListener()and#registerBusinessObjectsListener()) and does the refreshing of the editor UI.- Overrides:
setInputin classorg.eclipse.ui.part.EditorPart- Parameters:
input- theDiagramEditorInputinstance to use within this editor.
-
createPartControl
public void createPartControl(org.eclipse.swt.widgets.Composite parent) Creates the UI of the editor by delegating to thesuper.createPartControlmethod. The default implementation here also registers the command stack listener to correctly reflect the dirty state of the editor.- Specified by:
createPartControlin interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
createPartControlin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
-
createGraphicalViewer
protected void createGraphicalViewer(org.eclipse.swt.widgets.Composite parent) Creates the GraphicalViewer on the specifiedCompositeand initializes it. This method needs to be implemented here to fulfill the interface of the underlying GEF editor but only delegates toDiagramSupport#createGraphicalViewer(Composite).- Overrides:
createGraphicalViewerin classorg.eclipse.gef.ui.parts.GraphicalEditor- Parameters:
parent- The parent composite
-
initializeGraphicalViewer
public void initializeGraphicalViewer()Called to initialize the editor with its content. Here everything is done, which is dependent of the IConfigurationProviderInternal.- Specified by:
initializeGraphicalViewerin interfaceIDiagramContainerUI- Overrides:
initializeGraphicalViewerin classorg.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:
configureGraphicalViewerin interfaceIDiagramContainerUI- Overrides:
configureGraphicalViewerin classorg.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 aIEditorPart.PROP_DIRTYproperty change.- Specified by:
updateDirtyStatein interfaceIDiagramContainer- Since:
- 0.9
-
doSave
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor) Called to perform the saving of the editor. The default implementation delegates viaDiagramSupporttoDefaultPersistencyBehavior.saveDiagram(IProgressMonitor).- Specified by:
doSavein interfaceIDiagramContainer- Specified by:
doSavein interfaceorg.eclipse.ui.ISaveablePart- Specified by:
doSavein classorg.eclipse.ui.part.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 toDiagramSupport#isDirty().- Specified by:
isDirtyin interfaceIDiagramContainer- Specified by:
isDirtyin interfaceorg.eclipse.ui.ISaveablePart- Overrides:
isDirtyin classorg.eclipse.gef.ui.parts.GraphicalEditor- Returns:
truein case the editor is dirty,falseotherwise.
-
createPaletteViewerProvider
protected final org.eclipse.gef.ui.palette.PaletteViewerProvider createPaletteViewerProvider()Delegates to the method (or the method in a subclass of)#createPaletteViewerProvider()to create thePaletteViewerProviderused inside the GEF editor.- Overrides:
createPaletteViewerProviderin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette- Returns:
- the
PaletteViewerProviderto use
-
getPalettePreferences
protected final org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences getPalettePreferences()Delegates to the method (or the method in a subclass of)DefaultPaletteBehavior.getPalettePreferences(). To change the palette override the behavior there.- Overrides:
getPalettePreferencesin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette- Returns:
- the
PaletteViewerProviderpreferences to use.
-
getPaletteRoot
protected final org.eclipse.gef.palette.PaletteRoot getPaletteRoot()Returns thePaletteRootto use in the GEF editor by delegating toDefaultPaletteBehavior.getPaletteRoot().- Specified by:
getPaletteRootin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette- Returns:
- the
PaletteRootto use
-
refreshTitle
public void refreshTitle()Refreshes the editor title to show the name of the diagram- Specified by:
refreshTitlein interfaceIDiagramContainer- Since:
- 0.9
-
refreshTitleToolTip
public void refreshTitleToolTip()Refreshes the tooltip displayed for the editor title tab according to what is returned ingetTitleToolTip().- Specified by:
refreshTitleToolTipin interfaceIDiagramContainer- Since:
- 0.9
-
getAdapter
Implements the EclipseIAdaptableinterface. This implementation first delegates to theIToolBehaviorProvider.getAdapter(Class)method and checks if something is returned. In case the return value isnullit returns adapters for ZoomManager, IPropertySheetPage, Diagram, KeyHandler, SelectionSynchronizer and IContextButtonManager. It also delegates to the super implementation inGraphicalEditorWithFlyoutPalette.getAdapter(Class).- Specified by:
getAdapterin interfaceorg.eclipse.core.runtime.IAdaptable- Overrides:
getAdapterin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette- Parameters:
type- the type to which shall be adapted- Returns:
- the adapter instance
-
dispose
public void dispose()Disposes thisDiagramEditorinstance 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 theTransactionalEditingDomainheld by theDefaultPersistencyBehavior. Always delegate tosuper.dispose()in case you override this method!- Specified by:
disposein interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
disposein classorg.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 toDefaultUpdateBehavior.handleActivate().- Specified by:
setFocusin interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
setFocusin classorg.eclipse.gef.ui.parts.GraphicalEditor
-
getSelectedPictogramElements
Returns thePictogramElements that are currently selected in the diagram editor.- Specified by:
getSelectedPictogramElementsin interfaceIDiagramContainer- Returns:
- an array of
PictogramElements. - Since:
- 0.9
-
selectionChanged
public void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.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 aMultiPageEditorPartwith an opened diagram editor inside, tries to find anyPictogramElementfor the objects in the selection and selects them in the diagram.
Note that in case of theCommonNavigatoras event source, its editor linking mechanism must be enabled.- Specified by:
selectionChangedin interfaceorg.eclipse.ui.ISelectionListener- Overrides:
selectionChangedin classorg.eclipse.gef.ui.parts.GraphicalEditor- Parameters:
part- the sourceIWorkbenchPartthat triggered the eventselection- the new selection (mostly aIStructuredSelectioninstance.- Since:
- 0.9
-
selectPictogramElements
Selects the givenPictogramElements in the diagram.- Specified by:
selectPictogramElementsin interfaceIDiagramContainer- Parameters:
pictogramElements- an array ofPictogramElements to select.- Since:
- 0.9
-
setPictogramElementForSelection
Sets onePictogramElementfor later selection.The methods
#getPictogramElementsForSelection(),setPictogramElementForSelection(PictogramElement),setPictogramElementsForSelection(PictogramElement[])andDiagramSupport#selectBufferedPictogramElements()offer the possibility to use a deferred selection mechanism: via the setters,PictogramElements can be stored for a selection operation that is triggered lateron during a general refresh via the methodDiagramSupport#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:
setPictogramElementForSelectionin interfaceIDiagramContainer- Parameters:
pictogramElement- thePictogramElementthat shall be stored for later selection- Since:
- 0.9
-
setPictogramElementsForSelection
SetsPictogramElements for later selection.The methods
#getPictogramElementsForSelection(),setPictogramElementForSelection(PictogramElement),setPictogramElementsForSelection(PictogramElement[])andDiagramSupport#selectBufferedPictogramElements()offer the possibility to use a deferred selection mechanism: via the setters,PictogramElements can be stored for a selection operation that is triggered lateron during a general refresh via the methodDiagramSupport#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:
setPictogramElementsForSelectionin interfaceIDiagramContainer- Parameters:
pictogramElements- thePictogramElements that shall be stored for later selection- Since:
- 0.9
-
getContributorId
Returns the ID for contributions in the tabbed property sheets by delegating to the methodIToolBehaviorProvider.getContributorId().- Specified by:
getContributorIdin interfaceorg.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor- Returns:
- the contributor id as a
String - Since:
- 0.9
-
getDiagramTypeProvider
Returns theIDiagramTypeProviderinstance associated with thisDiagramEditor. 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:
getDiagramTypeProviderin interfaceIDiagramContainer- Returns:
- the associated
IDiagramTypeProviderinstance. - 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:
getEditDomainin interfaceIDiagramContainerUI- Overrides:
getEditDomainin classorg.eclipse.gef.ui.parts.GraphicalEditor- Returns:
- the
DefaultEditDomainused in this editor - Since:
- 0.9
- See Also:
-
GraphicalEditor.getEditDomain()
-
getGraphicalViewer
public 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.- Specified by:
getGraphicalViewerin interfaceIDiagramContainerUI- Overrides:
getGraphicalViewerin classorg.eclipse.gef.ui.parts.GraphicalEditor- Returns:
- the
GraphicalViewerused within this editor instance - See Also:
-
GraphicalEditor.getGraphicalViewer()
-
getTitleToolTip
Returns the tooltip that shall be displayed when hovering over the editor title tab.- Specified by:
getTitleToolTipin interfaceIDiagramContainer- Specified by:
getTitleToolTipin interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
getTitleToolTipin classorg.eclipse.ui.part.EditorPart- Returns:
- the tooltip as a
String
-
getEditingDomain
public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()Returns the EMFTransactionalEditingDomainused within this editor by delegating to the update behavior extension, by defaultDefaultUpdateBehavior.getEditingDomain().- Specified by:
getEditingDomainin interfaceorg.eclipse.emf.edit.domain.IEditingDomainProvider- Returns:
- the
TransactionalEditingDomaininstance used in the editor - Since:
- 0.9
-
getDiagramEditorInput
Description copied from interface:IDiagramContainerUIReturns 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.- Specified by:
getDiagramEditorInputin interfaceIDiagramContainerUI- Returns:
- The input containing the URI for the diagram
- Since:
- 0.10
-
getWorkbenchPart
public org.eclipse.ui.IWorkbenchPart getWorkbenchPart()Returns theIWorkbenchPartfor this container. Since this editor itself is already a part the default implementation simply returns this.- Specified by:
getWorkbenchPartin interfaceIDiagramContainerUI- Returns:
- This part
- Since:
- 0.10
-
close
public void close()Description copied from interface:IDiagramContainerNotify the container that it should shut down or clear it's state.- Specified by:
closein interfaceIDiagramContainer- Since:
- 0.10
-
setEditDomain
public void setEditDomain(org.eclipse.gef.DefaultEditDomain editDomain) Description copied from interface:IDiagramContainerUISets the GEF edit domain to the container. Needed for initializing the container from theDiagramBehaviorinstance.- Specified by:
setEditDomainin interfaceIDiagramContainerUI- Overrides:
setEditDomainin classorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette- Parameters:
editDomain- TheDefaultEditDomainto set- Since:
- 0.10
- See Also:
-
GraphicalEditor#setEditDomain()
-
getActionRegistry
public org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()Description copied from interface:IDiagramContainerUIReturns the GEF action registry for the container.- Specified by:
getActionRegistryin interfaceIDiagramContainerUI- Overrides:
getActionRegistryin classorg.eclipse.gef.ui.parts.GraphicalEditor- Returns:
- The
ActionRegistry
-
getSelectionActions
Description copied from interface:IDiagramContainerUIReturns 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:
getSelectionActionsin interfaceIDiagramContainerUI- Overrides:
getSelectionActionsin classorg.eclipse.gef.ui.parts.GraphicalEditor- Returns:
- A
Listcontaining the selection actions - See Also:
-
GraphicalEditor.getSelectionActions()
-
commandStackChanged
Description copied from interface:IDiagramContainerUINotification that the command stack changed. This might e.g. trigger an update of the dirty state of the container.- Specified by:
commandStackChangedin interfaceorg.eclipse.gef.commands.CommandStackListener- Specified by:
commandStackChangedin interfaceIDiagramContainerUI- Overrides:
commandStackChangedin classorg.eclipse.gef.ui.parts.GraphicalEditor- Parameters:
event- An event instance describing what happened- See Also:
-
GraphicalEditor.commandStackChanged(EventObject event)
-
stackChanged
public void stackChanged(org.eclipse.gef.commands.CommandStackEvent event) - Specified by:
stackChangedin interfaceorg.eclipse.gef.commands.CommandStackEventListener- Since:
- 0.15
-
setGraphicalViewer
public void setGraphicalViewer(org.eclipse.gef.GraphicalViewer viewer) Description copied from interface:IDiagramContainerUISets theGraphicalViewerto be used inside the container. The viewer is created by theDiagramBehaviorinstance and needs to be set in the GEF container.- Specified by:
setGraphicalViewerin interfaceIDiagramContainerUI- Overrides:
setGraphicalViewerin classorg.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:IDiagramContainerUIHooks theGraphicalViewerto be used inside the container.- Specified by:
hookGraphicalViewerin interfaceIDiagramContainerUI- Overrides:
hookGraphicalViewerin classorg.eclipse.gef.ui.parts.GraphicalEditor- See Also:
-
GraphicalEditor#hookGraphicalViewer(GraphicalViewer viewer)
-