Package org.eclipse.graphiti.ui.editor
Class DefaultMarkerBehavior
java.lang.Object
org.eclipse.graphiti.ui.editor.DefaultMarkerBehavior
The default implementation for the
Note that there is always a 1:1 relation with a
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
-
Constructor Summary
ConstructorDescriptionDefaultMarkerBehavior
(DiagramBehavior diagramBehavior) Creates a new instance ofDefaultMarkerBehavior
that is associated with the givenDiagramBehavior
. -
Method Summary
Modifier and TypeMethodDescriptionorg.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
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
Can be called to enable the marker update adapter again after it has been disabled withdisableProblemIndicationUpdate()
.org.eclipse.emf.ecore.util.EContentAdapter
Returns the adapter that is installed for updating the markers.void
Initializes this marker behavior extension.
-
Field Details
-
diagramBehavior
The associatedDiagramBehavior
- Since:
- 0.10
-
-
Constructor Details
-
DefaultMarkerBehavior
Creates a new instance ofDefaultMarkerBehavior
that is associated with the givenDiagramBehavior
.- Parameters:
diagramBehavior
- the associatedDiagramBehavior
- 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
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, 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.
-