|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.glaivestone.javax.swing.MessageDialog
The MessageDialog
class is used to display notification
and confirmation messages.
This class exists primarily to compensate for deficiencies
in the underlying Swing JOptionPane
dialog.
The purpose of a view should be to present its content
to the user in a readable fashion, but JOptionPane
is regrettably too stupid to compute a proper rendering for text that
needs line wrapping or line breaks in order to make its content visible.
This should emphatically not be the client's problem - they should be able
to expect that the text they give to the dialog is presented reasonably,
without having to compute the presentation themselves.
This class was inspired by the Visual Smalltalk MessageBox class, an easy-to-use facility for display user messages.
Field Summary | |
static java.lang.String |
DEFAULT_CONFIRMER_TITLE
|
static java.lang.String |
DEFAULT_ERROR_NOTIFIER_TITLE
|
static java.lang.String |
DEFAULT_INFORMATION_NOTIFIER_TITLE
|
static java.lang.String |
DEFAULT_WARNING_NOTIFIER_TITLE
|
static int |
multiLineMessageThreshold
The maximum number of characters in a message before switching to a multi-line text component which provides line breaking. |
static int |
RESULT_ACCEPTED
|
static int |
RESULT_CANCELLED
|
static int |
RESULT_REJECTED
|
static boolean |
TRACE_SIZING
|
static boolean |
USE_WIDTH_HEURISTIC
|
Method Summary | |
static java.lang.Object |
composeMessageArgument(java.lang.String message)
Compose the argument to pass to JOptionPane for a message string. |
static boolean |
confirm(java.lang.String message,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static boolean |
confirm(java.lang.String message,
int optionType,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static boolean |
confirm(java.lang.String title,
java.lang.String message,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static boolean |
confirm(java.lang.String title,
java.lang.String message,
int optionType,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static int |
confirmOrCancel(java.lang.String message,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static int |
confirmOrCancel(java.lang.String title,
java.lang.String message,
java.awt.Component client)
Display a confirmation dialog that prompts the user to confirm or deny a proposition. |
static void |
displayError(java.lang.String message,
java.awt.Component client)
Display an error message to the user. |
static void |
displayError(java.lang.String title,
java.lang.String message,
java.awt.Component client)
Display an error message to the user. |
static void |
displayMessage(java.lang.String message,
java.awt.Component client)
Display an information message to the user. |
static void |
displayMessage(java.lang.String title,
java.lang.String message,
java.awt.Component client)
Display an information message to the user. |
static void |
displayMessage(java.lang.String title,
java.lang.String message,
int messageType,
java.awt.Component client)
Display a notification message to the user with the given title and message on behalf of a requesting window. |
static void |
displayWarning(java.lang.String message,
java.awt.Component client)
Display a warning message to the user. |
static void |
displayWarning(java.lang.String title,
java.lang.String message,
java.awt.Component client)
Display a warning message to the user. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RESULT_ACCEPTED
public static final int RESULT_REJECTED
public static final int RESULT_CANCELLED
public static final java.lang.String DEFAULT_CONFIRMER_TITLE
public static final java.lang.String DEFAULT_INFORMATION_NOTIFIER_TITLE
public static final java.lang.String DEFAULT_WARNING_NOTIFIER_TITLE
public static final java.lang.String DEFAULT_ERROR_NOTIFIER_TITLE
public static int multiLineMessageThreshold
public static boolean USE_WIDTH_HEURISTIC
public static boolean TRACE_SIZING
Method Detail |
public static java.lang.Object composeMessageArgument(java.lang.String message)
JOptionPane
for a message string.
Message with line breaks or which require line wrapping in order
to present long text messages are prepared with a suitably
multi-line text component.
public static boolean confirm(java.lang.String message, java.awt.Component client)
public static boolean confirm(java.lang.String message, int optionType, java.awt.Component client)
public static boolean confirm(java.lang.String title, java.lang.String message, java.awt.Component client)
public static boolean confirm(java.lang.String title, java.lang.String message, int optionType, java.awt.Component client)
public static int confirmOrCancel(java.lang.String message, java.awt.Component client)
public static int confirmOrCancel(java.lang.String title, java.lang.String message, java.awt.Component client)
public static void displayError(java.lang.String message, java.awt.Component client)
public static void displayError(java.lang.String title, java.lang.String message, java.awt.Component client)
public static void displayMessage(java.lang.String message, java.awt.Component client)
public static void displayMessage(java.lang.String title, java.lang.String message, java.awt.Component client)
public static void displayMessage(java.lang.String title, java.lang.String message, int messageType, java.awt.Component client)
public static void displayWarning(java.lang.String message, java.awt.Component client)
public static void displayWarning(java.lang.String title, java.lang.String message, java.awt.Component client)
|
GFL 1.1 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |