org.eclipse.graphiti.ui.editor

## Class DefaultMarkerBehavior

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

    public class DefaultMarkerBehavior
    extends java.lang.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

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`org.eclipse.emf.common.util.Diagnostic` `analyzeResourceProblems(org.eclipse.emf.ecore.resource.Resource resource, java.lang.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

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

### Constructor Detail

#### 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 Detail

#### 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,
                                                                          java.lang.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.