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

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

public class CloseObjectionFeature
extends AbstractFeature
implements CloseObjectionService

Offers a default implementation of the CloseObjectionService 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.CloseObjectionService
CloseObjectionService.CloseObjectionCallback
 
Constructor Summary
CloseObjectionFeature()
           
 
Method Summary
 boolean canClose(DialogInstanceId diid)
          Queries the registered objection callbacks that are concerned with closing the dialog with the given diid.
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, CloseObjectionService.CloseObjectionCallback callback)
          Registers a callback that is questioned before the dialog will be closed.
 void unregisterObjectionCallback(DialogInstanceId diid, CloseObjectionService.CloseObjectionCallback 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

CloseObjectionFeature

public CloseObjectionFeature()
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,
                                      CloseObjectionService.CloseObjectionCallback callback)
Description copied from interface: CloseObjectionService
Registers a callback that is questioned before the dialog will be closed.

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

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

unregisterObjectionCallback

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

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

canClose

public boolean canClose(DialogInstanceId diid)
Description copied from interface: CloseObjectionService
Queries the registered objection callbacks that are concerned with closing the dialog with the given diid.

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

getDialogHierarchyService

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