com.sdm.quasar.client.core.dialogbase.features
Class AbstractControllerFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.core.dialogbase.features.AbstractControllerFeature
All Implemented Interfaces:
Feature, SystemInfoProvider
Direct Known Subclasses:
AbstractActivationControllerFeature, RootControllerFeature

public abstract class AbstractControllerFeature
extends AbstractFeature

Version:
1.$Revision$
Author:
Thomas Wolf

Nested Class Summary
protected  class AbstractControllerFeature.SubDialogController
          The internal class to access informations of a controlled subdialog
 
Constructor Summary
AbstractControllerFeature(java.lang.String serviceRegistrationContext)
          Creates a new AbstractControllerFeature.
 
Method Summary
protected  void activate()
          Called when the dialog is activated.
protected  AbstractControllerFeature.SubDialogController addSubDialogController(java.lang.String localName, SubDialogControl subDialogControl)
          Adds the given SubDialogControl to this embedding feature using the given local name.
 void collectSystemInfo(SystemInfoNode root, SystemInfoOptions options)
          Builds the system information tree upon local information of the implementor. The system information tree can be used within development by inspecting the system; so implementors should append their internal state (depending on the details settings within SystemInfoOptions). The information can be appended to the tree by adding new child SystemInformationNodes to the root node given using the SystemInfoNode.createChild(String) method and by setting information attributes the these nodes or the given root node. Subclasses should overwrite this method to append system informations Subclasses should overwrite this method to append system informations
protected  void deactivate()
          Called when the dialog is deactivated.
protected  LifeCycleState getLifeCycleState()
          Returns the LifeCycleState of the feature (e.g. the same than AbstractFeature.getDialogControl().
protected  AbstractControllerFeature.SubDialogController getSubDialogController(DialogInstanceId dialogInstanceId)
          Returns the AbstractControllerFeature.SubDialogController for the embedded sub dialog specified via the given SubDialogControl.
protected  AbstractControllerFeature.SubDialogController getSubDialogController(java.lang.String localName)
          Returns the AbstractControllerFeature.SubDialogController for the embedded subdialog specified via the given local embedding name.
protected  AbstractControllerFeature.SubDialogController getSubDialogController(SubDialogControl subDialogControl)
          Returns the AbstractControllerFeature.SubDialogController for the embedded sub dialog specified via the given SubDialogControl.
protected  int getSubDialogControllerCount()
          Returns the number of currently embedded subdialogs.
protected  boolean hasSubDialogController(DialogInstanceId dialogInstanceId)
          Returns true, if the specified sub dialog is already embedded within this embedding feature instance.
protected  boolean hasSubDialogController(java.lang.String localName)
          Returns true, if the given local embedding name is already contained within this embedding feature instance.
protected  boolean hasSubDialogController(SubDialogControl subDialogControl)
          Returns true, if the specified sub dialog is already embedded within this embedding feature instance.
protected  java.util.Iterator iterateSubDialogControllers()
          Iterates the AbstractControllerFeature.SubDialogController of all embedded sub dialogs.
protected  void onChildActivated(java.lang.String localName, SubDialogControl subDialogControl)
          Called whenever a child was activated.
protected  void onChildAdded(java.lang.String localName, SubDialogControl subDialogControl)
          Called whenever a child was added (before lifecycle methods will be called).
protected  void onChildDeactivated(java.lang.String localName, SubDialogControl subDialogControl)
          Called whenever a child was deactivated.
protected  void onChildRemoved(java.lang.String localName, SubDialogControl subDialogControl)
          Called whenever a child was removed.
protected  void prepare()
          Called when the dialog is prepared.
protected  void removeSubDialogController(java.lang.String localName)
          Removes a previously embedded sub dialog specified by its local name.
protected  void removeSubDialogController(SubDialogControl subDialogControl)
          Removes a previously embedded sub dialog specified by its DialogInstanceId.
protected  boolean requestActivate()
          Requests this dialog node to become active itself.
protected  boolean requestDeactivate()
          Requests this dialog node to become deactived itself.
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
attachDialogControl, dispose, disposeFeature, getDialogControl, init, isInitialized, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractControllerFeature

public AbstractControllerFeature(java.lang.String serviceRegistrationContext)
Creates a new AbstractControllerFeature.

Parameters:
serviceRegistrationContext - a service registration context to use
Method Detail

prepare

protected final 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
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#prepare()

activate

protected final void activate()
Description copied from class: AbstractFeature
Called when the dialog is activated. Override this method if you want to perform some action on LifeCycle.activate().

The default implementation in AbstractFeature does nothing.

Overrides:
activate in class AbstractFeature
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#activate()

deactivate

protected final void deactivate()
Description copied from class: AbstractFeature
Called when the dialog is deactivated. Override this method if you want to perform some action on LifeCycle.deactivate()().

The default implementation in AbstractFeature does nothing.

Overrides:
deactivate in class AbstractFeature
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#deactivate()

getLifeCycleState

protected LifeCycleState getLifeCycleState()
Returns the LifeCycleState of the feature (e.g. the same than AbstractFeature.getDialogControl().getLifeCycleState()).

Returns:

getSubDialogControllerCount

protected int getSubDialogControllerCount()
Returns the number of currently embedded subdialogs.


hasSubDialogController

protected boolean hasSubDialogController(java.lang.String localName)
Returns true, if the given local embedding name is already contained within this embedding feature instance.

Parameters:
localName - the local embedding name

hasSubDialogController

protected boolean hasSubDialogController(SubDialogControl subDialogControl)
Returns true, if the specified sub dialog is already embedded within this embedding feature instance.

Parameters:
subDialogControl - the SubDialogControl specifying the sub dialog

hasSubDialogController

protected boolean hasSubDialogController(DialogInstanceId dialogInstanceId)
Returns true, if the specified sub dialog is already embedded within this embedding feature instance.


getSubDialogController

protected AbstractControllerFeature.SubDialogController getSubDialogController(java.lang.String localName)
Returns the AbstractControllerFeature.SubDialogController for the embedded subdialog specified via the given local embedding name.

Parameters:
localName - the local name of the embedded AbstractControllerFeature.SubDialogController to return
Throws:
java.lang.IllegalArgumentException - if the local name is null or no sub dialog was embedded

getSubDialogController

protected AbstractControllerFeature.SubDialogController getSubDialogController(SubDialogControl subDialogControl)
Returns the AbstractControllerFeature.SubDialogController for the embedded sub dialog specified via the given SubDialogControl.

Parameters:
subDialogControl - the SubDialogControl for the embedded dialog to return.
Throws:
java.lang.IllegalArgumentException - if the SubDialogControl is null or no sub dialog was embedded

getSubDialogController

protected AbstractControllerFeature.SubDialogController getSubDialogController(DialogInstanceId dialogInstanceId)
Returns the AbstractControllerFeature.SubDialogController for the embedded sub dialog specified via the given SubDialogControl.

Parameters:
dialogInstanceId - the DialogInstanceId for the embedded dialog to return.
Throws:
java.lang.IllegalArgumentException - if the SubDialogControl is null or no sub dialog was embedded

addSubDialogController

protected AbstractControllerFeature.SubDialogController addSubDialogController(java.lang.String localName,
                                                                               SubDialogControl subDialogControl)
Adds the given SubDialogControl to this embedding feature using the given local name.

Parameters:
localName - the local embedding name
subDialogControl - the SubDialogControl to embed
Returns:
a AbstractControllerFeature.SubDialogController that allows control over the embedded sub dialog. This AbstractControllerFeature.SubDialogController should never be visible outside the subclass

removeSubDialogController

protected void removeSubDialogController(java.lang.String localName)
Removes a previously embedded sub dialog specified by its local name.

Parameters:
localName - the local name the sub dialog was embedded under

removeSubDialogController

protected void removeSubDialogController(SubDialogControl subDialogControl)
Removes a previously embedded sub dialog specified by its DialogInstanceId.

Parameters:
subDialogControl - the SubDialogControl for the embedded dialog

iterateSubDialogControllers

protected java.util.Iterator iterateSubDialogControllers()
Iterates the AbstractControllerFeature.SubDialogController of all embedded sub dialogs.

Returns:
an Iterator iterating over all embedded SubDialogControllers.

requestActivate

protected boolean requestActivate()
Requests this dialog node to become active itself.

Returns:
true if the request is (or shortly will be) granted, false otherwise

requestDeactivate

protected boolean requestDeactivate()
Requests this dialog node to become deactived itself.

Returns:
true if the request is (or shortly will be) granted, false otherwise

onChildAdded

protected void onChildAdded(java.lang.String localName,
                            SubDialogControl subDialogControl)
Called whenever a child was added (before lifecycle methods will be called).

Parameters:
localName - the local name of the child dialog
subDialogControl - the SubDialogControl of the child dialog

onChildRemoved

protected void onChildRemoved(java.lang.String localName,
                              SubDialogControl subDialogControl)
Called whenever a child was removed.

Parameters:
localName - the local name of the child dialog
subDialogControl - the SubDialogControl of the child dialog

onChildActivated

protected void onChildActivated(java.lang.String localName,
                                SubDialogControl subDialogControl)
Called whenever a child was activated.

Parameters:
localName - the local name of the child dialog
subDialogControl - the SubDialogControl of the child dialog

onChildDeactivated

protected void onChildDeactivated(java.lang.String localName,
                                  SubDialogControl subDialogControl)
Called whenever a child was deactivated.

Parameters:
localName - the local name of the child dialog
subDialogControl - the SubDialogControl of the child dialog

collectSystemInfo

public void collectSystemInfo(SystemInfoNode root,
                              SystemInfoOptions options)
Description copied from class: AbstractFeature
Builds the system information tree upon local information of the implementor. The system information tree can be used within development by inspecting the system; so implementors should append their internal state (depending on the details settings within SystemInfoOptions). The information can be appended to the tree by adding new child SystemInformationNodes to the root node given using the SystemInfoNode.createChild(String) method and by setting information attributes the these nodes or the given root node. Subclasses should overwrite this method to append system informations

Specified by:
collectSystemInfo in interface SystemInfoProvider
Overrides:
collectSystemInfo in class AbstractFeature
See Also:
AbstractFeature.collectSystemInfo(com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)