Package 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 theDiagramBehavior
behavior extension that controls how markers are handled in the editor. Clients may subclass to change the marker behavior; useDiagramBehavior.createMarkerBehavior()
to return the instance that shall be used.
Note that there is always a 1:1 relation with aDiagramBehavior
.- Since:
- 0.9
-
-
Field Summary
Fields Modifier and Type Field Description protected DiagramBehavior
diagramBehavior
The associatedDiagramBehavior
-
Constructor Summary
Constructors Constructor Description DefaultMarkerBehavior(DiagramBehavior diagramBehavior)
Creates a new instance ofDefaultMarkerBehavior
that is associated with the givenDiagramBehavior
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 withdisableProblemIndicationUpdate()
.org.eclipse.emf.ecore.util.EContentAdapter
getProblemIndicationAdapter()
Returns the adapter that is installed for updating the markers.void
initialize()
Initializes this marker behavior extension.
-
-
-
Field Detail
-
diagramBehavior
protected DiagramBehavior diagramBehavior
The associatedDiagramBehavior
- Since:
- 0.10
-
-
Constructor Detail
-
DefaultMarkerBehavior
public DefaultMarkerBehavior(DiagramBehavior diagramBehavior)
Creates a new instance ofDefaultMarkerBehavior
that is associated with the givenDiagramBehavior
.- Parameters:
diagramBehavior
- the associatedDiagramBehavior
- 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 withdisableProblemIndicationUpdate()
. 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 analyzeexception
- forwarded as data object to theBasicDiagnostic
- 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.
-
-