org.embl.ebi.escience.scuflui.shared
Interface ModelMap.ModelChangeListener

All Known Implementing Classes:
Workbench.CurrentWorkflowListener, Workbench.DebugListener, Workbench.WorkflowInstanceListener, WorkbenchPerspectives.CurrentPerspectiveListener
Enclosing class:
ModelMap

public static interface ModelMap.ModelChangeListener

Register with the static class to inform workbench like systems that the underlying map of named model objects has been altered in some way.

Author:
Tom Oinn, Stian Soiland

Method Summary
 boolean canHandle(java.lang.String modelName, java.lang.Object model)
          Return true if the listener can handle events for the given modelname and model.
 void modelChanged(java.lang.String modelName, java.lang.Object oldModel, java.lang.Object newModel)
          Called when the named model is updated
 void modelCreated(java.lang.String modelName, java.lang.Object model)
          Called when a new model is created or inserted into the model map under a previously absent key
 void modelDestroyed(java.lang.String modelName, java.lang.Object oldModel)
          Called when the named model is removed from the model map
 

Method Detail

canHandle

boolean canHandle(java.lang.String modelName,
                  java.lang.Object model)
Return true if the listener can handle events for the given modelname and model. Called before firing model* events.

For modelChanged events, the canHandle() will be called with the newModel object.

Parameters:
modelName - name of the model ex: ModelMap.CURRENT_WORKFLOW
model - Model that is being created, changed or destroyed
Returns:
true if the listener want to receive events for such objects

modelCreated

void modelCreated(java.lang.String modelName,
                  java.lang.Object model)
Called when a new model is created or inserted into the model map under a previously absent key

Parameters:
modelName - name of the new model
model - the new model object

modelChanged

void modelChanged(java.lang.String modelName,
                  java.lang.Object oldModel,
                  java.lang.Object newModel)
Called when the named model is updated

Parameters:
modelName - name of the model that changed
newModel - new model object
oldModel - old model object it replaces

modelDestroyed

void modelDestroyed(java.lang.String modelName,
                    java.lang.Object oldModel)
Called when the named model is removed from the model map

Parameters:
modelName -