org.springframework.richclient.dialog
Class ConfirmationDialog

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.dialog.ApplicationDialog
          extended by org.springframework.richclient.dialog.ConfirmationDialog
All Implemented Interfaces:
Guarded, TitleConfigurable
Direct Known Subclasses:
BasicConfirmationDialog

public abstract class ConfirmationDialog
extends ApplicationDialog

Dialog for asking confirmation to the user. The onConfirm is called when the user presses the yes button.


Field Summary
 
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
 
Constructor Summary
ConfirmationDialog()
           
ConfirmationDialog(String title, String message)
           
ConfirmationDialog(String title, Window parent, String message)
           
 
Method Summary
protected  JComponent createDialogContentPane()
          Return the GUI which allows the user to manipulate the business objects related to this dialog.
protected  void disposeDialogContentPane()
          Cleanup any components/objects that are created during ApplicationDialog.createDialogContentPane().
protected  String getCancelCommandId()
          Returns the id for the cancel command.
protected  String getFinishCommandId()
          Subclasses may override to return a custom message key, default is "okCommand", corresponding to the "&OK" label.
protected  int getNoKey()
           
protected  int getYesKey()
           
protected abstract  void onConfirm()
           
protected  boolean onFinish()
          Request invocation of the action taken when the user hits the OK (finish) button.
protected  void onInitialized()
          Template lifecycle method invoked after the dialog control is initialized.
protected  void registerDefaultCommand()
          Register the finish button as the default dialog button.
 void setConfirmationMessage(String message)
           
 
Methods inherited from class org.springframework.richclient.dialog.ApplicationDialog
addActionKeyBinding, addActionKeyBinding, addDialogComponents, attachListeners, componentsChanged, createButtonBar, createDialog, dispose, getActionMap, getCallingCommand, getCancelCommand, getCommandGroupMembers, getDialog, getDialogContentPane, getDisplayFinishSuccessMessage, getFinishCommand, getFinishSecurityControllerId, getFinishSuccessMessage, getFinishSuccessMessageArguments, getFinishSuccessTitle, getFinishSuccessTitleArguments, getInputMap, getLocation, getLocationRelativeTo, getParentComponent, getParentWindow, getPreferredSize, getTitle, getWindowForComponent, hide, init, isControlCreated, isEnabled, isShowing, onAboutToShow, onCancel, onWindowActivated, onWindowClosing, onWindowGainedFocus, onWindowLostFocus, registerCancelCommandAsDefault, registerDefaultCommand, setCallingCommand, setCloseAction, setDefaultEnabled, setDisplayFinishSuccessMessage, setEnabled, setFinishEnabled, setLocation, setLocationRelativeTo, setModal, setParentComponent, setPreferredSize, setResizable, setTitle, 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
 

Constructor Detail

ConfirmationDialog

public ConfirmationDialog()

ConfirmationDialog

public ConfirmationDialog(String title,
                          String message)

ConfirmationDialog

public ConfirmationDialog(String title,
                          Window parent,
                          String message)
Method Detail

setConfirmationMessage

public void setConfirmationMessage(String message)

getFinishCommandId

protected String getFinishCommandId()
Description copied from class: ApplicationDialog
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()
Description copied from class: ApplicationDialog
Returns the id for the cancel command.

Overrides:
getCancelCommandId in class ApplicationDialog

registerDefaultCommand

protected void registerDefaultCommand()
Description copied from class: ApplicationDialog
Register the finish button as the default dialog button.

Overrides:
registerDefaultCommand in class ApplicationDialog

onInitialized

protected void onInitialized()
Description copied from class: ApplicationDialog
Template lifecycle method invoked after the dialog control is initialized.

Overrides:
onInitialized in class ApplicationDialog

getYesKey

protected int getYesKey()

getNoKey

protected int getNoKey()

createDialogContentPane

protected JComponent createDialogContentPane()
Description copied from class: ApplicationDialog
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()

disposeDialogContentPane

protected void disposeDialogContentPane()
Description copied from class: ApplicationDialog
Cleanup any components/objects that are created during ApplicationDialog.createDialogContentPane(). This method is called if the CloseAction is set to CloseAction.DISPOSE and the dialog is being closed. This ensures that when disposing the surrounding dialog, the content pane can be disposed as well.

Overrides:
disposeDialogContentPane in class ApplicationDialog
See Also:
ApplicationDialog.createDialogContentPane(), ApplicationDialog.dispose()

onFinish

protected final 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.

onConfirm

protected abstract void onConfirm()


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