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
Constructor and Description
`AbstractDiagramTypeProvider()` Creates a new `AbstractDiagramTypeProvider`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `dispose()` Dispose.
`IToolBehaviorProvider[]` `getAvailableToolBehaviorProviders()` Returns all available tool behavior providers
`java.lang.String` `getContextId()` Gets the context id.
`int` `getCurrentToolBehaviorIndex()`
`IToolBehaviorProvider` `getCurrentToolBehaviorProvider()` Gets the current tool behaviour provider.
`Diagram` `getDiagram()` Returns the diagram.
`IDiagramBehavior` `getDiagramBehavior()` Returns the current diagram behavior instance.
`java.lang.String` `getDiagramTitle()` Returns the diagram title.
`IFeatureProvider` `getFeatureProvider()` Gets the feature provider.
`IGraphicsAlgorithmRendererFactory` `getGraphicsAlgorithmRendererFactory()` Gets the graphics algorithm renderer factory.
`INotificationService` `getNotificationService()` Returns the notification service.
`java.lang.Object[]` `getRelatedBusinessObjects(java.lang.Object[] bos)` Gets the related business objects.
`void` `init(Diagram diagram, IDiagramBehavior diagramBehavior)` Implement this method to initialize the diagram type provider.
`boolean` `isAutoUpdateAtReset()` Returns the editor's update behaviour on reset.
`boolean` `isAutoUpdateAtRuntime()` Returns the editor's update behaviour.
`boolean` `isAutoUpdateAtRuntimeWhenEditorIsSaved()` Returns the editor's update behaviour when the editor is saved.
`boolean` `isAutoUpdateAtStartup()` Returns the editor's update behaviour at startup.
`void` `postInit()` This method will be called after this diagram type provider has been completely initialised.
`void` `resourceReloaded(Diagram diagram)` This method will be called if the underlying resource which contains the diagram has been reloaded.
`void` `resourcesSaved(Diagram diagram, org.eclipse.emf.ecore.resource.Resource[] savedResources)` This method will be called by the DiagramEditor when a diagram has been saved.
`void` `setContextId(java.lang.String contextId)` Sets the context id.
`void` `setCurrentToolBehaviorIndex(int index)`

### Methods inherited from class org.eclipse.graphiti.platform.AbstractExtension

`getProviderId, setProviderId`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.graphiti.platform.IExtension

`getProviderId, setProviderId`

### Constructor Detail

#### AbstractDiagramTypeProvider

    public AbstractDiagramTypeProvider()

Creates a new `AbstractDiagramTypeProvider`.

### Method Detail

#### getAvailableToolBehaviorProviders

    public IToolBehaviorProvider[] getAvailableToolBehaviorProviders()

Returns all available tool behavior providers

Specified by:
  `getAvailableToolBehaviorProviders` in interface `IDiagramTypeProvider`
Returns:
  An array of all registered tool behavior providers
See Also:
  `IToolBehaviorProvider`

#### getCurrentToolBehaviorProvider

    public IToolBehaviorProvider getCurrentToolBehaviorProvider()

Description copied from interface: `IDiagramTypeProvider`
Gets the current tool behaviour provider.

Specified by:
  `getCurrentToolBehaviorProvider` in interface `IDiagramTypeProvider`
Returns:
  the currently active tool behaviour provider
See Also:
  `IToolBehaviorProvider`

#### getCurrentToolBehaviorIndex

    public int getCurrentToolBehaviorIndex()

Specified by:
  `getCurrentToolBehaviorIndex` in interface `IDiagramTypeProvider`

#### setCurrentToolBehaviorIndex

    public void setCurrentToolBehaviorIndex(int index)

Specified by:
  `setCurrentToolBehaviorIndex` in interface `IDiagramTypeProvider`

#### getDiagram

    public Diagram getDiagram()

Description copied from interface: `IDiagramTypeProvider`
Returns the diagram.

Specified by:
  `getDiagram` in interface `IDiagramTypeProvider`
Returns:
  the currently opened diagram

#### getDiagramTitle

    public java.lang.String getDiagramTitle()

Description copied from interface: `IDiagramTypeProvider`
Returns the diagram title.

Specified by:
  `getDiagramTitle` in interface `IDiagramTypeProvider`
Returns:
  the diagram-title, e.g. this will be used for the title-bar of the editor

#### getDiagramBehavior

    public IDiagramBehavior getDiagramBehavior()

Description copied from interface: `IDiagramTypeProvider`
Returns the current diagram behavior instance.

Specified by:
  `getDiagramBehavior` in interface `IDiagramTypeProvider`
Returns:
  The current `IDiagramBehavior`
Since:
  0.10

#### getFeatureProvider

    public IFeatureProvider getFeatureProvider()

Description copied from interface: `IFeatureProviderHolder`
Gets the feature provider.

Specified by:
  `getFeatureProvider` in interface `IFeatureProviderHolder`
Returns:
  the feature provider

#### getContextId

    public java.lang.String getContextId()

Description copied from interface: `IDiagramTypeProvider`
Gets the context id.

Specified by:
  `getContextId` in interface `IDiagramTypeProvider`
Returns:
  the context id
Since:
  0.10

#### setContextId

    public void setContextId(java.lang.String contextId)

Description copied from interface: `IDiagramTypeProvider`
Sets the context id.

Specified by:
  `setContextId` in interface `IDiagramTypeProvider`
Parameters:
  `contextId` - the new context id
Since:
  0.10

#### init

    public void init(Diagram diagram,
                     IDiagramBehavior diagramBehavior)

Description copied from interface: `IDiagramTypeProvider`
Implement this method to initialize the diagram type provider.

Specified by:
  `init` in interface `IDiagramTypeProvider`
Parameters:
  `diagram` - the currently opened diagram
Since:
  0.10

#### isAutoUpdateAtRuntime

    public boolean isAutoUpdateAtRuntime()

Description copied from interface: `IDiagramTypeProvider`
Returns the editor's update behaviour. This flag controls if a diagram editor will update its contents (call the `update feature` of the `PictogramElement`s changes are indicated for.
Note that the update will only be triggered in case the editor is already dirty, see `IDiagramTypeProvider.isAutoUpdateAtRuntimeWhenEditorIsSaved()`.

Specified by:
  `isAutoUpdateAtRuntime` in interface `IDiagramTypeProvider`
Returns:
  true if diagram should be updated automatically (only if editor is already dirty)

#### isAutoUpdateAtRuntimeWhenEditorIsSaved

    public boolean isAutoUpdateAtRuntimeWhenEditorIsSaved()

Description copied from interface: `IDiagramTypeProvider`
Returns the editor's update behaviour when the editor is saved. This method is only called when `IDiagramTypeProvider.isAutoUpdateAtRuntime()` returns `true` and the editor is not dirty. In case this method returns `true` the editor will do an update; this will usually cause the editor to get dirty.

Specified by:
  `isAutoUpdateAtRuntimeWhenEditorIsSaved` in interface `IDiagramTypeProvider`
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: `IDiagramTypeProvider`
Returns the editor's update behaviour at startup.

Specified by:
  `isAutoUpdateAtStartup` in interface `IDiagramTypeProvider`
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: `IDiagramTypeProvider`
Returns the editor's update behaviour on reset.

Specified by:
  `isAutoUpdateAtReset` in interface `IDiagramTypeProvider`
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: `IDiagramTypeProvider`
Dispose.

Specified by:
  `dispose` in interface `IDiagramTypeProvider`

#### getNotificationService

    public INotificationService getNotificationService()

Description copied from interface: `IDiagramTypeProvider`
Returns the notification service.

Specified by:
  `getNotificationService` in interface `IDiagramTypeProvider`
Returns:
  the notification service

#### getRelatedBusinessObjects

    public java.lang.Object[] getRelatedBusinessObjects(java.lang.Object[] bos)

Description copied from interface: `IDiagramTypeProvider`
Gets the related business objects.

Specified by:
  `getRelatedBusinessObjects` in interface `IDiagramTypeProvider`
Parameters:
  `bos` - the business objects
Returns:
  the related business objects

#### getGraphicsAlgorithmRendererFactory

    public IGraphicsAlgorithmRendererFactory getGraphicsAlgorithmRendererFactory()

Description copied from interface: `IDiagramTypeProvider`
Gets the graphics algorithm renderer factory.

Specified by:
  `getGraphicsAlgorithmRendererFactory` in interface `IDiagramTypeProvider`
Returns:
  the graphics algorithm renderer factory

#### postInit

    public void postInit()

Description copied from interface: `IDiagramTypeProvider`
This 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:
  `postInit` in interface `IDiagramTypeProvider`

#### resourceReloaded

    public void resourceReloaded(Diagram diagram)

Description copied from interface: `IDiagramTypeProvider`
This method will be called if the underlying resource which contains the diagram has been reloaded.

Specified by:
  `resourceReloaded` in interface `IDiagramTypeProvider`

#### resourcesSaved

    public void resourcesSaved(Diagram diagram,
                               org.eclipse.emf.ecore.resource.Resource[] savedResources)

Description copied from interface: `IDiagramTypeProvider`
This method will be called by the DiagramEditor when a diagram has been saved.

Specified by:
  `resourcesSaved` in interface `IDiagramTypeProvider`
Parameters:
  `diagram` - The diagram for which the editor has been saved
  `savedResources` - The resources that have been saved