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

All Superinterfaces:
Service
All Known Implementing Classes:
CloseObjectionFeature

public interface CloseObjectionService
extends Service

Allows a dialog to register itself when it might want to object against closing (disposing).

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

This service should be offered by all top level dialogs (e.g. windows) and intermediate dialogs that offer closing of elements (e.g. MDI dialogs).

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 CloseObjectionService.CloseObjectionCallback
          Callback used by CloseObjectionService.
 
Method Summary
 boolean canClose(DialogInstanceId diid)
          Queries the registered objection callbacks that are concerned with closing the dialog with the given diid.
 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.
 

Method Detail

canClose

public boolean canClose(DialogInstanceId diid)
Queries the registered objection callbacks that are concerned with closing the dialog with the given diid.

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

registerObjectionCallback

public void registerObjectionCallback(DialogInstanceId diid,
                                      CloseObjectionService.CloseObjectionCallback callback)
Registers a callback that is questioned before the dialog will be closed.

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,
                                        CloseObjectionService.CloseObjectionCallback 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