org.embl.ebi.escience.scuflui.workbench
Class WorkbenchPerspectives.CurrentPerspectiveListener

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

public class WorkbenchPerspectives.CurrentPerspectiveListener
extends java.lang.Object
implements ModelMap.ModelChangeListener

Change perspective when ModelMap.CURRENT_PERSPECTIVE has been modified.

Author:
Stian Soiland, Stuart Owen

Constructor Summary
WorkbenchPerspectives.CurrentPerspectiveListener()
           
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchPerspectives.CurrentPerspectiveListener

public WorkbenchPerspectives.CurrentPerspectiveListener()
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)
Description copied from interface: ModelMap.ModelChangeListener
Called when a new model is created or inserted into the model map under a previously absent key

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)
Description copied from interface: ModelMap.ModelChangeListener
Called when the named model is updated

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)
Description copied from interface: ModelMap.ModelChangeListener
Called when the named model is removed from the model map

Specified by:
modelDestroyed in interface ModelMap.ModelChangeListener