com.sdm.quasar.client.core.dialog.lifecycle
Interface LifeCycleControl

All Known Subinterfaces:
DialogControl
All Known Implementing Classes:
DefaultDialogControl, DefaultDialogInstance

public interface LifeCycleControl

Allows implementors of LifeCycle to attach to the lifecycle of the dialog.

The functionality of LifeCycleControl is an integral part of DialogControl. Every DialogControl is (per inheritence) a LifeCycleControl!

Note: Order on registration is important! The lifecycle transition notifications of LifeCycle are called

Note: If a LifeCycle is attached (using attachToLifeCycle(LifeCycle), all required notifications of the lifecycle will be made immediately when attached! So if the lifecycle is LifeCycleState.ACTIVE, the attached LifeCycle's prepare() and activate() methods will be called (in that order).

Note: A special case occures when attaching (or detaching) a LifeCycle while currently in a lifecycle-notification (which is allowed and happens often): The newly registered LifeCycle will be threated as registered before the current notified LifeCycle (in foreward notifications; in a usual case it is attached within the LifeCycle's notification method)! So the newly attached LifeCycle has the expected state for the user.

Version:
1.0
Author:
Thomas Wolf
See Also:
LifeCycle, LifeCycleState

Method Summary
 void attachToLifeCycle(LifeCycle lifeCycle)
          Attaches a component that is interested in the life cycle of this dialog to the notification chain.
 void detachFromLifeCycle(LifeCycle lifeCycle)
          Detaches a component from the life cycle notification.
 

Method Detail

attachToLifeCycle

public void attachToLifeCycle(LifeCycle lifeCycle)
Attaches a component that is interested in the life cycle of this dialog to the notification chain. All registered LifeCycle implementations will be notified of lifecycle changes in the order they have been registered for calls to LifeCycle.prepare() and LifeCycle.activate() and in reverse order for LifeCycle.deactivate() and LifeCycle.release().

Parameters:
lifeCycle - the life cycle to be notified

detachFromLifeCycle

public void detachFromLifeCycle(LifeCycle lifeCycle)
Detaches a component from the life cycle notification.

Parameters:
lifeCycle - the life cycle that should not be notified any more