com.sdm.quasar.client.core.dialogsupport.features
Class AbstractPresentationFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.core.dialogsupport.features.AbstractPresentationFeature
All Implemented Interfaces:
Feature, SystemInfoProvider
Direct Known Subclasses:
EmplDetailPresentation, ListPresentation

public abstract class AbstractPresentationFeature
extends AbstractFeature

Abstract Feature that supports convenience methods and a typical initialization for a dialog presentation.

Author:
Martin Haft

Field Summary
protected  java.util.List disposables
           
 
Constructor Summary
AbstractPresentationFeature()
           
 
Method Summary
protected abstract  void bindActions()
          Binds the actions from the dialog core (e.g. within an action or command manager) to the visual representation.
protected abstract  void bindData()
          Binds the data from the dialog core (e.g. within a data manager) to the visual representation.
protected abstract  void configureStates()
          Configures states from the dialog core and presentation states and binds them to the visual representation.
protected  CommandManagerFeature getCommandManagerFeature()
          Returns the Feature instance.
protected  DataManager getDataManager()
          Convenience methof for access to the DataManager
protected  DataManagerFeature getDataManagerFeature()
          Returns the data manager feature instance where our data is stored.
protected  java.lang.Object getValue(java.lang.String key)
          Convenience method to to get a value from the data manager
protected  void prepare()
          Called when the dialog is prepared.
protected  void registerDisposable(Disposable disposable)
          Registeres Disposables wil be disposes automatically when this feature is released
protected  void release()
          Called when the dialog is released.
protected  void unregisterDisposable(Disposable disposable)
          Unregister a former registered Disposable
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, dispose, disposeFeature, getDialogControl, init, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

disposables

protected java.util.List disposables
Constructor Detail

AbstractPresentationFeature

public AbstractPresentationFeature()
Method Detail

prepare

protected void prepare()
Description copied from class: AbstractFeature
Called when the dialog is prepared. Override this method if you want to perform some action on LifeCycle.prepare(), e.g. gain resource and provide services for childs.

The default implementation in AbstractFeature does nothing.

Overrides:
prepare in class AbstractFeature

release

protected void release()
Description copied from class: AbstractFeature
Called when the dialog is released. Override this method if you want to perform some action on LifeCycle.release()(), e.g. unregister services.

The default implementation in AbstractFeature does nothing.

Overrides:
release in class AbstractFeature

bindData

protected abstract void bindData()
Binds the data from the dialog core (e.g. within a data manager) to the visual representation. This method is called first in the prepare() method


bindActions

protected abstract void bindActions()
Binds the actions from the dialog core (e.g. within an action or command manager) to the visual representation. This method is called second in the prepare() method, after bindData() has been called.


configureStates

protected abstract void configureStates()
Configures states from the dialog core and presentation states and binds them to the visual representation. This method is called last in the prepare() method, after bindData() and bindActions() has been called.


registerDisposable

protected void registerDisposable(Disposable disposable)
Registeres Disposables wil be disposes automatically when this feature is released

Parameters:
disposable - Disposable to be disposed when this Feature is released.

unregisterDisposable

protected void unregisterDisposable(Disposable disposable)
Unregister a former registered Disposable

Parameters:
disposable - the Disposable to be unregistered

getDataManagerFeature

protected DataManagerFeature getDataManagerFeature()
Returns the data manager feature instance where our data is stored. See FeatureManager.requireFeature(Class) for more information about the process.


getDataManager

protected DataManager getDataManager()
Convenience methof for access to the DataManager

Returns:
the data manager for this dialog

getValue

protected java.lang.Object getValue(java.lang.String key)
Convenience method to to get a value from the data manager

Parameters:
key - the key to the value in the data manager
Returns:
the value from the data manager

getCommandManagerFeature

protected CommandManagerFeature getCommandManagerFeature()
Returns the Feature instance. If the feature is already installed, the installed instance will be returned, if it is not installed, a new instance will be created; if the installation of the new feature fails, an runtime exception will be thrown.