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

All Superinterfaces:
Disposable

public interface LifeCycle
extends Disposable

Represents the life cycle within a dialog. If you want to implement a dialog that conforms to the life cycle defined here you should implement LifeCycle and register the implementation with the com.sdm.quasar.client.comp.dlgdef.lifecyclectrl.DialogControl.

Note: This is a life cycle interface and thus the methods should never be called directly. Use the com.sdm.quasar.client.comp.dlgdef.lifecyclectrl.SubDialogControl instead that you have obtained when creating a sub dialog using com.sdm.quasar.client.comp.dlgdef.lifecyclectrl.DialogControl.

The dialog is in one of the following states:

It reacts to the following life cycle transitions, while executing a lifecycle transition, the dialog is in a transition state as stated as follos: Note that Disposable.dispose() may be called in any state and the implementation is expected to behave correctly.

Version:
1.0
Author:
Bernd Olleck, sd&m AG

Method Summary
 void activate()
          Transition from state LifeCycleState.PREPARED to state LifeCycleState.ACTIVE.
 void deactivate()
          Transition from state LifeCycleState.ACTIVE to state LifeCycleState.PREPARED.
 void prepare()
          Transition from state LifeCycleState.CREATED to state LifeCycleState.PREPARED.
 void release()
          Transition from state LifeCycleState.PREPARED to LifeCycleState.CREATED.
 
Methods inherited from interface com.sdm.quasar.client.core.common.Disposable
dispose
 

Method Detail

prepare

public void prepare()
Transition from state LifeCycleState.CREATED to state LifeCycleState.PREPARED. While executed, the state is LifeCycleState.PREPARING.

The implementation should allocate temporary resources and initialize the dialog's visual representation. Services offered to children should be registered. It relies on the parent dialog to be prepared!


activate

public void activate()
Transition from state LifeCycleState.PREPARED to state LifeCycleState.ACTIVE. While executed, the state is LifeCycleState.ACTIVATING.

The implementation should activate its visual representation (e.g. allow ui events, start animation, show the window if the dialog owns a window). It relies on the parent dialog to be activated!


deactivate

public void deactivate()
Transition from state LifeCycleState.ACTIVE to state LifeCycleState.PREPARED. While executed, the state is LifeCycleState.DEACTIVATING.

The implementation should deactivate its visual representation (e.g. disable ui events, stop animation, hide the window if the dialog owns a window).

Note that the call to this method is not negotiable. If you want to allow for user interaction before a dialog is deactivated, you should use the ActivationObjectionService.


release

public void release()
Transition from state LifeCycleState.PREPARED to LifeCycleState.CREATED. While executed, the state is LifeCycleState.RELEASING.

The implementation should free temporary resources and may dispose of its visual representation. Any services offered should be withdrawn.

Note that the call to this method is not negotiable.