com.sdm.quasar.client.swing.dialogbase.features
Class OptionDialogServiceFeature

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

public class OptionDialogServiceFeature
extends AbstractFeature
implements OptionDialogService

Default implementation of the OptionDialogService that uses a Component as a parent for the modal dialogs.

Version:
1.0
Author:
Bernd Olleck, sd&m AG

Field Summary
 
Fields inherited from interface com.sdm.quasar.client.swing.dialogbase.services.OptionDialogService
CANCEL_OPTION, CLOSED_OPTION, DEFAULT_OPTION, ERROR_MESSAGE, INFORMATION_MESSAGE, NO_OPTION, OK_CANCEL_OPTION, OK_OPTION, PLAIN_MESSAGE, QUESTION_MESSAGE, UNINITIALIZED_VALUE, WARNING_MESSAGE, YES_NO_CANCEL_OPTION, YES_NO_OPTION, YES_OPTION
 
Constructor Summary
OptionDialogServiceFeature()
          Creates an instance that tries to find any suitable frame shown.
OptionDialogServiceFeature(java.awt.Component component)
          Creates an instance that uses a component as a parent for the option dialogs.
 
Method Summary
protected  void dispose()
          Called when the feature or dialog is disposed.
protected  java.awt.Component getParentComponent()
           
protected  void init()
          Called when the feature is initializing.
protected  void prepare()
          Called when the dialog is prepared.
protected  void release()
          Called when the dialog is released.
 int showConfirmDialog(java.lang.Object message)
           
 int showConfirmDialog(java.lang.Object message, java.lang.String title, int optionType)
           
 int showConfirmDialog(java.lang.Object message, java.lang.String title, int optionType, int messageType)
           
 int showConfirmDialog(java.lang.Object message, java.lang.String title, int optionType, int messageType, javax.swing.Icon icon)
           
 java.lang.String showInputDialog(java.lang.Object message)
           
 java.lang.String showInputDialog(java.lang.Object message, java.lang.Object initialSelectionValue)
           
 java.lang.String showInputDialog(java.lang.Object message, java.lang.String title, int messageType)
           
 java.lang.Object showInputDialog(java.lang.Object message, java.lang.String title, int messageType, javax.swing.Icon icon, java.lang.Object[] selectionValues, java.lang.Object initialSelectionValue)
           
 void showMessageDialog(java.lang.Object message)
           
 void showMessageDialog(java.lang.Object message, java.lang.String title, int messageType)
           
 void showMessageDialog(java.lang.Object message, java.lang.String title, int messageType, javax.swing.Icon icon)
           
 int showOptionDialog(java.lang.Object message, java.lang.String title, int optionType, int messageType, javax.swing.Icon icon, java.lang.Object[] options, java.lang.Object initialValue)
           
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionDialogServiceFeature

public OptionDialogServiceFeature()
Creates an instance that tries to find any suitable frame shown. This constructor is useful for registration at session level so that there is at least one OptionDialogService available. But since it might not use the correct parent window it is better if all windows and portals register an instance with themselves as parent.


OptionDialogServiceFeature

public OptionDialogServiceFeature(java.awt.Component component)
Creates an instance that uses a component as a parent for the option dialogs. This constructor is useful for portal windows.

Parameters:
component - the parent component
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()

prepare

protected void prepare()
Description copied from class: AbstractFeature
Called when the dialog is prepared. Override this method if you want to perform some action on LifeCycle.prepare(), e.g. gain resource and provide services for childs.

The default implementation in AbstractFeature does nothing.

Overrides:
prepare in class AbstractFeature
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#prepare()

release

protected void release()
Description copied from class: AbstractFeature
Called when the dialog is released. Override this method if you want to perform some action on LifeCycle.release()(), e.g. unregister services.

The default implementation in AbstractFeature does nothing.

Overrides:
release in class AbstractFeature
See Also:
com.sdm.quasar.client.core.dialog.features.AbstractFeature#release()

getParentComponent

protected java.awt.Component getParentComponent()
Returns:
#parentComponent if not null or tries to find one, may return null

showConfirmDialog

public int showConfirmDialog(java.lang.Object message)
Specified by:
showConfirmDialog in interface OptionDialogService
See Also:
JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object)

showConfirmDialog

public int showConfirmDialog(java.lang.Object message,
                             java.lang.String title,
                             int optionType)
Specified by:
showConfirmDialog in interface OptionDialogService
See Also:
JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

showConfirmDialog

public int showConfirmDialog(java.lang.Object message,
                             java.lang.String title,
                             int optionType,
                             int messageType)
Specified by:
showConfirmDialog in interface OptionDialogService
See Also:
JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int)

showConfirmDialog

public int showConfirmDialog(java.lang.Object message,
                             java.lang.String title,
                             int optionType,
                             int messageType,
                             javax.swing.Icon icon)
Specified by:
showConfirmDialog in interface OptionDialogService
See Also:
JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon)

showInputDialog

public java.lang.String showInputDialog(java.lang.Object message)
Specified by:
showInputDialog in interface OptionDialogService
See Also:
JOptionPane.showInputDialog(java.awt.Component, java.lang.Object)

showInputDialog

public java.lang.String showInputDialog(java.lang.Object message,
                                        java.lang.Object initialSelectionValue)
Specified by:
showInputDialog in interface OptionDialogService
See Also:
JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.Object)

showInputDialog

public java.lang.String showInputDialog(java.lang.Object message,
                                        java.lang.String title,
                                        int messageType)
Specified by:
showInputDialog in interface OptionDialogService
See Also:
JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

showInputDialog

public java.lang.Object showInputDialog(java.lang.Object message,
                                        java.lang.String title,
                                        int messageType,
                                        javax.swing.Icon icon,
                                        java.lang.Object[] selectionValues,
                                        java.lang.Object initialSelectionValue)
Specified by:
showInputDialog in interface OptionDialogService
See Also:
JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

showMessageDialog

public void showMessageDialog(java.lang.Object message)
Specified by:
showMessageDialog in interface OptionDialogService
See Also:
JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object)

showMessageDialog

public void showMessageDialog(java.lang.Object message,
                              java.lang.String title,
                              int messageType)
Specified by:
showMessageDialog in interface OptionDialogService
See Also:
JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

showMessageDialog

public void showMessageDialog(java.lang.Object message,
                              java.lang.String title,
                              int messageType,
                              javax.swing.Icon icon)
Specified by:
showMessageDialog in interface OptionDialogService
See Also:
JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon)

showOptionDialog

public int showOptionDialog(java.lang.Object message,
                            java.lang.String title,
                            int optionType,
                            int messageType,
                            javax.swing.Icon icon,
                            java.lang.Object[] options,
                            java.lang.Object initialValue)
Specified by:
showOptionDialog in interface OptionDialogService
See Also:
JOptionPane.showOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)