org.springframework.richclient.dialog
Class TitledWidgetApplicationDialog

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.dialog.ApplicationDialog
          extended by org.springframework.richclient.dialog.TitledWidgetApplicationDialog
All Implemented Interfaces:
PropertyChangePublisher, DescriptionConfigurable, Guarded, TitleConfigurable, Messagable

public class TitledWidgetApplicationDialog
extends ApplicationDialog
implements DescriptionConfigurable, Messagable

Allows to create an applicationDialog in which a given widget can be shown

Don't forget to set the parent component if the parent isn't the application window


Field Summary
static String CANCEL_COMMAND_ID
          Default Id for cancel command.
static int CANCEL_MODE
          Cancel-mode: Cancel button.
static String EXIT_COMMAND_ID
          Default Id for exit command.
static String OK_COMMAND_ID
          Default Id for ok command.
static int OK_MODE
          Ok-mode: OK + Finish button.
static int SELECT_CANCEL_MODE
          Select-mode: Select + Cancel button.
static String SELECT_COMMAND_ID
          Default Id for select command.
static String SELECT_NONE_COMMAND_ID
          Default Id for select command.
 
Fields inherited from class org.springframework.richclient.dialog.ApplicationDialog
DEFAULT_CANCEL_COMMAND_ID, DEFAULT_FINISH_COMMAND_ID, DEFAULT_FINISH_SUCCESS_MESSAGE_KEY, DEFAULT_FINISH_SUCCESS_TITLE_KEY, logger, SUCCESS_FINISH_MESSAGE_KEY, SUCCESS_FINISH_TITLE_KEY
 
Fields inherited from interface org.springframework.richclient.dialog.Messagable
MESSAGE_PROPERTY
 
Constructor Summary
TitledWidgetApplicationDialog(Widget widget)
          Create dialog with only OK button
TitledWidgetApplicationDialog(Widget widget, int mode)
          Create dialog in specified mode
TitledWidgetApplicationDialog(Widget widget, int mode, String finishId, String cancelId)
          Creation of dialog with full configuration
 
Method Summary
protected  void addDialogComponents()
          Subclasses may override to customize how this dialog is built.
 void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Register a listener to all properties of this publisher.
 void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
          Register a listener to a specific property.
protected  JComponent createButtonBar()
          Return a standardized row of command buttons, right-justified and all of the same size, with OK as the default button, and no mnemonics used, as per the Java Look and Feel guidelines.
protected  JComponent createDialogContentPane()
          Return the GUI which allows the user to manipulate the business objects related to this dialog.
protected  String getCancelCommandId()
          Returns the id for the cancel command.
protected  Object[] getCommandGroupMembers()
          Template getter method to return the commands to populate the dialog button bar.
protected  String getFinishCommandId()
          Subclasses may override to return a custom message key, default is "okCommand", corresponding to the "&OK" label.
protected  ActionCommand getSelectNoneCommand()
           
 Widget getWidget()
           
protected  void onAboutToShow()
          Template lifecycle method invoked right before the dialog is to become visible.
protected  boolean onFinish()
          Request invocation of the action taken when the user hits the OK (finish) button.
protected  boolean onSelectNone()
          Hook called upon executing the select none command.
protected  void onWindowClosing()
          Template lifecycle method invoked when the dialog's window is closing.
 void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Remove the listener from all properties of this publisher.
 void removePropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
          Remove the listener from a specific property.
 void setCaption(String shortDescription)
          
 void setDescription(String longDescription)
          
 void setMessage(Message message)
          Set the message.
 void setTitle(String title)
          Sets the title.
 
Methods inherited from class org.springframework.richclient.dialog.ApplicationDialog
addActionKeyBinding, addActionKeyBinding, attachListeners, componentsChanged, createDialog, dispose, disposeDialogContentPane, getActionMap, getCallingCommand, getCancelCommand, getDialog, getDialogContentPane, getDisplayFinishSuccessMessage, getFinishCommand, getFinishSecurityControllerId, getFinishSuccessMessage, getFinishSuccessMessageArguments, getFinishSuccessTitle, getFinishSuccessTitleArguments, getInputMap, getLocation, getLocationRelativeTo, getParentComponent, getParentWindow, getPreferredSize, getTitle, getWindowForComponent, hide, init, isControlCreated, isEnabled, isShowing, onCancel, onInitialized, onWindowActivated, onWindowGainedFocus, onWindowLostFocus, registerCancelCommandAsDefault, registerDefaultCommand, registerDefaultCommand, setCallingCommand, setCloseAction, setDefaultEnabled, setDisplayFinishSuccessMessage, setEnabled, setFinishEnabled, setLocation, setLocationRelativeTo, setModal, setParentComponent, setPreferredSize, setResizable, showDialog, showFinishSuccessMessageDialog
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK_COMMAND_ID

public static final String OK_COMMAND_ID
Default Id for ok command.

See Also:
Constant Field Values

CANCEL_COMMAND_ID

public static final String CANCEL_COMMAND_ID
Default Id for cancel command.

See Also:
Constant Field Values

EXIT_COMMAND_ID

public static final String EXIT_COMMAND_ID
Default Id for exit command.

See Also:
Constant Field Values

SELECT_COMMAND_ID

public static final String SELECT_COMMAND_ID
Default Id for select command.

See Also:
Constant Field Values

SELECT_NONE_COMMAND_ID

public static final String SELECT_NONE_COMMAND_ID
Default Id for select command.

See Also:
Constant Field Values

OK_MODE

public static final int OK_MODE
Ok-mode: OK + Finish button.

See Also:
Constant Field Values

CANCEL_MODE

public static final int CANCEL_MODE
Cancel-mode: Cancel button.

See Also:
Constant Field Values

SELECT_CANCEL_MODE

public static final int SELECT_CANCEL_MODE
Select-mode: Select + Cancel button.

See Also:
Constant Field Values
Constructor Detail

TitledWidgetApplicationDialog

public TitledWidgetApplicationDialog(Widget widget)
Create dialog with only OK button

Parameters:
widget - The widget to show in the dialog

TitledWidgetApplicationDialog

public TitledWidgetApplicationDialog(Widget widget,
                                     int mode)
Create dialog in specified mode

Parameters:
widget - The widget to show in the dialog
mode - The mode of the dialog: OK_MODE, CANCEL_MODE of SELECT_CANCEL_MODE.

TitledWidgetApplicationDialog

public TitledWidgetApplicationDialog(Widget widget,
                                     int mode,
                                     String finishId,
                                     String cancelId)
Creation of dialog with full configuration

Parameters:
widget - The widget to show in the dialog
mode - The mode of the dialog: OK_MODE, CANCEL_MODE of SELECT_CANCEL_MODE.
finishId - specific id for the finish command
cancelId - specific id for the cancel command.
Method Detail

getWidget

public Widget getWidget()

createButtonBar

protected JComponent createButtonBar()
Description copied from class: ApplicationDialog
Return a standardized row of command buttons, right-justified and all of the same size, with OK as the default button, and no mnemonics used, as per the Java Look and Feel guidelines.

Overrides:
createButtonBar in class ApplicationDialog

getCommandGroupMembers

protected Object[] getCommandGroupMembers()
Description copied from class: ApplicationDialog
Template getter method to return the commands to populate the dialog button bar.

Overrides:
getCommandGroupMembers in class ApplicationDialog
Returns:
The array of commands (may also be a separator or glue identifier)

getSelectNoneCommand

protected ActionCommand getSelectNoneCommand()

addDialogComponents

protected void addDialogComponents()
Description copied from class: ApplicationDialog
Subclasses may override to customize how this dialog is built.

Overrides:
addDialogComponents in class ApplicationDialog

onAboutToShow

protected void onAboutToShow()
Description copied from class: ApplicationDialog
Template lifecycle method invoked right before the dialog is to become visible.

Overrides:
onAboutToShow in class ApplicationDialog

onWindowClosing

protected void onWindowClosing()
Description copied from class: ApplicationDialog
Template lifecycle method invoked when the dialog's window is closing.

Overrides:
onWindowClosing in class ApplicationDialog

onFinish

protected boolean onFinish()
Description copied from class: ApplicationDialog
Request invocation of the action taken when the user hits the OK (finish) button.

Specified by:
onFinish in class ApplicationDialog
Returns:
true if action completed successfully; false otherwise.

onSelectNone

protected boolean onSelectNone()
Hook called upon executing the select none command. This should normally de-select anything and execute the finish behaviour.

Returns:

createDialogContentPane

protected JComponent createDialogContentPane()
Return the GUI which allows the user to manipulate the business objects related to this dialog. This GUI will be placed above the OK and Cancel buttons, in a standard manner.

Any components/objects created at this point need to be disposed in ApplicationDialog.disposeDialogContentPane().

Specified by:
createDialogContentPane in class ApplicationDialog
See Also:
ApplicationDialog.disposeDialogContentPane()

setTitle

public void setTitle(String title)
Sets the title.

Specified by:
setTitle in interface TitleConfigurable
Overrides:
setTitle in class ApplicationDialog
Parameters:
title - the title

getFinishCommandId

protected String getFinishCommandId()
Subclasses may override to return a custom message key, default is "okCommand", corresponding to the "&OK" label.

Overrides:
getFinishCommandId in class ApplicationDialog
Returns:
The message key to use for the finish ("ok") button

getCancelCommandId

protected String getCancelCommandId()
Returns the id for the cancel command.

Overrides:
getCancelCommandId in class ApplicationDialog

setCaption

public void setCaption(String shortDescription)

Specified by:
setCaption in interface DescriptionConfigurable

setDescription

public void setDescription(String longDescription)

Specified by:
setDescription in interface DescriptionConfigurable

setMessage

public void setMessage(Message message)
Set the message.

Specified by:
setMessage in interface Messagable

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Register a listener to all properties of this publisher.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyChangeListener - the PropertyChangeListener to register.

addPropertyChangeListener

public void addPropertyChangeListener(String property,
                                      PropertyChangeListener propertyChangeListener)
Register a listener to a specific property.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
property - the property to monitor.
propertyChangeListener - the PropertyChangeListener to register.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Remove the listener from all properties of this publisher.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyChangeListener - the PropertyChangeListener to remove.

removePropertyChangeListener

public void removePropertyChangeListener(String property,
                                         PropertyChangeListener propertyChangeListener)
Remove the listener from a specific property.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
property - the property that was being monitored.
propertyChangeListener - the PropertyChangeListener to remove.


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.