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

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

public class ActivationObjectionFeature
extends AbstractFeature
implements ActivationObjectionService

Offers a default implementation of the ActivationObjectionService to a dialog.

To use the feature, a DialogHierarchyService has to be installed (which is a system core service).

Version:
1.0
Author:
Thomas Wolf, sd&m AG, Bernd Olleck, sd&m AG, Martin Haft, sd&m AG

Nested Class Summary
 
Nested classes inherited from class com.sdm.quasar.client.core.dialogbase.services.ActivationObjectionService
ActivationObjectionService.DeactivationObjectionCallback
 
Constructor Summary
ActivationObjectionFeature()
           
 
Method Summary
 boolean canDeactivate(DialogInstanceId diid)
          Queries the registered objection callbacks that are concerned with a deactivation of the given diid to see if any object to deactivation.
protected  void dispose()
          Called when the feature or dialog is disposed.
protected  DialogHierarchyService getDialogHierarchyService()
          Returns the DialogHierarchyService to be used.
protected  void init()
          Called when the feature is initializing.
 void registerObjectionCallback(DialogInstanceId diid, ActivationObjectionService.DeactivationObjectionCallback callback)
          Registers a callback that is questioned before the dialog will be deactivated or released.
 void unregisterObjectionCallback(DialogInstanceId diid, ActivationObjectionService.DeactivationObjectionCallback callback)
          Unregisters a callback object.
 
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

ActivationObjectionFeature

public ActivationObjectionFeature()
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:
com.sdm.quasar.client.core.dialog.features.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()

registerObjectionCallback

public void registerObjectionCallback(DialogInstanceId diid,
                                      ActivationObjectionService.DeactivationObjectionCallback callback)
Description copied from interface: ActivationObjectionService
Registers a callback that is questioned before the dialog will be deactivated or released.

Note that a dialog should unregister the callback when it is released.

Specified by:
registerObjectionCallback in interface ActivationObjectionService
Parameters:
diid - the id of the dialog instance that is concerned
callback - the callback object to be questioned
See Also:
ActivationObjectionService.registerObjectionCallback(com.sdm.quasar.client.core.dialog.DialogInstanceId, com.sdm.quasar.client.core.dialogbase.services.ActivationObjectionService.DeactivationObjectionCallback)

unregisterObjectionCallback

public void unregisterObjectionCallback(DialogInstanceId diid,
                                        ActivationObjectionService.DeactivationObjectionCallback callback)
Description copied from interface: ActivationObjectionService
Unregisters a callback object. If the callback object is not registered for the given dialog instance id nothing happens.

Specified by:
unregisterObjectionCallback in interface ActivationObjectionService
Parameters:
diid - the id of the dialog instance that is concerned
callback - the callback object to be removed
See Also:
ActivationObjectionService.unregisterObjectionCallback(com.sdm.quasar.client.core.dialog.DialogInstanceId, com.sdm.quasar.client.core.dialogbase.services.ActivationObjectionService.DeactivationObjectionCallback)

canDeactivate

public boolean canDeactivate(DialogInstanceId diid)
Description copied from interface: ActivationObjectionService
Queries the registered objection callbacks that are concerned with a deactivation of the given diid to see if any object to deactivation.

Specified by:
canDeactivate in interface ActivationObjectionService
Parameters:
diid - the instance id of the dialog that should be deactivated
Returns:
true iff no registered callback has objected
See Also:
ActivationObjectionService.canDeactivate(com.sdm.quasar.client.core.dialog.DialogInstanceId)

getDialogHierarchyService

protected DialogHierarchyService getDialogHierarchyService()
Returns the DialogHierarchyService to be used.