org.embl.ebi.escience.scuflui.workbench
Class Workbench.WorkflowInstanceListener

java.lang.Object
  extended by org.embl.ebi.escience.scuflui.workbench.Workbench.WorkflowInstanceListener
All Implemented Interfaces:
ModelMap.ModelChangeListener
Enclosing class:
Workbench

public class Workbench.WorkflowInstanceListener
extends java.lang.Object
implements ModelMap.ModelChangeListener

Keep WorkflowInstanceSetViewSPI notified about creation and destruction about workflow instances. The WorkflowInstanceSetViewSPIs will create tabs or similar showing the workflow run progression.

Author:
Stian Soiland

Constructor Summary
Workbench.WorkflowInstanceListener()
           
 
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)
          Should normally not happen with WF instances
 void modelCreated(java.lang.String modelName, java.lang.Object model)
          New WorkflowInstance created, create workflow instance in each WorkflowInstanceSetViewSPI.
 void modelDestroyed(java.lang.String modelName, java.lang.Object oldModel)
          Remove workflow instance from each WorkflowInstanceSetViewSPI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Workbench.WorkflowInstanceListener

public Workbench.WorkflowInstanceListener()
Method Detail

canHandle

public boolean canHandle(java.lang.String modelName,
                         java.lang.Object model)
Description copied from interface: ModelMap.ModelChangeListener
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.

Specified by:
canHandle in interface ModelMap.ModelChangeListener
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

public void modelCreated(java.lang.String modelName,
                         java.lang.Object model)
New WorkflowInstance created, create workflow instance in each WorkflowInstanceSetViewSPI. Highlights the first view by selecting its tabs.

Specified by:
modelCreated in interface ModelMap.ModelChangeListener
Parameters:
modelName - name of the new model
model - the new model object

modelChanged

public void modelChanged(java.lang.String modelName,
                         java.lang.Object oldModel,
                         java.lang.Object newModel)
Should normally not happen with WF instances

Specified by:
modelChanged in interface ModelMap.ModelChangeListener
Parameters:
modelName - name of the model that changed
oldModel - old model object it replaces
newModel - new model object

modelDestroyed

public void modelDestroyed(java.lang.String modelName,
                           java.lang.Object oldModel)
Remove workflow instance from each WorkflowInstanceSetViewSPI.

Specified by:
modelDestroyed in interface ModelMap.ModelChangeListener