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 Details

  • Constructor Details

  • 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 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.