com.sdm.quasar.client.core.dialog.impl
Class DefaultSubDialogLifeCycleController

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.impl.DefaultSubDialogLifeCycleController
All Implemented Interfaces:
Disposable, LifeCycleStateProvider, SubDialogLifeCycleController

public class DefaultSubDialogLifeCycleController
extends java.lang.Object
implements SubDialogLifeCycleController, Disposable

A default implementation of SubDialogLifeCycleController. If this implementation is disposed, it is inactive for the user.

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
DefaultSubDialogLifeCycleController(DialogInstance dialogInstance)
          Creates a new DefaultSubDialogLifeCycleController.
 
Method Summary
 void activateDialog()
          Activates the child-dialog.
 void addDisposeCallback(DisposeCallback disposeCallback)
          Adds a DisposeCallback, that will be called, when the child dialog controlled was disposed.
 void deactivateDialog()
          Deactivates the child-dialog.
 void dispose()
          Disposes the component.
 LifeCycleState getLifeCycleState()
           
 void prepareDialog()
          Prepares the child-dialog.
 void releaseDialog()
          Releases the child-dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSubDialogLifeCycleController

public DefaultSubDialogLifeCycleController(DialogInstance dialogInstance)
Creates a new DefaultSubDialogLifeCycleController.

Method Detail

getLifeCycleState

public LifeCycleState getLifeCycleState()
Specified by:
getLifeCycleState in interface LifeCycleStateProvider
Returns:
the life cycle state of this dialog
See Also:
LifeCycleStateProvider.getLifeCycleState()

prepareDialog

public void prepareDialog()
Description copied from interface: SubDialogLifeCycleController
Prepares the child-dialog.

Precondition: The parent dialog must be at least preparing. The controlled subdialog must be created.

Specified by:
prepareDialog in interface SubDialogLifeCycleController
See Also:
SubDialogLifeCycleController.prepareDialog()

activateDialog

public void activateDialog()
Description copied from interface: SubDialogLifeCycleController
Activates the child-dialog.

Precondition: The parent dialog must be active or activating. The controlled subdialog must be prepeared.

Specified by:
activateDialog in interface SubDialogLifeCycleController
See Also:
SubDialogLifeCycleController.activateDialog()

deactivateDialog

public void deactivateDialog()
Description copied from interface: SubDialogLifeCycleController
Deactivates the child-dialog.

Precondition: The parent dialog must be active or deactivating. The controlled subdialog must be active

Specified by:
deactivateDialog in interface SubDialogLifeCycleController
See Also:
SubDialogLifeCycleController.deactivateDialog()

releaseDialog

public void releaseDialog()
Description copied from interface: SubDialogLifeCycleController
Releases the child-dialog.

Precondition: The parent dialog must be prepared or releasing. The controlled subdialog must be prepeared.

Specified by:
releaseDialog in interface SubDialogLifeCycleController
See Also:
SubDialogLifeCycleController.releaseDialog()

dispose

public final void dispose()
                   throws DisposeException
Description copied from interface: Disposable
Disposes the component.

Important:
This method is called by an administrating component and must never be called directly.

The implementation should release any resources or objects allocated and any services registered. Furthermore, this method should be developed carefully to free a maximum of resources even when the system may have become unstable. In case of one or multiple errors, you should collect them in a DisposeException, continue with the execution, and throw it at the end of the method.

Note: The implementation must not return before the component is disposed. Any threads or asynchronous calls started must be completed before this method returns.

Specified by:
dispose in interface Disposable
Throws:
DisposeException - if there was one or more errors while disposing the component.
See Also:
Disposable.dispose()

addDisposeCallback

public void addDisposeCallback(DisposeCallback disposeCallback)
Description copied from interface: SubDialogLifeCycleController
Adds a DisposeCallback, that will be called, when the child dialog controlled was disposed.

Specified by:
addDisposeCallback in interface SubDialogLifeCycleController
Parameters:
disposeCallback - the DisposeCallback to call back (not null)
See Also:
SubDialogLifeCycleController.addDisposeCallback(com.sdm.quasar.client.core.common.DisposeCallback)