public class DialogUtil extends Object implements IDialogUtil
JOptionPane as container.| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
logger |
CANCEL_OPTION, CLOSED_OPTION, DEFAULT_OPTION, ERROR_MESSAGE, INFORMATION_MESSAGE, NO_OPTION, OK_CANCEL_OPTION, OK_OPTION, PLAIN_MESSAGE, QUESTION_MESSAGE, WARNING_MESSAGE, YES_NO_CANCEL_OPTION, YES_NO_OPTION, YES_OPTION| Modifier | Constructor and Description |
|---|---|
private |
DialogUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IDialogUtil |
getInstance()
Returns the current instance of the
DialogUtil object. |
void |
showDefaultErrorMessage(String errMessage)
This method creates an instance of a JOptionPane used to inform the user
about an error.
|
void |
showDefaultInfoMessage(String infoMessage)
This method creates an instance of a JOptionPane used to inform the user
about something.
|
int |
showDefaultQuestionMessage(String question)
This method creates an instance of a JOptionPane when a user is
questioned about something that requires interaction.
|
int |
showDefaultWarnMessage(String warnMessage)
This method creates an instance of a JOptionPane when a user is warned
about something that requires interaction.
|
void |
showErrorMessage(String errMessage,
Exception exception)
This method creates an instance of a JOptionPane used to inform the user
about an exception.
|
void |
showErrorMessage(String errMessage,
Exception exception,
boolean withStackTrace)
This method creates an instance of a JOptionPane used to inform the user
about an exception.
|
int |
showQuestionMessage(Window parent,
String question)
This method creates an instance of a JOptionPane when a user is
questioned about something that requires interaction.
|
int |
showWarnMessage(Component window,
String warnMessage,
String title)
This method creates an instance of a JOptionPane when a user is warned
about something that requires interaction.
|
public static IDialogUtil getInstance()
DialogUtil object. It creates
a new instance, if none is present.public void showDefaultInfoMessage(String infoMessage)
showDefaultInfoMessage in interface IDialogUtilinfoMessage - - the message to be displayedpublic int showDefaultWarnMessage(String warnMessage)
showDefaultWarnMessage in interface IDialogUtilwarnMessage - - the message to be displayedpublic int showWarnMessage(Component window, String warnMessage, String title)
showWarnMessage in interface IDialogUtilwindow - a parent window, or nullwarnMessage - the message to be displayedtitle - the title of the messagepublic void showDefaultErrorMessage(String errMessage)
showDefaultErrorMessage in interface IDialogUtilerrMessage - - the message to be displayedpublic void showErrorMessage(String errMessage, Exception exception, boolean withStackTrace)
showErrorMessage in interface IDialogUtilerrMessage - - the (additional) message to be displayedexception - - the exception to be formattedwithStackTrace - - whether or not the stack trace should be shown in the dialogpublic void showErrorMessage(String errMessage, Exception exception)
This is basically a wrapper method for
showErrorMessage(String, Exception, boolean), turning off the
printing of the stack trace to the ErrorMessagePanel.
showErrorMessage in interface IDialogUtilerrMessage - - the (additional) message to be displayedexception - - the exception to be formattedshowErrorMessage(String, Exception, boolean)public int showDefaultQuestionMessage(String question)
showDefaultQuestionMessage in interface IDialogUtilquestion - - the question to be displayedpublic int showQuestionMessage(Window parent, String question)
showQuestionMessage in interface IDialogUtilparent - - the parent windowquestion - - the question to be displayedCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.