Package org.eclipse.graphiti.dt
Class AbstractDiagramTypeProvider
java.lang.Object
org.eclipse.graphiti.platform.AbstractExtension
org.eclipse.graphiti.dt.AbstractDiagramTypeProvider
- All Implemented Interfaces:
IDiagramTypeProvider,IFeatureProviderHolder,IExtension
- Direct Known Subclasses:
DummyExportAsImageDiagramTypeProvider
public abstract class AbstractDiagramTypeProvider
extends AbstractExtension
implements IDiagramTypeProvider
The Class AbstractDiagramTypeProvider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose.Returns all available tool behavior providersGets the context id.intGets the current tool behaviour provider.Returns the diagram.Returns the current diagram behavior instance.Returns the diagram title.Gets the feature provider.Gets the graphics algorithm renderer factory.Returns the notification service.Object[]getRelatedBusinessObjects(Object[] bos) Gets the related business objects.voidinit(Diagram diagram, IDiagramBehavior diagramBehavior) Implement this method to initialize the diagram type provider.booleanReturns the editor's update behaviour on reset.booleanReturns the editor's update behaviour.booleanReturns the editor's update behaviour when the editor is saved.booleanReturns the editor's update behaviour at startup.voidpostInit()This method will be called after this diagram type provider has been completely initialised.voidresourceReloaded(Diagram diagram) This method will be called if the underlying resource which contains the diagram has been reloaded.voidresourcesSaved(Diagram diagram, org.eclipse.emf.ecore.resource.Resource[] savedResources) This method will be called by the DiagramEditor when a diagram has been saved.voidsetContextId(String contextId) Sets the context id.voidsetCurrentToolBehaviorIndex(int index) protected voidsetFeatureProvider(IFeatureProvider featureProvider) Sets the feature provider.Methods inherited from class org.eclipse.graphiti.platform.AbstractExtension
getProviderId, setProviderIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.platform.IExtension
getProviderId, setProviderId
-
Constructor Details
-
AbstractDiagramTypeProvider
public AbstractDiagramTypeProvider()Creates a newAbstractDiagramTypeProvider.
-
-
Method Details
-
getAvailableToolBehaviorProviders
Returns all available tool behavior providers- Specified by:
getAvailableToolBehaviorProvidersin interfaceIDiagramTypeProvider- Returns:
- An array of all registered tool behavior providers
- See Also:
-
getCurrentToolBehaviorProvider
Description copied from interface:IDiagramTypeProviderGets the current tool behaviour provider.- Specified by:
getCurrentToolBehaviorProviderin interfaceIDiagramTypeProvider- Returns:
- the currently active tool behaviour provider
- See Also:
-
getCurrentToolBehaviorIndex
public int getCurrentToolBehaviorIndex()- Specified by:
getCurrentToolBehaviorIndexin interfaceIDiagramTypeProvider
-
setCurrentToolBehaviorIndex
public void setCurrentToolBehaviorIndex(int index) - Specified by:
setCurrentToolBehaviorIndexin interfaceIDiagramTypeProvider
-
getDiagram
Description copied from interface:IDiagramTypeProviderReturns the diagram.- Specified by:
getDiagramin interfaceIDiagramTypeProvider- Returns:
- the currently opened diagram
-
getDiagramTitle
Description copied from interface:IDiagramTypeProviderReturns the diagram title.- Specified by:
getDiagramTitlein interfaceIDiagramTypeProvider- Returns:
- the diagram-title, e.g. this will be used for the title-bar of the editor
-
getDiagramBehavior
Description copied from interface:IDiagramTypeProviderReturns the current diagram behavior instance.- Specified by:
getDiagramBehaviorin interfaceIDiagramTypeProvider- Returns:
- The current
IDiagramBehavior - Since:
- 0.10
-
getFeatureProvider
Description copied from interface:IFeatureProviderHolderGets the feature provider.- Specified by:
getFeatureProviderin interfaceIFeatureProviderHolder- Returns:
- the feature provider
-
getContextId
Description copied from interface:IDiagramTypeProviderGets the context id.- Specified by:
getContextIdin interfaceIDiagramTypeProvider- Returns:
- the context id
- Since:
- 0.10
-
setContextId
Description copied from interface:IDiagramTypeProviderSets the context id.- Specified by:
setContextIdin interfaceIDiagramTypeProvider- Parameters:
contextId- the new context id- Since:
- 0.10
-
init
Description copied from interface:IDiagramTypeProviderImplement this method to initialize the diagram type provider.- Specified by:
initin interfaceIDiagramTypeProvider- Parameters:
diagram- the currently opened diagram- Since:
- 0.10
-
setFeatureProvider
Sets the feature provider.- Parameters:
featureProvider- The featureProvider to set.
-
isAutoUpdateAtRuntime
public boolean isAutoUpdateAtRuntime()Description copied from interface:IDiagramTypeProviderReturns the editor's update behaviour. This flag controls if a diagram editor will update its contents (call theupdate featureof thePictogramElements changes are indicated for.
Note that the update will only be triggered in case the editor is already dirty, seeIDiagramTypeProvider.isAutoUpdateAtRuntimeWhenEditorIsSaved().- Specified by:
isAutoUpdateAtRuntimein interfaceIDiagramTypeProvider- Returns:
- true if diagram should be updated automatically (only if editor is already dirty)
-
isAutoUpdateAtRuntimeWhenEditorIsSaved
public boolean isAutoUpdateAtRuntimeWhenEditorIsSaved()Description copied from interface:IDiagramTypeProviderReturns the editor's update behaviour when the editor is saved. This method is only called whenIDiagramTypeProvider.isAutoUpdateAtRuntime()returnstrueand the editor is not dirty. In case this method returnstruethe editor will do an update; this will usually cause the editor to get dirty.- Specified by:
isAutoUpdateAtRuntimeWhenEditorIsSavedin interfaceIDiagramTypeProvider- Returns:
- true if diagram should be updated automatically (only if editor is already dirty)
- Since:
- 0.9
-
isAutoUpdateAtStartup
public boolean isAutoUpdateAtStartup()Description copied from interface:IDiagramTypeProviderReturns the editor's update behaviour at startup.- Specified by:
isAutoUpdateAtStartupin interfaceIDiagramTypeProvider- Returns:
- true if diagram should be updated (if needed) immediately after open in editor - editor will be dirty then; false if diagram should not be updated - editor not dirty but eventually red at out of date areas
-
isAutoUpdateAtReset
public boolean isAutoUpdateAtReset()Description copied from interface:IDiagramTypeProviderReturns the editor's update behaviour on reset.- Specified by:
isAutoUpdateAtResetin interfaceIDiagramTypeProvider- Returns:
- true if diagram should be updated automatically if editor is already dirty and the user chooses to discard his changes (reset of the diagram) when a change from outside of the editor happens.
-
dispose
public void dispose()Description copied from interface:IDiagramTypeProviderDispose.- Specified by:
disposein interfaceIDiagramTypeProvider
-
getNotificationService
Description copied from interface:IDiagramTypeProviderReturns the notification service.- Specified by:
getNotificationServicein interfaceIDiagramTypeProvider- Returns:
- the notification service
-
getRelatedBusinessObjects
Description copied from interface:IDiagramTypeProviderGets the related business objects.- Specified by:
getRelatedBusinessObjectsin interfaceIDiagramTypeProvider- Parameters:
bos- the business objects- Returns:
- the related business objects
-
getGraphicsAlgorithmRendererFactory
Description copied from interface:IDiagramTypeProviderGets the graphics algorithm renderer factory.- Specified by:
getGraphicsAlgorithmRendererFactoryin interfaceIDiagramTypeProvider- Returns:
- the graphics algorithm renderer factory
-
postInit
public void postInit()Description copied from interface:IDiagramTypeProviderThis method will be called after this diagram type provider has been completely initialised. The state of the using diagram editor can not be predicted.- Specified by:
postInitin interfaceIDiagramTypeProvider
-
resourceReloaded
Description copied from interface:IDiagramTypeProviderThis method will be called if the underlying resource which contains the diagram has been reloaded.- Specified by:
resourceReloadedin interfaceIDiagramTypeProvider
-
resourcesSaved
public void resourcesSaved(Diagram diagram, org.eclipse.emf.ecore.resource.Resource[] savedResources) Description copied from interface:IDiagramTypeProviderThis method will be called by the DiagramEditor when a diagram has been saved.- Specified by:
resourcesSavedin interfaceIDiagramTypeProvider- Parameters:
diagram- The diagram for which the editor has been savedsavedResources- The resources that have been saved
-