com.sdm.quasar.client.core.dialog.impl
Class DefaultSubDialogControl

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.impl.DefaultSubDialogControl
All Implemented Interfaces:
LifeCycleStateProvider, SubDialogControl, SubDialogServiceAccess, SystemInfoProvider

public class DefaultSubDialogControl
extends java.lang.Object
implements SubDialogControl, SystemInfoProvider

Default implementation of SubDialogControl.

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

Method Summary
 void collectSystemInfo(SystemInfoNode root, SystemInfoOptions options)
          Builds the system information tree upon local information of the implementor.
 SubDialogLifeCycleController createAndActivateSubDialogLifeCycleController()
          Creates a new SubDialogLifeCycleController and sets it as current one for this DialogControl.
 void disposeDialog()
          Disposes the dialog and its children, independently of the current state.
 DialogInstanceId getDialogInstanceId()
           
 LifeCycleState getLifeCycleState()
           
 ID getParentId()
           
 Service getService(java.lang.Class service)
          Returns the implementation of a desired service registered at the controlled dialog.
 boolean hasService(java.lang.Class service)
          Tests if a service is registered at the controlled dialog.
 void registerService(java.lang.Class service, Service implementation)
          Registers a service for this node.
 void registerService(java.lang.Class service, Service implementation, java.lang.String registrationContext)
          Registers a service for this node.
 void unregisterService(java.lang.Class service, Service implementation)
          Unregisters a service for this node.
 void unregisterServices(java.lang.String registrationContext)
          Unregisters all services registered with the same registration context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDialogInstanceId

public DialogInstanceId getDialogInstanceId()
Specified by:
getDialogInstanceId in interface SubDialogControl
Returns:
the instance id of the dialog that is controlled by this SubDialogControl.
See Also:
SubDialogControl.getDialogInstanceId()

getParentId

public ID getParentId()
Returns:
the id of the parent of this sub dialog.

getLifeCycleState

public LifeCycleState getLifeCycleState()
Specified by:
getLifeCycleState in interface LifeCycleStateProvider
Returns:
the life cycle state of this dialog
See Also:
LifeCycleStateProvider.getLifeCycleState()

disposeDialog

public void disposeDialog()
                   throws DisposeException
Description copied from interface: SubDialogControl
Disposes the dialog and its children, independently of the current state.

The call to this method is irrevokable. If you want to allow for user interaction or server calls before the dialog or its children are disposed, you should do so before calling this method.

Specified by:
disposeDialog in interface SubDialogControl
Throws:
DisposeException - if the dialog could not be disposed due to an error in the dialog implementation.
See Also:
SubDialogControl.disposeDialog()

createAndActivateSubDialogLifeCycleController

public SubDialogLifeCycleController createAndActivateSubDialogLifeCycleController()
Description copied from interface: SubDialogControl
Creates a new SubDialogLifeCycleController and sets it as current one for this DialogControl. The SubDialogLifeCycleController is used to control the lifecycle state (prepared, active...) of the controlled subdialog.

Note: A SubDialogControl has only a single active SubDialogLifeCycleController. This is the last one created by this method. So calling this method grabs the control of the child's lifecycles completely! Use with caution; normally calls to this method are made only by technical helper classes, that are managing the lifecycle states together with the visual representations to get them in sync.

Specified by:
createAndActivateSubDialogLifeCycleController in interface SubDialogControl
Returns:
the new created and activated SubDialogLifeCycleController.
See Also:
com.sdm.quasar.client.core.dialog.DialogControl#createAndActivateSubDialogLifeCycleController()

hasService

public boolean hasService(java.lang.Class service)
Description copied from interface: SubDialogServiceAccess
Tests if a service is registered at the controlled dialog. TODO: Wir müssen dokumentieren, welche Services man hier sieht (hierarchy, direct und FromParent)!

Specified by:
hasService in interface SubDialogServiceAccess
Parameters:
service - the class of the service interface that is searched for
Returns:
true, iff the service is available.
See Also:
SubDialogServiceAccess.hasService(java.lang.Class)

getService

public Service getService(java.lang.Class service)
Description copied from interface: SubDialogServiceAccess
Returns the implementation of a desired service registered at the controlled dialog. It is unimportend for this method, if the service was registered for hierarchical search or for direct access. The returned Object will implement the service interface. TODO: Wir müssen dokumentieren, welche Services man hier sieht (hierarchy, direct und FromParent)!

Specified by:
getService in interface SubDialogServiceAccess
Parameters:
service - the class of the service interface that is requested
Returns:
the object implementing the service that is registered at the specified node
See Also:
SubDialogServiceAccess.getService(java.lang.Class)

registerService

public void registerService(java.lang.Class service,
                            Service implementation,
                            java.lang.String registrationContext)
Description copied from interface: SubDialogServiceAccess
Registers a service for this node. The service class must be an interface that extend Service, and the implementation implement that interface.

If there is already an implementation registered for that service, that implementation is replaced by the passed as a parameter.

Please note that a a registered service should be unregistered when the life cycle of the provider ends.

Specified by:
registerService in interface SubDialogServiceAccess
Parameters:
service - the interface that defines the service
implementation - the implementation of the service
registrationContext - an optional registration context (may be null); may be used for easy unregistration of services to an context (see #unregisterServices(Object))
See Also:
SubDialogServiceAccess.registerService(java.lang.Class, com.sdm.quasar.client.core.common.services.Service, java.lang.String)

registerService

public void registerService(java.lang.Class service,
                            Service implementation)
Description copied from interface: SubDialogServiceAccess
Registers a service for this node. The service class must be an interface that extend Service, and the implementation implement that interface.

If there is already an implementation registered for that service, that implementation is replaced by the passed as a parameter.

Please note that a a registered service should be unregistered when the life cycle of the provider ends.

Specified by:
registerService in interface SubDialogServiceAccess
Parameters:
service - the interface that defines the service
implementation - the implementation of the service
See Also:
SubDialogServiceAccess.registerService(java.lang.Class, com.sdm.quasar.client.core.common.services.Service)

unregisterService

public void unregisterService(java.lang.Class service,
                              Service implementation)
Description copied from interface: SubDialogServiceAccess
Unregisters a service for this node.

If the service is not registered for this node or the given implementation is not the one that is registered, nothing happens.

Therefore, if a service implementation is replaced by another implementation, the unregistering of the first implementation is harmless since the second implementation will stay registered. However, if the second implementation is unregistered first, then no service will be available, even though the first service implementation hasn't been unregistered yet.

Specified by:
unregisterService in interface SubDialogServiceAccess
Parameters:
service - the interface that defines the service
implementation - the registered implementation of the service
See Also:
SubDialogServiceAccess.unregisterService(java.lang.Class, com.sdm.quasar.client.core.common.services.Service)

unregisterServices

public void unregisterServices(java.lang.String registrationContext)
Description copied from interface: SubDialogServiceAccess
Unregisters all services registered with the same registration context

Specified by:
unregisterServices in interface SubDialogServiceAccess
Parameters:
registrationContext - the registration context object that mark the services to unregister
See Also:
SubDialogServiceAccess.unregisterServices(java.lang.String)

collectSystemInfo

public void collectSystemInfo(SystemInfoNode root,
                              SystemInfoOptions options)
Description copied from interface: SystemInfoProvider
Builds the system information tree upon local information of the implementor. The system information tree can be used within development by inspecting the system; so implementors should append their internal state (depending on the details settings within SystemInfoOptions). The information can be appended to the tree by adding new child SystemInformationNodes to the root node given using the SystemInfoNode.createChild(String) method and by setting information attributes the these nodes or the given root node.

Specified by:
collectSystemInfo in interface SystemInfoProvider
Parameters:
root - the SystemInfoNode to add information to (guaranteed to be not null)
options - contains additional options, that might influence the amount of information added to the tree (guaranteed to be not null)
See Also:
SystemInfoProvider.collectSystemInfo(com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)