Package org.eclipse.graphiti.ui.editor

# Class DefaultMarkerBehavior

java.lang.Object
org.eclipse.graphiti.ui.editor.DefaultMarkerBehavior

public class DefaultMarkerBehavior extends Object
The default implementation for the `DiagramBehavior` behavior extension that controls how markers are handled in the editor. Clients may subclass to change the marker behavior; use `DiagramBehavior.createMarkerBehavior()` to return the instance that shall be used.
Note that there is always a 1:1 relation with a `DiagramBehavior`.

Since:
  0.9

## Field Summary

Fields
Modifier and Type
Field
Description
`protected DiagramBehavior`
`diagramBehavior`
The associated `DiagramBehavior`

## Constructor Summary

Constructors
Constructor
Description
`DefaultMarkerBehavior(DiagramBehavior diagramBehavior)`
Creates a new instance of `DefaultMarkerBehavior` that is associated with the given `DiagramBehavior`.

## Method Summary

Modifier and Type
Method
Description
`org.eclipse.emf.common.util.Diagnostic`
`analyzeResourceProblems(org.eclipse.emf.ecore.resource.Resource resource, Exception exception)`
Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).
`void`
`disableProblemIndicationUpdate()`
Can be called to (temporarily) disable the marker update adapter, so that mass changes do not result in a bunch of notifications and cause performance penalties.
`void`
`dispose()`
Called to dispose this instance when the editor is closed.
`void`
`enableProblemIndicationUpdate()`
Can be called to enable the marker update adapter again after it has been disabled with `disableProblemIndicationUpdate()`.
`org.eclipse.emf.ecore.util.EContentAdapter`
`getProblemIndicationAdapter()`
Returns the adapter that is installed for updating the markers.
`void`
`initialize()`
Initializes this marker behavior extension.

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

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

## Field Details

### diagramBehavior

protected DiagramBehavior diagramBehavior
The associated `DiagramBehavior`

Since:
  0.10

## Constructor Details

### DefaultMarkerBehavior

public DefaultMarkerBehavior(DiagramBehavior diagramBehavior)
Creates a new instance of `DefaultMarkerBehavior` that is associated with the given `DiagramBehavior`.

Parameters:
  `diagramBehavior` - the associated `DiagramBehavior`
Since:
  0.10

## Method Details

### initialize

public void initialize()
Initializes this marker behavior extension. The default implementation simply registers an adapter that updates the markers when EMF objects change.

### getProblemIndicationAdapter

public org.eclipse.emf.ecore.util.EContentAdapter getProblemIndicationAdapter()
Returns the adapter that is installed for updating the markers.

Returns:
  the problemIndicationAdapter

### disableProblemIndicationUpdate

public void disableProblemIndicationUpdate()
Can be called to (temporarily) disable the marker update adapter, so that mass changes do not result in a bunch of notifications and cause performance penalties.

See Also:
  - `enableProblemIndicationUpdate()`

### enableProblemIndicationUpdate

public void enableProblemIndicationUpdate()
Can be called to enable the marker update adapter again after it has been disabled with `disableProblemIndicationUpdate()`. The default implementation also triggers an update of the markers.

### analyzeResourceProblems

public org.eclipse.emf.common.util.Diagnostic analyzeResourceProblems(org.eclipse.emf.ecore.resource.Resource resource, Exception exception)
Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).

Parameters:
  `resource` - the resource to analyze
  `exception` - forwarded as data object to the `BasicDiagnostic`
Returns:
  a new `Diagnostic` for the given resource

### dispose

public void dispose()
Called to dispose this instance when the editor is closed. The default implementation simply disables the marker update adapter and removes it from the resource set and clears its member variables.