de.cau.cs.kieler.core.ui.errorhandler
Class ModelErrorHandler

java.lang.Object
  extended by org.eclipse.ui.statushandlers.AbstractStatusHandler
      extended by org.eclipse.ui.statushandlers.WorkbenchErrorHandler
          extended by de.cau.cs.kieler.core.ui.errorhandler.GenericErrorHandler
              extended by de.cau.cs.kieler.core.ui.errorhandler.ModelErrorHandler

public class ModelErrorHandler
extends GenericErrorHandler

A StatusHandler that displays error messages for KielerModelException Status causes at the corresponding Diagram object as a problem marker. Other exceptions and styles (BLOCK, LOG) are handled like the default Status handler.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class de.cau.cs.kieler.core.ui.errorhandler.GenericErrorHandler
GenericErrorHandler.StatusListener
 
Constructor Summary
ModelErrorHandler()
           
 
Method Summary
static void addMarker(String msg, EObject target)
          Add a problem marker to a given EObject to indicate problems graphically in the diagram.
static void clearMarker(EObject target)
          Remove all custom problem markers from a given EObject to indicate problems graphically in the diagram.
 void handle(StatusAdapter statusAdapter, int style)
          
 
Methods inherited from class de.cau.cs.kieler.core.ui.errorhandler.GenericErrorHandler
addListener, removeListener
 
Methods inherited from class org.eclipse.ui.statushandlers.WorkbenchErrorHandler
configureStatusDialog, supportsNotification
 
Methods inherited from class org.eclipse.ui.statushandlers.AbstractStatusHandler
getId, getParam, getParams, setId, setParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelErrorHandler

public ModelErrorHandler()
Method Detail

handle

public void handle(StatusAdapter statusAdapter,
                   int style)
Description copied from class: GenericErrorHandler

Overrides:
handle in class GenericErrorHandler

addMarker

public static void addMarker(String msg,
                             EObject target)
                      throws KielerException
Add a problem marker to a given EObject to indicate problems graphically in the diagram. Will silently fail at any errors, e.g. if there is no graphical editor open corresponding to the object.

Parameters:
msg - String message of the marker
target - target object
Throws:
KielerException - if the marker cannot be created

clearMarker

public static void clearMarker(EObject target)
Remove all custom problem markers from a given EObject to indicate problems graphically in the diagram. Will silently fail at any errors, e.g. if there is no graphical editor open corresponding to the object.

Parameters:
target - target object