gui.dialog
Class DialogContentPane

java.lang.Object
  extended by gui.dialog.DialogContentPane
All Implemented Interfaces:
IDialogOptions, JAPHelpContext.IHelpContext
Direct Known Subclasses:
CaptchaContentPane, FileChooserContentPane, FinishedContentPane, JpiSelectionPane, MethodSelectionPane, PassivePaymentPane, PasswordContentPane, PaymentInfoPane, SimpleWizardContentPane, TermsAndConditionsPane, VolumePlanSelectionPane, WorkerContentPane

public class DialogContentPane
extends java.lang.Object
implements JAPHelpContext.IHelpContext, IDialogOptions

This is a replacement for a dialog content pane. It defines an icon, buttons, a status bar for information and error messages, an optional titled border around the content and a content pane where own components can be placed. The content pane of the parent dialog is automatically replaced with this one by calling the method updateDialog(). If the size of the dialog has not been defined before, you will need to call pack() afterwards.

Dialog content panes can be implemented as a chained list, so that if someone clicks on a button, the next or previous content pane in the list is displayed in the dialog. Use setDefaultButtonOperation() and the ON_... events to activate this behaviour. Of course, the forward and back operations can be done explicitly and without those events, too.

If you have a chained list, you can display it as a wizard. Every content pane in the list then must implement the interface DialogContentPane.IWizardSuitable and each content pane is recommended to support BUTTON_OPERATION_WIZARD. Their "YES/OK" and "NO" buttons will automatically be transformed into "Next" and "Previous", and all buttons are shown (Cancel, Previous, Next). If a class wants to keep its own buttons as defined by the option type but act in a wizard, it has to implement IWizardSuitableNoWizardButtons. This will prevent that is gets the wizard layout.

Author:
Rolf Wendolsky
See Also:
JAPDialog, JDialog, DialogContentPane.Layout, gui.dialog.DialogContentPane.Options, DialogContentPane.CheckError, DialogContentPane.IWizardSuitable, DialogContentPane.IWizardSuitableNoWizardButtons

Nested Class Summary
private  class DialogContentPane.ButtonListener
           
static class DialogContentPane.CheckError
          A CheckError is used to set error conditions that prohibit operations.
private  class DialogContentPane.ContentPaneComponentListener
           
private  class DialogContentPane.DialogComponentListener
           
private  class DialogContentPane.DialogWindowListener
           
static interface DialogContentPane.IWizardSuitable
          Content panes that are suitable for use in a wizard should implement this interface.
static interface DialogContentPane.IWizardSuitableNoWizardButtons
          Classes that are WizardSuitable but do not want to get the wizard buttons should implement this interface.
static class DialogContentPane.Layout
          Defines the general layout of a dialog.
private  class DialogContentPane.LinkedDialog
           
 
Field Summary
static int BUTTON_OPERATION_WIZARD
          Is equal to ON_NO_SHOW_PREVIOUS_CONTENT | ON_YESOK_SHOW_NEXT_CONTENT | ON_CLICK_DISPOSE_DIALOG as the typical wizard behaviour .
static int DEFAULT_BUTTON_CANCEL
           
static int DEFAULT_BUTTON_EMPTY
           
static int DEFAULT_BUTTON_HELP
           
static int DEFAULT_BUTTON_KEEP
           
static int DEFAULT_BUTTON_NO
           
static int DEFAULT_BUTTON_OK
           
static int DEFAULT_BUTTON_YES
           
private  boolean m_bDisposed
           
private  boolean m_bHasHadWizardLayout
           
private  javax.swing.JButton m_btnCancel
           
private  javax.swing.JButton m_btnHelp
           
private  javax.swing.JButton m_btnNo
           
private  javax.swing.JButton m_btnYesOK
           
private  DialogContentPane.ButtonListener m_buttonListener
           
private  java.util.Vector m_componentListeners
           
private  javax.swing.JComponent m_contentPane
           
private  java.awt.Container m_currentlyActiveContentPane
           
private  java.awt.event.ComponentListener m_currentlyActiveContentPaneComponentListener
           
private  int m_defaultButton
           
private  int m_defaultButtonOperation
           
private  JAPHelpContext.IHelpContext m_helpContext
           
private  javax.swing.Icon m_icon
           
private  int m_idStatusMessage
           
private  DialogContentPane.Layout m_layout
           
private  JAPHtmlMultiLineLabel m_lblMessage
           
private  JAPHtmlMultiLineLabel m_lblSeeFullText
           
private  JAPHtmlMultiLineLabel m_lblText
           
private  DialogContentPane.LinkedDialog m_linkedDialog
           
private  DialogContentPane m_nextContentPane
           
private  DialogContentPaneOptions m_options
           
private  java.awt.Container m_panelOptions
           
private  javax.swing.RootPaneContainer m_parentDialog
           
private  DialogContentPane m_previousContentPane
           
private  java.util.Vector m_rememberedErrors
           
private  java.util.Vector m_rememberedUpdateErrors
           
private  javax.swing.JPanel m_rootPane
           
private  java.lang.String m_strText
           
private  javax.swing.JDialog m_tempDialog
           
private  java.awt.GridBagConstraints m_textConstraints
           
private  javax.swing.JPanel m_titlePane
           
private  int m_value
           
private static javax.swing.Icon[] MESSAGE_ICONS
           
private static int[] MESSAGE_TYPES
           
private static int MIN_TEXT_WIDTH
           
private static java.lang.String MORE_POINTS
           
static java.lang.String MSG_CANCEL
           
static java.lang.String MSG_FINISH
           
static java.lang.String MSG_NEXT
           
static java.lang.String MSG_NO
           
static java.lang.String MSG_OK
           
static java.lang.String MSG_OPERATION_FAILED
           
static java.lang.String MSG_PREVIOUS
           
static java.lang.String MSG_SEE_FULL_MESSAGE
           
static java.lang.String MSG_YES
           
private static int NUMBER_OF_HEURISTIC_ITERATIONS
           
static int ON_CANCEL_DISPOSE_DIALOG
           
static int ON_CANCEL_HIDE_DIALOG
           
static int ON_CANCEL_SHOW_NEXT_CONTENT
           
static int ON_CANCEL_SHOW_PREVIOUS_CONTENT
           
static int ON_CLICK_DISPOSE_DIALOG
           
static int ON_CLICK_DO_NOTHING
           
static int ON_CLICK_HIDE_DIALOG
           
static int ON_CLICK_SHOW_NEXT_CONTENT
           
static int ON_CLICK_SHOW_PREVIOUS_CONTENT
           
static int ON_NO_DISPOSE_DIALOG
           
static int ON_NO_HIDE_DIALOG
           
static int ON_NO_SHOW_NEXT_CONTENT
           
static int ON_NO_SHOW_PREVIOUS_CONTENT
           
static int ON_YESOK_DISPOSE_DIALOG
           
static int ON_YESOK_HIDE_DIALOG
           
static int ON_YESOK_SHOW_NEXT_CONTENT
           
static int ON_YESOK_SHOW_PREVIOUS_CONTENT
           
private static int SPACE_AROUND_TEXT
           
private static int UNLIMITED_SIZE
           
 
Fields inherited from interface gui.dialog.IDialogOptions
MESSAGE_TYPE_ERROR, MESSAGE_TYPE_INFORMATION, MESSAGE_TYPE_PLAIN, MESSAGE_TYPE_QUESTION, MESSAGE_TYPE_WARNING, OPTION_TYPE_CANCEL, OPTION_TYPE_DEFAULT, OPTION_TYPE_EMPTY, OPTION_TYPE_OK_CANCEL, OPTION_TYPE_YES_NO, OPTION_TYPE_YES_NO_CANCEL, RETURN_VALUE_CANCEL, RETURN_VALUE_CLOSED, RETURN_VALUE_NO, RETURN_VALUE_OK, RETURN_VALUE_UNINITIALIZED, RETURN_VALUE_YES
 
Constructor Summary
  DialogContentPane(JAPDialog a_parentDialog)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, DialogContentPane.Layout a_layout)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPane.Layout a_layout)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
  DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
private DialogContentPane(javax.swing.RootPaneContainer a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
          Constructs a new dialog content pane.
 
Method Summary
 void addComponentListener(java.awt.event.ComponentListener a_listener)
          Adds a component listener.
 void addDialogComponentListener(java.awt.event.ComponentListener a_listener)
          Adds a component listener to the parent dialog.
 void addDialogWindowListener(java.awt.event.WindowListener a_listener)
          Adds a window listener to the parent dialog.
private  javax.swing.JButton addHelpButton()
           
 DialogContentPane.CheckError[] checkCancel()
          Is called when the "Cancel" button is clicked.
private  boolean checkErrors(DialogContentPane.CheckError[] a_errors, java.util.Vector a_rememberedErrors)
          Undos all error actions of the remembered errors, checks if the given array of errors contains one or more errors and adds those errors to the vector of remembered errors.
 DialogContentPane.CheckError[] checkNo()
          Is called when the "No" or "Previous" button is clicked.
 DialogContentPane.CheckError[] checkUpdate()
          Is called when someone calls updateDialog() on this content pane.
 DialogContentPane.CheckError[] checkYesOK()
          Is called when the "Yes", "OK" or "Next" button is clicked.
 void clearStatusMessage()
          Resets the text in the status message line to an empty String.
 void clearStatusMessage(int a_messageID)
           
 void closeDialog(boolean a_bDispose)
          Hides or disposed the parent dialog.
private  void createDefaultOptions()
           
private  void createOptions()
           
private  void createWizardOptions()
           
 void dispose()
           
private  boolean doDefaultButtonOperation(DialogContentPane.CheckError[] a_errors, int a_opNext, int a_opPrevious, int a_opHide, int a_opDispose)
           
private static javax.swing.Icon findMessageIcon(javax.swing.JOptionPane a_optionPane)
           
 javax.swing.JButton getButtonCancel()
          Returns the "Cancel" button.
 javax.swing.JButton getButtonHelp()
          Returns the "Help" button.
 javax.swing.JButton getButtonNo()
          Returns the "No" button.
 int getButtonValue()
          Returns the button value the user has selected.
 javax.swing.JButton getButtonYesOK()
          Returns the "Yes" or "OK" button.
 javax.swing.JComponent getContentPane()
          Returns the content pane where elements may be placed freely.
 int getDefaultButton()
          Returns the button to be set as default button of the dialog when updateDialog() is called.
 int getDefaultButtonOperation()
          Returns what happens if one of the buttons is clicked.
 javax.swing.RootPaneContainer getDialog()
          Returns the parent Dialog.
private  java.awt.Container getDialogContentPane()
           
 java.lang.String getHelpContext()
          Returns the help context or null if no help context is provided by this object.
 java.awt.Component getHelpExtractionDisplayContext()
           
private  JAPDialog getJAPDialog()
           
static javax.swing.Icon getMessageIcon(int a_messageType)
           
 DialogContentPane getNextContentPane()
          Returns the next content pane in the chained list of content panes.
 DialogContentPane getPreviousContentPane()
          Returns the previous content pane in the chained list of content panes.
 java.lang.String getText()
          Returns the text that is displayed in the content pane.
 java.lang.Object getValue()
          Optional return value that may be created by the content pane during its visibility.
 boolean hasNextContentPane()
          Returns if this content pane has a successor.
 boolean hasPreviousContentPane()
          Returns if this content pane has a predecessor.
 boolean hasValidValue()
          Returns if getValue() returns an other value than RETURN_VALUE_CANCEL, RETURN_VALUE_CLOSED or RETURN_VALUE_UNINITIALIZED.
 boolean hasWizardLayout()
          Returns if this content pane is formatted with the wizard layout.
 boolean isActive()
          Returns if this content pane is the currently active content pane in the dialog, that means that this content pane is shown if the dialog is shown.
 boolean isAutomaticFocusSettingEnabled()
          Returns if the automatic focus setting of the DialogContentPane class is enabled.
 boolean isDialogVisible()
          Returns if the parent dialog is visible.
 boolean isDisposed()
           
 boolean isMoveBackAllowed()
          Returns if a move back to the direction of this content pane is allowed in a wizard.
 boolean isMoveForwardAllowed()
          Returns if a move forward to the direction of this content pane is allowed in a wizard.
 boolean isSkippedAsNextContentPane()
          If the previous content pane of this one calls moveToNextContentPane(), this content pane may tell him to skip it and move forward to the next one.
 boolean isSkippedAsPreviousContentPane()
          If the next content pane of this one calls moveToPreviousContentPane(), this content pane may tell him to skip it and move forward to the next one.
private  boolean isSomethingDoneOnClick(DialogContentPane.CheckError[] a_errors, int a_opNext, int a_opPrevious, int a_opHide, int a_opDispose)
          Returns true if the click on a specific button will do an automatic action.
 boolean isVisible()
          Returns if the content pane is part of a visible dialog.
private  boolean moveToContentPane(boolean a_bNext)
          Shows a given content pane in the dialog if it exists.
 boolean moveToNextContentPane()
          Shows the next content pane in the dialog if it exists.
 boolean moveToPreviousContentPane()
          Shows the previous content pane in the dialog if it exists.
 int printErrorStatusMessage(int a_logType, java.lang.Throwable a_throwable)
          Prints an error message in the status bar.
 int printErrorStatusMessage(java.lang.String a_message, int a_logType)
          Prints an error message in the status bar.
 int printErrorStatusMessage(java.lang.String a_message, int a_logType, java.lang.Throwable a_throwable)
          Prints an error message in the status bar.
private  int printErrorStatusMessage(java.lang.String a_message, int a_logType, java.lang.Throwable a_throwable, boolean a_bShow)
          Logs an error message an optionally prints it to the status bar.
 void printStatusMessage(java.lang.String a_message)
          Prints an information message in the status bar.
 void printStatusMessage(java.lang.String a_message, int a_messageType)
          Prints a status message in the status bar.
private  int printStatusMessageInternal(java.lang.String a_strMessage, int a_messageType)
           
 void removeComponentListener(java.awt.event.ComponentListener a_listener)
          Removes a component listener.
 void removeDialogComponentListener(java.awt.event.ComponentListener a_listener)
          Removes a component listener from the parent dialog.
 void removeDialogWindowListener(java.awt.event.WindowListener a_listener)
          Removes a window listener from the parent dialog.
 void setButtonValue(int a_value)
          Sets the button value.
 void setContentPane(javax.swing.JComponent a_contentPane)
          Replace the content pane of this content pane by another one.
 void setDefaultButton(int a_defaultButton)
          Defines the button to be set as default button of the dialog when updateDialog() is called.
 void setDefaultButtonOperation(int a_defaultButtonOperation)
          Defines what happens if one of the buttons is clicked.
 void setMouseListener(java.awt.event.MouseListener a_listener)
           
private  void setNextContentPane(DialogContentPane a_nextContentPane)
           
 void setText(java.lang.String a_strText)
          Use this method to set a new text for the content pane.
private  void setTextOfWizardNextButton()
           
 void showDialog()
          Set the parent dialog visible.
 DialogContentPane.CheckError[] updateDialog()
          Replaces the content pane of the parent dialog with the content defined in this object.
private  DialogContentPane.CheckError[] updateDialog(boolean a_bCheckUpdate)
          Replaces the content pane of the parent dialog with the content defined in this object.
private  DialogContentPane.CheckError[] updateDialog(int a_maxTextWidth, boolean a_bCallCheckUpdate)
          Replaces the content pane of the parent dialog with the content defined in this object.
 void updateDialogOptimalSized()
           
static void updateDialogOptimalSized(DialogContentPane a_firstContentPane)
          Calculates the optimal dialog size for a chain of content panes.
 void validateDialog()
          Calls validate() on the dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_TYPES

private static final int[] MESSAGE_TYPES

MESSAGE_ICONS

private static final javax.swing.Icon[] MESSAGE_ICONS

ON_CLICK_DO_NOTHING

public static final int ON_CLICK_DO_NOTHING
See Also:
Constant Field Values

ON_CLICK_HIDE_DIALOG

public static final int ON_CLICK_HIDE_DIALOG
See Also:
Constant Field Values

ON_CLICK_DISPOSE_DIALOG

public static final int ON_CLICK_DISPOSE_DIALOG
See Also:
Constant Field Values

ON_CLICK_SHOW_NEXT_CONTENT

public static final int ON_CLICK_SHOW_NEXT_CONTENT
See Also:
Constant Field Values

ON_YESOK_SHOW_NEXT_CONTENT

public static final int ON_YESOK_SHOW_NEXT_CONTENT
See Also:
Constant Field Values

ON_NO_SHOW_NEXT_CONTENT

public static final int ON_NO_SHOW_NEXT_CONTENT
See Also:
Constant Field Values

ON_CANCEL_SHOW_NEXT_CONTENT

public static final int ON_CANCEL_SHOW_NEXT_CONTENT
See Also:
Constant Field Values

ON_CLICK_SHOW_PREVIOUS_CONTENT

public static final int ON_CLICK_SHOW_PREVIOUS_CONTENT
See Also:
Constant Field Values

ON_YESOK_SHOW_PREVIOUS_CONTENT

public static final int ON_YESOK_SHOW_PREVIOUS_CONTENT
See Also:
Constant Field Values

ON_NO_SHOW_PREVIOUS_CONTENT

public static final int ON_NO_SHOW_PREVIOUS_CONTENT
See Also:
Constant Field Values

ON_CANCEL_SHOW_PREVIOUS_CONTENT

public static final int ON_CANCEL_SHOW_PREVIOUS_CONTENT
See Also:
Constant Field Values

ON_YESOK_HIDE_DIALOG

public static final int ON_YESOK_HIDE_DIALOG
See Also:
Constant Field Values

ON_NO_HIDE_DIALOG

public static final int ON_NO_HIDE_DIALOG
See Also:
Constant Field Values

ON_CANCEL_HIDE_DIALOG

public static final int ON_CANCEL_HIDE_DIALOG
See Also:
Constant Field Values

ON_YESOK_DISPOSE_DIALOG

public static final int ON_YESOK_DISPOSE_DIALOG
See Also:
Constant Field Values

ON_NO_DISPOSE_DIALOG

public static final int ON_NO_DISPOSE_DIALOG
See Also:
Constant Field Values

ON_CANCEL_DISPOSE_DIALOG

public static final int ON_CANCEL_DISPOSE_DIALOG
See Also:
Constant Field Values

BUTTON_OPERATION_WIZARD

public static final int BUTTON_OPERATION_WIZARD
Is equal to ON_NO_SHOW_PREVIOUS_CONTENT | ON_YESOK_SHOW_NEXT_CONTENT | ON_CLICK_DISPOSE_DIALOG as the typical wizard behaviour . If the default button operation does not contain this behaviour, at least the class itself should implement an equal behaviour, or this content pane should not be displayed as a wizard (not implement IWizardSuitable).

See Also:
Constant Field Values

MSG_OK

public static final java.lang.String MSG_OK

MSG_YES

public static final java.lang.String MSG_YES

MSG_NO

public static final java.lang.String MSG_NO

MSG_NEXT

public static final java.lang.String MSG_NEXT

MSG_PREVIOUS

public static final java.lang.String MSG_PREVIOUS

MSG_FINISH

public static final java.lang.String MSG_FINISH

MSG_CANCEL

public static final java.lang.String MSG_CANCEL

MSG_OPERATION_FAILED

public static final java.lang.String MSG_OPERATION_FAILED

MSG_SEE_FULL_MESSAGE

public static final java.lang.String MSG_SEE_FULL_MESSAGE

DEFAULT_BUTTON_EMPTY

public static final int DEFAULT_BUTTON_EMPTY
See Also:
Constant Field Values

DEFAULT_BUTTON_CANCEL

public static final int DEFAULT_BUTTON_CANCEL
See Also:
Constant Field Values

DEFAULT_BUTTON_YES

public static final int DEFAULT_BUTTON_YES
See Also:
Constant Field Values

DEFAULT_BUTTON_OK

public static final int DEFAULT_BUTTON_OK
See Also:
Constant Field Values

DEFAULT_BUTTON_NO

public static final int DEFAULT_BUTTON_NO
See Also:
Constant Field Values

DEFAULT_BUTTON_HELP

public static final int DEFAULT_BUTTON_HELP
See Also:
Constant Field Values

DEFAULT_BUTTON_KEEP

public static final int DEFAULT_BUTTON_KEEP
See Also:
Constant Field Values

MIN_TEXT_WIDTH

private static final int MIN_TEXT_WIDTH
See Also:
Constant Field Values

UNLIMITED_SIZE

private static final int UNLIMITED_SIZE
See Also:
Constant Field Values

SPACE_AROUND_TEXT

private static final int SPACE_AROUND_TEXT
See Also:
Constant Field Values

MORE_POINTS

private static final java.lang.String MORE_POINTS
See Also:
Constant Field Values

NUMBER_OF_HEURISTIC_ITERATIONS

private static final int NUMBER_OF_HEURISTIC_ITERATIONS
See Also:
Constant Field Values

m_nextContentPane

private DialogContentPane m_nextContentPane

m_previousContentPane

private DialogContentPane m_previousContentPane

m_parentDialog

private javax.swing.RootPaneContainer m_parentDialog

m_contentPane

private javax.swing.JComponent m_contentPane

m_titlePane

private javax.swing.JPanel m_titlePane

m_rootPane

private javax.swing.JPanel m_rootPane

m_panelOptions

private java.awt.Container m_panelOptions

m_lblMessage

private JAPHtmlMultiLineLabel m_lblMessage

m_linkedDialog

private DialogContentPane.LinkedDialog m_linkedDialog

m_lblText

private JAPHtmlMultiLineLabel m_lblText

m_lblSeeFullText

private JAPHtmlMultiLineLabel m_lblSeeFullText

m_defaultButtonOperation

private int m_defaultButtonOperation

m_value

private int m_value

m_helpContext

private JAPHelpContext.IHelpContext m_helpContext

m_btnHelp

private javax.swing.JButton m_btnHelp

m_btnYesOK

private javax.swing.JButton m_btnYesOK

m_btnNo

private javax.swing.JButton m_btnNo

m_btnCancel

private javax.swing.JButton m_btnCancel

m_buttonListener

private DialogContentPane.ButtonListener m_buttonListener

m_icon

private javax.swing.Icon m_icon

m_bHasHadWizardLayout

private boolean m_bHasHadWizardLayout

m_textConstraints

private java.awt.GridBagConstraints m_textConstraints

m_rememberedErrors

private java.util.Vector m_rememberedErrors

m_rememberedUpdateErrors

private java.util.Vector m_rememberedUpdateErrors

m_currentlyActiveContentPane

private java.awt.Container m_currentlyActiveContentPane

m_componentListeners

private java.util.Vector m_componentListeners

m_currentlyActiveContentPaneComponentListener

private java.awt.event.ComponentListener m_currentlyActiveContentPaneComponentListener

m_defaultButton

private int m_defaultButton

m_strText

private java.lang.String m_strText

m_tempDialog

private javax.swing.JDialog m_tempDialog

m_bDisposed

private boolean m_bDisposed

m_options

private DialogContentPaneOptions m_options

m_layout

private DialogContentPane.Layout m_layout

m_idStatusMessage

private int m_idStatusMessage
Constructor Detail

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         java.lang.String a_strText)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         java.lang.String a_strText)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPane.Layout a_layout)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_layout - the general layout of the content pane (icon, title, border, ...)

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPane.Layout a_layout)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_layout - the general layout of the content pane (icon, title, border, ...)

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_options - the button definitions

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_options - the button definitions

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPane.Layout a_layout,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_layout - the general layout of the content pane (icon, title, border, ...)
a_options - the button definitions

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         java.lang.String a_strText,
                         DialogContentPane.Layout a_layout,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_layout - the general layout of the content pane (icon, title, border, ...)
a_options - the button definitions

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         DialogContentPane.Layout a_layout)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_layout - the general layout of the content pane (icon, title, border, ...)

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         DialogContentPane.Layout a_layout)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_layout - the general layout of the content pane (icon, title, border, ...)

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_options - the button definitions

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_options - the button definitions

DialogContentPane

public DialogContentPane(javax.swing.JDialog a_parentDialog,
                         DialogContentPane.Layout a_layout,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_layout - the general layout of the content pane (icon, title, border, ...)
a_options - the button definitions

DialogContentPane

public DialogContentPane(JAPDialog a_parentDialog,
                         DialogContentPane.Layout a_layout,
                         DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_layout - the general layout of the content pane (icon, title, border, ...)
a_options - the button definitions

DialogContentPane

private DialogContentPane(javax.swing.RootPaneContainer a_parentDialog,
                          java.lang.String a_strText,
                          DialogContentPane.Layout a_layout,
                          DialogContentPaneOptions a_options)
Constructs a new dialog content pane. Its layout is predefined, but may change if the content pane is part of a wizard.

Parameters:
a_parentDialog - the parent dialog; a content pane is always registered to a dialog, and may not change it in lifetime.
a_strText - A text that is shown within the content pane. The text is interpreted as HTML. If you call pack() on the dialog when it is updated with this content pane, the text length is auto-formatted so that its width is not bigger than the content with respect to a minimum size. Notice: this only works correctly if you call pack() on an invisible dialog.
a_layout - the general layout of the content pane (icon, title, border, ...)
a_options - the button definitions
Method Detail

getMessageIcon

public static javax.swing.Icon getMessageIcon(int a_messageType)

updateDialogOptimalSized

public void updateDialogOptimalSized()

updateDialogOptimalSized

public static void updateDialogOptimalSized(DialogContentPane a_firstContentPane)
Calculates the optimal dialog size for a chain of content panes. The optimal size is defined as the size that is needed to the contents pane with the maximum width or the maximum size in the chain. The chain is defined as the content panes that are returned by calling getNextContentPane() on each one.

Note 1: This method needs to call updateDialog() for every content pane in the chain. You should therefore never call this method on a dialog that is visible! This would cause serious flickering in the best case, in the worst case the wrong dialog is shown afterwards (that is the last dialog in the chain).

Note 2: If the content pane that should show up first is not the content pane you gave as argument, you will have to call updateDialog() on it after calling this method.

Note 3: Subsequent calls of pack() on the dialog will de-optimise the dialog size; it is highly recommended not to do pack() afterwards!

Parameters:
a_firstContentPane - the first DialogContentPane in a chain of content panes; this method will call updateDialog() on it to initialise the dialog

hasPreviousContentPane

public final boolean hasPreviousContentPane()
Returns if this content pane has a predecessor.

Returns:
if this content pane has a predecessor

hasNextContentPane

public final boolean hasNextContentPane()
Returns if this content pane has a successor.

Returns:
if this content pane has a successor

hasWizardLayout

public final boolean hasWizardLayout()
Returns if this content pane is formatted with the wizard layout. The "Yes" and "OK" buttons will be transformed to "Next", the "No" button is replaced by "Previous" and all buttons are shown (Cancel, Previous, Next), not regarding what buttons have been defined by the option type. If the dialog window is opened, the focus will automatically be set on "Next".

If a class wants to keep its own buttons as defined by the option type but act in a wizard, it has to implement IWizardSuitableNoWizardButtons. This will prevent that is gets the wizard layout.

Returns:
if this content pane is formatted with the wizard layout

getNextContentPane

public final DialogContentPane getNextContentPane()
Returns the next content pane in the chained list of content panes.

Returns:
the next content pane in the chained list of content panes

getPreviousContentPane

public final DialogContentPane getPreviousContentPane()
Returns the previous content pane in the chained list of content panes.

Returns:
the previous content pane in the chained list of content panes

moveToPreviousContentPane

public final boolean moveToPreviousContentPane()
Shows the previous content pane in the dialog if it exists. Otherwise, the dialog is closed according to the default ON_CLICK operation. If no ON_CLICK operation is set, nothing is done by default. If the content pane exists, its checkUpdate() method is interpreted and the errors are handled.

Returns:
if a move to the previous content pane was done; false if no previous content pane does exist or if it refused to update the dialog

checkYesOK

public DialogContentPane.CheckError[] checkYesOK()
Is called when the "Yes", "OK" or "Next" button is clicked. If one or more error occured, they should be returned as CheckErrors to inform the user. In this case, the automatic reaction on the button click is prohibited and getValue() will not change. Overwrite this method to set your own check; it returns null by default. This method should never be called directly and is only used internally.

Returns:
errors that prohibit the operation or null or an empty array if the operation is allowed

checkNo

public DialogContentPane.CheckError[] checkNo()
Is called when the "No" or "Previous" button is clicked. If one or more error occured, they should be returned as CheckErrors to inform the user. In this case, the automatic reaction on the button click is prohibited and getValue() will not change. Overwrite this method to set your own check; it returns null by default. This method should never be called directly and is only used internally.

Returns:
errors that prohibit the operation or null or an empty array if the operation is allowed

checkCancel

public DialogContentPane.CheckError[] checkCancel()
Is called when the "Cancel" button is clicked. If one or more error occured, they should be returned as CheckErrors to inform the user. In this case, the automatic reaction on the button click is prohibited and getValue() will not change. Overwrite this method to set your own check; it returns null by default. This method should never be called directly and is only used internally.

Returns:
errors that prohibit the operation or null or an empty array if the operation is allowed

checkUpdate

public DialogContentPane.CheckError[] checkUpdate()
Is called when someone calls updateDialog() on this content pane. The update operation is only performed if null is returned. Otherwise, the caller may interpret the errors he gets from updateDialog. This is done by moveToNextContentPane() and moveToPreviousContentPane() . Overwrite this method to set your own check; it returns null by default. This method should never be called directly and is only used internally.

Returns:
errors that prohibit the operation or null or an empty array if the operation is allowed

isSkippedAsNextContentPane

public boolean isSkippedAsNextContentPane()
If the previous content pane of this one calls moveToNextContentPane(), this content pane may tell him to skip it and move forward to the next one. Returns false by default but may be overwritten by subclasses.

Returns:
true if this content pane would like to be skipped as next content pane; false otherwise

isMoveBackAllowed

public boolean isMoveBackAllowed()
Returns if a move back to the direction of this content pane is allowed in a wizard. Stronger than isSkippedAsPreviousContentPane(), as this method does not allow to access previous content panes, either. hasPreviousContentPane() will return 'false' for all content panes after this one if isMoveBackAllowed() returns false

Returns:
if a move back to the direction of this content pane is allowed in a wizard

isMoveForwardAllowed

public boolean isMoveForwardAllowed()
Returns if a move forward to the direction of this content pane is allowed in a wizard. Stronger than isSkippedAsNextsContentPane(), as this method does not allow to access next content panes, either. hasNextContentPane() will return 'false' for all content panes after this one if isMoveForwardAllowed() returns false

Returns:
if a move forward to the direction of this content pane is allowed in a wizard

isSkippedAsPreviousContentPane

public boolean isSkippedAsPreviousContentPane()
If the next content pane of this one calls moveToPreviousContentPane(), this content pane may tell him to skip it and move forward to the next one. Returns false by default but may be overwritten by subclasses.

Returns:
true if this content pane would like to be skipped as previous content pane; false otherwise

moveToNextContentPane

public final boolean moveToNextContentPane()
Shows the next content pane in the dialog if it exists. Otherwise, the dialog is closed according to the default ON_CLICK operation. If no ON_CLICK operation is set, nothing is done by default. If the content pane exists, its checkUpdate() method is interpreted and the errors are handled.

Returns:
if a move to the next content pane was done; false if no next content pane does exist or if it refused to update the dialog

getContentPane

public final javax.swing.JComponent getContentPane()
Returns the content pane where elements may be placed freely.

Returns:
the content pane

showDialog

public final void showDialog()
Set the parent dialog visible.


setContentPane

public final void setContentPane(javax.swing.JComponent a_contentPane)
Replace the content pane of this content pane by another one.

Parameters:
a_contentPane - JComponent

getHelpContext

public final java.lang.String getHelpContext()
Returns the help context or null if no help context is provided by this object.

Specified by:
getHelpContext in interface JAPHelpContext.IHelpContext
Returns:
the help context or null if no help context is provided by this object

getHelpExtractionDisplayContext

public java.awt.Component getHelpExtractionDisplayContext()
Specified by:
getHelpExtractionDisplayContext in interface JAPHelpContext.IHelpContext

clearStatusMessage

public final void clearStatusMessage(int a_messageID)

clearStatusMessage

public final void clearStatusMessage()
Resets the text in the status message line to an empty String.


printStatusMessage

public final void printStatusMessage(java.lang.String a_message)
Prints an information message in the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_message - an information message

printStatusMessage

public final void printStatusMessage(java.lang.String a_message,
                                     int a_messageType)
Prints a status message in the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_message - a status message
a_messageType - the message type; this has a influence on how the message is displayed (color, icon,...).

printErrorStatusMessage

public final int printErrorStatusMessage(int a_logType,
                                         java.lang.Throwable a_throwable)
Prints an error message in the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_logType - the log type of this error
a_throwable - a Throwable that has been catched in the context of this error

printErrorStatusMessage

public final int printErrorStatusMessage(java.lang.String a_message,
                                         int a_logType)
Prints an error message in the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_message - an error message
a_logType - the log type of this error

printErrorStatusMessage

public final int printErrorStatusMessage(java.lang.String a_message,
                                         int a_logType,
                                         java.lang.Throwable a_throwable)
Prints an error message in the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_message - an error message
a_logType - the log type of this error
a_throwable - a Throwable that has been catched in the context of this error

validateDialog

public final void validateDialog()
Calls validate() on the dialog.


updateDialog

public final DialogContentPane.CheckError[] updateDialog()
Replaces the content pane of the parent dialog with the content defined in this object.

Returns:
the errors returned by checkUpdate() or null or an empty array if no errors occured and the update has been done

updateDialog

private final DialogContentPane.CheckError[] updateDialog(boolean a_bCheckUpdate)
Replaces the content pane of the parent dialog with the content defined in this object.

Parameters:
a_bCheckUpdate - if checkUpdate should be called
Returns:
the errors returned by checkUpdate() or null or an empty array if no errors occured and the update has been done

printErrorStatusMessage

private int printErrorStatusMessage(java.lang.String a_message,
                                    int a_logType,
                                    java.lang.Throwable a_throwable,
                                    boolean a_bShow)
Logs an error message an optionally prints it to the status bar. If the status bar is not available, a dialog window is opened. If the text is too long for the status bar, the text is cut and the user can see it by clicking on the stauts bar (a dialog window opens).

Parameters:
a_message - an error message
a_logType - the log type of this error
a_throwable - a Throwable that has been catched in the context of this error
a_bShow - if the message is shown to the user or logged only

updateDialog

private final DialogContentPane.CheckError[] updateDialog(int a_maxTextWidth,
                                                          boolean a_bCallCheckUpdate)
Replaces the content pane of the parent dialog with the content defined in this object.

Parameters:
a_maxTextWidth - the maximum width that is allowed for the (optional) text field
a_bCallCheckUpdate - if checkUpdate should be called
Returns:
the errors returned by checkUpdate() or null or an empty array if no errors occured and the update has been done

getButtonHelp

public final javax.swing.JButton getButtonHelp()
Returns the "Help" button.

Returns:
the "Help" button

getButtonCancel

public final javax.swing.JButton getButtonCancel()
Returns the "Cancel" button.

Returns:
the "Cancel" button

getButtonYesOK

public final javax.swing.JButton getButtonYesOK()
Returns the "Yes" or "OK" button.

Returns:
the "Yes" or "OK" button

getButtonNo

public final javax.swing.JButton getButtonNo()
Returns the "No" button.

Returns:
the "No" button

setDefaultButton

public final void setDefaultButton(int a_defaultButton)
Defines the button to be set as default button of the dialog when updateDialog() is called. If the content pane has a wizard layout, this setting is ignored. The default behaviour (done by the constructor) is that it is first tried to make the OK button the default button. If it is not available, the CANCEL button and the HELP buttons are tried. If those are not available, too, then no default button is set.

Parameters:
a_defaultButton - the button to be set as default button of the dialog when updateDialog() is called, e.g. DEFAULT_BUTTON_OK or DEFAULT_BUTTON_HELP; DEFAULT_BUTTON_EMPTY will set no button as default (null), DEFAULT_BUTTON_KEEP will keep whatever has been set before

getDefaultButton

public final int getDefaultButton()
Returns the button to be set as default button of the dialog when updateDialog() is called.

Returns:
the button to be set as default button of the dialog when updateDialog() is called, e.g. DEFAULT_BUTTON_OK

getDefaultButtonOperation

public final int getDefaultButtonOperation()
Returns what happens if one of the buttons is clicked. Several actions can be combined, for example ON_CLICK_DISPOSE_DIALOG | ON_YESOK_SHOW_NEXT_CONTENT will dispose the dialog on "Cancel" and "No" but will show the next content pane on "Yes" or "OK". The ON_CLICK operation definitions are always overwritten by the button-specific operation definitions. If no operation is defined for a button, it will not set a value on click automatically, that means the dialog will keep its state if no one else sets the value by calling setValue() .

Returns:
what happens if one of the buttons is clicked

setDefaultButtonOperation

public final void setDefaultButtonOperation(int a_defaultButtonOperation)
                                     throws java.lang.IllegalArgumentException
Defines what happens if one of the buttons is clicked. Several actions can be combined, for example ON_CLICK_DISPOSE_DIALOG | ON_YESOK_SHOW_NEXT_CONTENT will dispose the dialog on "Cancel" and "No" but will show the next content pane on "Yes" or "OK". The ON_CLICK operation definitions are always overwritten by the button-specific operation definitions. If no operation is defined for a button, it will not set a value on click automatically, that means the dialog will keep its state if no one else sets the value by calling setValue() . May throw an InvalidArgumentException if objects of this type do not support setting the default button operation.

It is a good idea to set additional button operations preserving the old ones, for example ON_CANCEL_DISPOSE_DIALOG | getDefaultButtonOperation(). Single button operations may be removed by, for example, getDefaultButtonOperation() - ON_CANCEL_DISPOSE_DIALOG, but before that make sure that (getDefaultButtonOperation() & ON_CANCEL_DISPOSE_DIALOG) == ON_CANCEL_DISPOSE_DIALOG returns true .

Parameters:
a_defaultButtonOperation - the default button operation
Throws:
java.lang.IllegalArgumentException - if objects of this type do not support setting the default button operation

getValue

public java.lang.Object getValue()
Optional return value that may be created by the content pane during its visibility.

Returns:
return value that may be created by the content pane during its visibility

getButtonValue

public final int getButtonValue()
Returns the button value the user has selected.

Returns:
the button value the user has selected

setButtonValue

public final void setButtonValue(int a_value)
Sets the button value. If the type is unknown, it is set to RETURN_VALUE_UNINITIALIZED.

Parameters:
a_value - the new button value

hasValidValue

public final boolean hasValidValue()
Returns if getValue() returns an other value than RETURN_VALUE_CANCEL, RETURN_VALUE_CLOSED or RETURN_VALUE_UNINITIALIZED.

Returns:
if getValue() returns an other value than RETURN_VALUE_CANCEL, RETURN_VALUE_CLOSED or RETURN_VALUE_UNINITIALIZED

isAutomaticFocusSettingEnabled

public boolean isAutomaticFocusSettingEnabled()
Returns if the automatic focus setting of the DialogContentPane class is enabled. Subclasses may override this method if they want to set the focus in their internal logic.

Returns:
if this content pane sets the focus automatically

isActive

public final boolean isActive()
Returns if this content pane is the currently active content pane in the dialog, that means that this content pane is shown if the dialog is shown.

Returns:
if this content pane is the currently active content pane in the dialog

isVisible

public final boolean isVisible()
Returns if the content pane is part of a visible dialog.

Returns:
if the content pane is part of a visible dialog

getText

public java.lang.String getText()
Returns the text that is displayed in the content pane.

Returns:
the text that is displayed in the content pane or null if no text is displayed

setText

public void setText(java.lang.String a_strText)
Use this method to set a new text for the content pane. Note that this is only possible if The new text will not influence the current size or the preferred size of the content pane and the dialog. If the text is too big to show it completely, a link is generated that opens an extra dialog to view the text. HINT: Please use this method ONLY if the whole layout ouf the content pane has already been set. Otherwise, the text size cannot be calculated correctly if the text is too big for the dialog!

Parameters:
a_strText - a new text for this content pane

getDialog

public javax.swing.RootPaneContainer getDialog()
Returns the parent Dialog. It is a JDialog or a JAPDialog.

Returns:
the parent Dialog

getDialogContentPane

private java.awt.Container getDialogContentPane()

isDialogVisible

public final boolean isDialogVisible()
Returns if the parent dialog is visible. If your content pane contains a text, please do not perform a pack() operation on a visible dialog as there is a high possibility that the auto-formatting feature will not work. Packing is recommended on invisible dialogs only.

Returns:
if the parent dialog is visible

addDialogWindowListener

public void addDialogWindowListener(java.awt.event.WindowListener a_listener)
Adds a window listener to the parent dialog.

Parameters:
a_listener - a WindowListener

addComponentListener

public void addComponentListener(java.awt.event.ComponentListener a_listener)
Adds a component listener. It it called in the following situations: The componentShown method is extremely useful if you wnat to to a specific action when the content pane is shown to the user, for example setting a focus on a special component or starting a thread.

Parameters:
a_listener - a ComponentListener

removeComponentListener

public void removeComponentListener(java.awt.event.ComponentListener a_listener)
Removes a component listener.

Parameters:
a_listener - a ComponentListener

addDialogComponentListener

public void addDialogComponentListener(java.awt.event.ComponentListener a_listener)
Adds a component listener to the parent dialog.

Parameters:
a_listener - a ComponentListener

removeDialogComponentListener

public void removeDialogComponentListener(java.awt.event.ComponentListener a_listener)
Removes a component listener from the parent dialog.

Parameters:
a_listener - a ComponentListener

removeDialogWindowListener

public void removeDialogWindowListener(java.awt.event.WindowListener a_listener)
Removes a window listener from the parent dialog.

Parameters:
a_listener - a WindowListener

isDisposed

public boolean isDisposed()

dispose

public void dispose()

closeDialog

public final void closeDialog(boolean a_bDispose)
Hides or disposed the parent dialog.

Parameters:
a_bDispose - if true, the dialog is disposed; otherwise, it is only hidden

getJAPDialog

private JAPDialog getJAPDialog()

findMessageIcon

private static javax.swing.Icon findMessageIcon(javax.swing.JOptionPane a_optionPane)

printStatusMessageInternal

private final int printStatusMessageInternal(java.lang.String a_strMessage,
                                             int a_messageType)

setNextContentPane

private void setNextContentPane(DialogContentPane a_nextContentPane)

moveToContentPane

private boolean moveToContentPane(boolean a_bNext)
Shows a given content pane in the dialog if it exists. Otherwise, the dialog is closed according to the default ON_CLICK operation. If no ON_CLICK operation is set, nothing is done by default. If the content pane exists, its checkUpdate() method is interpreted and the errors are handled.

Parameters:
a_bNext - true if a move to the next content pane is done; false if a move to the previous content pane is done
Returns:
if a move to the given content pane was done; false if no previous content pane does exist or if it refused to update the dialog

checkErrors

private boolean checkErrors(DialogContentPane.CheckError[] a_errors,
                            java.util.Vector a_rememberedErrors)
Undos all error actions of the remembered errors, checks if the given array of errors contains one or more errors and adds those errors to the vector of remembered errors.

Parameters:
a_errors - CheckError[]
a_rememberedErrors - Vector
Returns:
false if the given array of errors contains one or more errors

createDefaultOptions

private void createDefaultOptions()

addHelpButton

private javax.swing.JButton addHelpButton()

createWizardOptions

private void createWizardOptions()

setTextOfWizardNextButton

private void setTextOfWizardNextButton()

setMouseListener

public void setMouseListener(java.awt.event.MouseListener a_listener)

createOptions

private void createOptions()

isSomethingDoneOnClick

private boolean isSomethingDoneOnClick(DialogContentPane.CheckError[] a_errors,
                                       int a_opNext,
                                       int a_opPrevious,
                                       int a_opHide,
                                       int a_opDispose)
Returns true if the click on a specific button will do an automatic action.

Parameters:
a_errors - CheckError[]
a_opNext - int
a_opPrevious - int
a_opHide - int
a_opDispose - int
Returns:
true if the click on a specific button will do an automatic action; false otherwise

doDefaultButtonOperation

private boolean doDefaultButtonOperation(DialogContentPane.CheckError[] a_errors,
                                         int a_opNext,
                                         int a_opPrevious,
                                         int a_opHide,
                                         int a_opDispose)