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

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.core.dialogbase.features.DialogCreationFeature
All Implemented Interfaces:
DialogCreationService, Feature, Service, SystemInfoProvider

public class DialogCreationFeature
extends AbstractFeature
implements DialogCreationService

The DialogCreationFeature may be used to create simple main dialogs i.e. subdialogs of the session, when the session has no own dielog. You can use it as well as example for creating subdialogs in own frames. For emdedded dialogs you need to use different ActivationController.

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
DialogCreationFeature()
          Creates a new DialogCreationFeature.
 
Method Summary
 boolean canCreateDialog(java.lang.String dialogId)
          Tests, whether the dialog with the given id can be created.
protected  SubDialogControl checkForSingleton(java.lang.String dialogId, java.lang.Object context, DeactivationCallback deactivationCallback)
          Checks if the requested dialog is a singleton dialog and if true serves the simngleton instance.
 DialogInstanceId createDialog(java.lang.String dialogId, java.lang.Object context)
          Creates a new independent dialog.
 DialogInstanceId createDialog(java.lang.String dialogId, java.lang.Object context, DeactivationCallback deactivationCallback)
          Creates a new independent dialog.
protected  SubDialogControl createDialogInternal(java.lang.String dialogId, java.lang.Object context, DeactivationCallback deactivationCallback)
           
protected  void dispose()
          Called when the feature or dialog is disposed.
protected  RootControllerFeature getRootControllerFeature()
           
protected  SubDialogControl getSingletonDialog(java.lang.String dialogId, java.lang.Object context, DeactivationCallback deactivationCallback)
          The method provides a singleton dialog: If the dialog is created once its singleton dialog instance will provided as long as it is not disposed.
protected  void init()
          Called when the feature is initializing.
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized, prepare, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogCreationFeature

public DialogCreationFeature()
Creates a new DialogCreationFeature.

Method Detail

init

protected void init()
Description copied from class: AbstractFeature
Called when the feature is initializing. This is normally done, when the feature is connected to the lifecycle of the DialogControl installed to. To access the DialogControl use the AbstractFeature.getDialogControl() method.

Override this method to perform some action on initialization e.g. register public services.

Specified by:
init in class AbstractFeature
See Also:
AbstractFeature.init()

dispose

protected void dispose()
                throws DisposeException
Description copied from class: AbstractFeature
Called when the feature or dialog is disposed. Override this method to clean up resources and free memory when disposing.

Specified by:
dispose in class AbstractFeature
Throws:
DisposeException
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#dispose()

getRootControllerFeature

protected RootControllerFeature getRootControllerFeature()

canCreateDialog

public boolean canCreateDialog(java.lang.String dialogId)
Description copied from interface: DialogCreationService
Tests, whether the dialog with the given id can be created.

Specified by:
canCreateDialog in interface DialogCreationService
Parameters:
dialogId - Id of the dialog to be created
Returns:
true, iff the dialog can be created
See Also:
DialogCreationService.canCreateDialog(java.lang.String)

createDialog

public DialogInstanceId createDialog(java.lang.String dialogId,
                                     java.lang.Object context)
Description copied from interface: DialogCreationService
Creates a new independent dialog. The parent of the dialog is the session.

Specified by:
createDialog in interface DialogCreationService
Parameters:
dialogId - Id of the dialog to be created
context - Context information for the new dialog (may be null)
Returns:
the dialog instance id of the new dialog
See Also:
DialogCreationService.createDialog(java.lang.String, java.lang.Object)

createDialog

public DialogInstanceId createDialog(java.lang.String dialogId,
                                     java.lang.Object context,
                                     DeactivationCallback deactivationCallback)
Description copied from interface: DialogCreationService
Creates a new independent dialog. The parent of the dialog is the session. A DeactivationCallback is registrated.

Specified by:
createDialog in interface DialogCreationService
Parameters:
dialogId - Id of the dialog to be created
context - Context information for the new dialog (may be null)
deactivationCallback - The callback will be noticed when the created dialog ist deactivated (may be null)
Returns:
the dialog instance id of the new dialog
See Also:
DialogCreationService.createDialog(java.lang.String, java.lang.Object, DeactivationCallback)

createDialogInternal

protected SubDialogControl createDialogInternal(java.lang.String dialogId,
                                                java.lang.Object context,
                                                DeactivationCallback deactivationCallback)
See Also:
DialogCreationService.createDialog(java.lang.String, java.lang.Object, DeactivationCallback)

checkForSingleton

protected SubDialogControl checkForSingleton(java.lang.String dialogId,
                                             java.lang.Object context,
                                             DeactivationCallback deactivationCallback)
Checks if the requested dialog is a singleton dialog and if true serves the simngleton instance.

Parameters:
dialogId - Id of the singleton dialog
context - Context information for the new dialog (may be null)
deactivationCallback - The callback will be noticed when the created dialog ist deactivated (may be null)
Returns:
the sub dialog control of the singleton dialog or null

getSingletonDialog

protected SubDialogControl getSingletonDialog(java.lang.String dialogId,
                                              java.lang.Object context,
                                              DeactivationCallback deactivationCallback)
The method provides a singleton dialog: If the dialog is created once its singleton dialog instance will provided as long as it is not disposed.

Parameters:
dialogId - Id of the singleton dialog
context - Context information for the new dialog (may be null)
deactivationCallback - The callback will be noticed when the created dialog ist deactivated (may be null)
Returns:
the sub dialog control of the singleton dialog