|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gui.dialog.DialogContentPane
public class DialogContentPane
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.
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
|
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 |
---|
private static final int[] MESSAGE_TYPES
private static final javax.swing.Icon[] MESSAGE_ICONS
public static final int ON_CLICK_DO_NOTHING
public static final int ON_CLICK_HIDE_DIALOG
public static final int ON_CLICK_DISPOSE_DIALOG
public static final int ON_CLICK_SHOW_NEXT_CONTENT
public static final int ON_YESOK_SHOW_NEXT_CONTENT
public static final int ON_NO_SHOW_NEXT_CONTENT
public static final int ON_CANCEL_SHOW_NEXT_CONTENT
public static final int ON_CLICK_SHOW_PREVIOUS_CONTENT
public static final int ON_YESOK_SHOW_PREVIOUS_CONTENT
public static final int ON_NO_SHOW_PREVIOUS_CONTENT
public static final int ON_CANCEL_SHOW_PREVIOUS_CONTENT
public static final int ON_YESOK_HIDE_DIALOG
public static final int ON_NO_HIDE_DIALOG
public static final int ON_CANCEL_HIDE_DIALOG
public static final int ON_YESOK_DISPOSE_DIALOG
public static final int ON_NO_DISPOSE_DIALOG
public static final int ON_CANCEL_DISPOSE_DIALOG
public static final int BUTTON_OPERATION_WIZARD
public static final java.lang.String MSG_OK
public static final java.lang.String MSG_YES
public static final java.lang.String MSG_NO
public static final java.lang.String MSG_NEXT
public static final java.lang.String MSG_PREVIOUS
public static final java.lang.String MSG_FINISH
public static final java.lang.String MSG_CANCEL
public static final java.lang.String MSG_OPERATION_FAILED
public static final java.lang.String MSG_SEE_FULL_MESSAGE
public static final int DEFAULT_BUTTON_EMPTY
public static final int DEFAULT_BUTTON_CANCEL
public static final int DEFAULT_BUTTON_YES
public static final int DEFAULT_BUTTON_OK
public static final int DEFAULT_BUTTON_NO
public static final int DEFAULT_BUTTON_HELP
public static final int DEFAULT_BUTTON_KEEP
private static final int MIN_TEXT_WIDTH
private static final int UNLIMITED_SIZE
private static final int SPACE_AROUND_TEXT
private static final java.lang.String MORE_POINTS
private static final int NUMBER_OF_HEURISTIC_ITERATIONS
private DialogContentPane m_nextContentPane
private DialogContentPane m_previousContentPane
private javax.swing.RootPaneContainer m_parentDialog
private javax.swing.JComponent m_contentPane
private javax.swing.JPanel m_titlePane
private javax.swing.JPanel m_rootPane
private java.awt.Container m_panelOptions
private JAPHtmlMultiLineLabel m_lblMessage
private DialogContentPane.LinkedDialog m_linkedDialog
private JAPHtmlMultiLineLabel m_lblText
private JAPHtmlMultiLineLabel m_lblSeeFullText
private int m_defaultButtonOperation
private int m_value
private JAPHelpContext.IHelpContext m_helpContext
private javax.swing.JButton m_btnHelp
private javax.swing.JButton m_btnYesOK
private javax.swing.JButton m_btnNo
private javax.swing.JButton m_btnCancel
private DialogContentPane.ButtonListener m_buttonListener
private javax.swing.Icon m_icon
private boolean m_bHasHadWizardLayout
private java.awt.GridBagConstraints m_textConstraints
private java.util.Vector m_rememberedErrors
private java.util.Vector m_rememberedUpdateErrors
private java.awt.Container m_currentlyActiveContentPane
private java.util.Vector m_componentListeners
private java.awt.event.ComponentListener m_currentlyActiveContentPaneComponentListener
private int m_defaultButton
private java.lang.String m_strText
private javax.swing.JDialog m_tempDialog
private boolean m_bDisposed
private DialogContentPaneOptions m_options
private DialogContentPane.Layout m_layout
private int m_idStatusMessage
Constructor Detail |
---|
public DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText)
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.public DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText)
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.public DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout)
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, ...)public DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout)
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, ...)public DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(javax.swing.JDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(JAPDialog a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(javax.swing.JDialog a_parentDialog)
a_parentDialog
- the parent dialog; a content pane is always registered to a dialog, and
may not change it in lifetime.public DialogContentPane(JAPDialog a_parentDialog)
a_parentDialog
- the parent dialog; a content pane is always registered to a dialog, and
may not change it in lifetime.public DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPane.Layout a_layout)
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, ...)public DialogContentPane(JAPDialog a_parentDialog, DialogContentPane.Layout a_layout)
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, ...)public DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(JAPDialog a_parentDialog, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(javax.swing.JDialog a_parentDialog, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
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 definitionspublic DialogContentPane(JAPDialog a_parentDialog, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
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 definitionsprivate DialogContentPane(javax.swing.RootPaneContainer a_parentDialog, java.lang.String a_strText, DialogContentPane.Layout a_layout, DialogContentPaneOptions a_options)
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 definitionsMethod Detail |
---|
public static javax.swing.Icon getMessageIcon(int a_messageType)
public void updateDialogOptimalSized()
public static void updateDialogOptimalSized(DialogContentPane a_firstContentPane)
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!
a_firstContentPane
- the first DialogContentPane in a chain of content panes; this method will
call updateDialog()
on it to initialise the dialogpublic final boolean hasPreviousContentPane()
public final boolean hasNextContentPane()
public final boolean hasWizardLayout()
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.
public final DialogContentPane getNextContentPane()
public final DialogContentPane getPreviousContentPane()
public final boolean moveToPreviousContentPane()
public DialogContentPane.CheckError[] checkYesOK()
null
by default.
This method should never be called directly and is only used internally.
public DialogContentPane.CheckError[] checkNo()
null
by default.
This method should never be called directly and is only used internally.
public DialogContentPane.CheckError[] checkCancel()
null
by default.
This method should never be called directly and is only used internally.
public DialogContentPane.CheckError[] checkUpdate()
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.
public boolean isSkippedAsNextContentPane()
false
by default but may be overwritten by subclasses.
public boolean isMoveBackAllowed()
public boolean isMoveForwardAllowed()
public boolean isSkippedAsPreviousContentPane()
false
by default but may be overwritten by subclasses.
public final boolean moveToNextContentPane()
public final javax.swing.JComponent getContentPane()
public final void showDialog()
public final void setContentPane(javax.swing.JComponent a_contentPane)
a_contentPane
- JComponentpublic final java.lang.String getHelpContext()
getHelpContext
in interface JAPHelpContext.IHelpContext
public java.awt.Component getHelpExtractionDisplayContext()
getHelpExtractionDisplayContext
in interface JAPHelpContext.IHelpContext
public final void clearStatusMessage(int a_messageID)
public final void clearStatusMessage()
public final void printStatusMessage(java.lang.String a_message)
a_message
- an information messagepublic final void printStatusMessage(java.lang.String a_message, int a_messageType)
a_message
- a status messagea_messageType
- the message type; this has a influence on how the message is displayed
(color, icon,...).public final int printErrorStatusMessage(int a_logType, java.lang.Throwable a_throwable)
a_logType
- the log type of this errora_throwable
- a Throwable that has been catched in the context of this errorpublic final int printErrorStatusMessage(java.lang.String a_message, int a_logType)
a_message
- an error messagea_logType
- the log type of this errorpublic final int printErrorStatusMessage(java.lang.String a_message, int a_logType, java.lang.Throwable a_throwable)
a_message
- an error messagea_logType
- the log type of this errora_throwable
- a Throwable that has been catched in the context of this errorpublic final void validateDialog()
public final DialogContentPane.CheckError[] updateDialog()
private final DialogContentPane.CheckError[] updateDialog(boolean a_bCheckUpdate)
a_bCheckUpdate
- if checkUpdate should be called
private int printErrorStatusMessage(java.lang.String a_message, int a_logType, java.lang.Throwable a_throwable, boolean a_bShow)
a_message
- an error messagea_logType
- the log type of this errora_throwable
- a Throwable that has been catched in the context of this errora_bShow
- if the message is shown to the user or logged onlyprivate final DialogContentPane.CheckError[] updateDialog(int a_maxTextWidth, boolean a_bCallCheckUpdate)
a_maxTextWidth
- the maximum width that is allowed for the (optional) text fielda_bCallCheckUpdate
- if checkUpdate should be called
public final javax.swing.JButton getButtonHelp()
public final javax.swing.JButton getButtonCancel()
public final javax.swing.JButton getButtonYesOK()
public final javax.swing.JButton getButtonNo()
public final void setDefaultButton(int a_defaultButton)
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 beforepublic final int getDefaultButton()
public final int getDefaultButtonOperation()
setValue()
.
public final void setDefaultButtonOperation(int a_defaultButtonOperation) throws java.lang.IllegalArgumentException
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
.
a_defaultButtonOperation
- the default button operation
java.lang.IllegalArgumentException
- if objects of this type do not support setting the default
button operationpublic java.lang.Object getValue()
public final int getButtonValue()
public final void setButtonValue(int a_value)
a_value
- the new button valuepublic final boolean hasValidValue()
getValue()
returns an other value than RETURN_VALUE_CANCEL,
RETURN_VALUE_CLOSED or RETURN_VALUE_UNINITIALIZED.
getValue()
returns an other value than RETURN_VALUE_CANCEL,
RETURN_VALUE_CLOSED or RETURN_VALUE_UNINITIALIZEDpublic boolean isAutomaticFocusSettingEnabled()
public final boolean isActive()
public final boolean isVisible()
public java.lang.String getText()
null
if no text is displayedpublic void setText(java.lang.String a_strText)
a_strText
- a new text for this content panepublic javax.swing.RootPaneContainer getDialog()
private java.awt.Container getDialogContentPane()
public final boolean isDialogVisible()
public void addDialogWindowListener(java.awt.event.WindowListener a_listener)
a_listener
- a WindowListenerpublic void addComponentListener(java.awt.event.ComponentListener a_listener)
a_listener
- a ComponentListenerpublic void removeComponentListener(java.awt.event.ComponentListener a_listener)
a_listener
- a ComponentListenerpublic void addDialogComponentListener(java.awt.event.ComponentListener a_listener)
a_listener
- a ComponentListenerpublic void removeDialogComponentListener(java.awt.event.ComponentListener a_listener)
a_listener
- a ComponentListenerpublic void removeDialogWindowListener(java.awt.event.WindowListener a_listener)
a_listener
- a WindowListenerpublic boolean isDisposed()
public void dispose()
public final void closeDialog(boolean a_bDispose)
a_bDispose
- if true, the dialog is disposed; otherwise, it is only hiddenprivate JAPDialog getJAPDialog()
private static javax.swing.Icon findMessageIcon(javax.swing.JOptionPane a_optionPane)
private final int printStatusMessageInternal(java.lang.String a_strMessage, int a_messageType)
private void setNextContentPane(DialogContentPane a_nextContentPane)
private boolean moveToContentPane(boolean a_bNext)
a_bNext
- true if a move to the next content pane is done; false if a move to
the previous content pane is done
private boolean checkErrors(DialogContentPane.CheckError[] a_errors, java.util.Vector a_rememberedErrors)
a_errors
- CheckError[]a_rememberedErrors
- Vector
private void createDefaultOptions()
private javax.swing.JButton addHelpButton()
private void createWizardOptions()
private void setTextOfWizardNextButton()
public void setMouseListener(java.awt.event.MouseListener a_listener)
private void createOptions()
private boolean isSomethingDoneOnClick(DialogContentPane.CheckError[] a_errors, int a_opNext, int a_opPrevious, int a_opHide, int a_opDispose)
a_errors
- CheckError[]a_opNext
- inta_opPrevious
- inta_opHide
- inta_opDispose
- int
private boolean doDefaultButtonOperation(DialogContentPane.CheckError[] a_errors, int a_opNext, int a_opPrevious, int a_opHide, int a_opDispose)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |