org.eodisp.ui.common.components
Class AbstractEodispModel

java.lang.Object
  extended by org.eodisp.ui.common.components.AbstractEodispModel
All Implemented Interfaces:
EodispModel
Direct Known Subclasses:
ExperimentChooserModel, FedPermissionsModel, JxtaConfigModel, MmAppConfigModel, MmFederateInfoModel, MmFederatesModel, RemoteConfModel, ReposModel, RmAppConfigModel, SmAppConfigModel, SmAppSettingsModel, SmExperimentInfoModel, SmReposFederatesModel, SomCategoriesModel

public abstract class AbstractEodispModel
extends java.lang.Object
implements EodispModel

A default implementation of the EodispModel interface. It essentially hast empty methods for the functionality most models do not provide.

Version:
$Id:$
Author:
eglimi

Constructor Summary
AbstractEodispModel()
           
 
Method Summary
 void addModelListener(ModelListener listener)
          Adds a listener to this model
 void doUpdate()
           Instructs the model to do an update of its data.
protected  void fireModelChanged()
          Informs all subscribed listeners that the model has changed.
protected  ModelListener[] getModelListener()
          Returns all currently subscribed listeners.
 void redo()
          This re-performs the last command executed by the model.
 void removeModelListener(ModelListener listener)
          Removes a listener from this model
 void undo()
          This makes and undo of the last command executed by the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eodisp.ui.common.base.EodispModel
doSave, hasChanges
 

Constructor Detail

AbstractEodispModel

public AbstractEodispModel()
Method Detail

doUpdate

public void doUpdate()

Instructs the model to do an update of its data. Many EodispModels are just intermediated models for view components and do not hold the actual data. The actual data is usually retrieved and maintained by a persistency framework. Thus, if the real data has been changed, a model can be informed of this updated and it can be instructed to reload the data.

This should in most cases lead to an update of the visual component representing the data as well.

Specified by:
doUpdate in interface EodispModel

redo

public void redo()
This re-performs the last command executed by the model. How a redo is implemented depends on the model. This operation might not be available on all models. Models not supporting redo should ignore such a request.

Specified by:
redo in interface EodispModel

undo

public void undo()
This makes and undo of the last command executed by the model. How an undo is implemented depends on the model. This operation might not be available on all models. Models not supporting undo should ignore such a request.

Specified by:
undo in interface EodispModel

addModelListener

public void addModelListener(ModelListener listener)
Adds a listener to this model

Parameters:
listener - The listener to add.

removeModelListener

public void removeModelListener(ModelListener listener)
Removes a listener from this model

Parameters:
listener - The listener to remove.

getModelListener

protected ModelListener[] getModelListener()
Returns all currently subscribed listeners.

Returns:
A list of subscribed listeners.

fireModelChanged

protected void fireModelChanged()
Informs all subscribed listeners that the model has changed.