com.sdm.quasar.client.core.dialogbase.services
Interface ActivationObjectionService

All Superinterfaces:
Service
All Known Implementing Classes:
ActivationObjectionFeature

public interface ActivationObjectionService
extends Service

Allows a dialog to register itself when it might want to object against deactivation.

Note that despite an objection a dialog may still be deactivated.

This service should be offered by all top level dialogs (e.g. windows) and intermediate dialogs that offer some kind of dialog switching (e.g. a tab pane).

Implementations must take care that no memory leak occours even if not all dialogs unregister.

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

Nested Class Summary
static interface ActivationObjectionService.DeactivationObjectionCallback
          Callback used by ActivationObjectionService.
 
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.
 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.
 

Method Detail

canDeactivate

public 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.

Parameters:
diid - the instance id of the dialog that should be deactivated
Returns:
true iff no registered callback has objected

registerObjectionCallback

public void registerObjectionCallback(DialogInstanceId diid,
                                      ActivationObjectionService.DeactivationObjectionCallback callback)
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.

Parameters:
diid - the id of the dialog instance that is concerned
callback - the callback object to be questioned

unregisterObjectionCallback

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

Parameters:
diid - the id of the dialog instance that is concerned
callback - the callback object to be removed