|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.util.gui.DialogUtil
public class DialogUtil
Utility class with static methods for commonly used dialogs.
Constructor Summary | |
---|---|
DialogUtil()
|
Method Summary | |
---|---|
static void |
addExceptionHandler(ExceptionHandler handler)
Add an exception handler, to be called whenever DialogUtil.error(Exception) is called. |
static int |
confirm(java.awt.Component parentComponent,
java.lang.String msg)
Display a confirm dialog with YES, NO, CANCEL buttons and return a JOptionPane constant indicating the choice. |
static int |
confirm(java.lang.String msg)
Display a confirm dialog with YES, NO, CANCEL buttons and return a JOptionPane constant indicating the choice. |
static void |
error(java.awt.Component parentComponent,
java.lang.Exception e)
Report an error message based on the given exception. |
static void |
error(java.awt.Component parentComponent,
java.lang.String msg)
Report an error message. |
static void |
error(java.lang.Exception e)
Report an error message based on the given exception. |
static void |
error(java.lang.String msg)
Report an error message. |
static javax.swing.JDesktopPane |
getDesktop()
This should be called if you want to use internal dialogs |
static java.lang.String |
input(java.awt.Component parentComponent,
java.lang.String msg)
Get an input string from the user and return it. |
static java.lang.Object |
input(java.awt.Component parentComponent,
java.lang.String msg,
java.lang.Object[] choices,
java.lang.Object initialValue)
Get a choice from the user and return it. |
static java.lang.String |
input(java.awt.Component parentComponent,
java.lang.String msg,
java.lang.String initialValue)
Get an input string from the user and return it. |
static java.lang.String |
input(java.lang.String msg)
Get an input string from the user and return it. |
static void |
message(java.awt.Component parentComponent,
java.lang.String msg)
Display an informational message. |
static void |
message(java.lang.String msg)
Display an informational message. |
static void |
removeExceptionHandler(ExceptionHandler handler)
Remove an exception handler |
static void |
setDesktop(javax.swing.JDesktopPane d)
This should be called if you want to use internal dialogs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DialogUtil()
Method Detail |
---|
public static void setDesktop(javax.swing.JDesktopPane d)
public static javax.swing.JDesktopPane getDesktop()
public static void addExceptionHandler(ExceptionHandler handler)
public static void removeExceptionHandler(ExceptionHandler handler)
public static void error(java.awt.Component parentComponent, java.lang.String msg)
parentComponent
- display the dialog over the given componentmsg
- the error messagepublic static void error(java.lang.String msg)
msg
- the error messagepublic static void error(java.awt.Component parentComponent, java.lang.Exception e)
parentComponent
- display the dialog over the given componente
- the exception containing the error informationpublic static void error(java.lang.Exception e)
e
- the exception containing the error informationpublic static void message(java.awt.Component parentComponent, java.lang.String msg)
parentComponent
- display the dialog over the given componentmsg
- the messagepublic static void message(java.lang.String msg)
msg
- the messagepublic static java.lang.String input(java.awt.Component parentComponent, java.lang.String msg, java.lang.String initialValue)
parentComponent
- display the dialog over the given componentmsg
- the message to displayinitialValue
- the initial value to display
public static java.lang.String input(java.awt.Component parentComponent, java.lang.String msg)
parentComponent
- display the dialog over the given componentmsg
- the message to display
public static java.lang.String input(java.lang.String msg)
msg
- the message to display
public static java.lang.Object input(java.awt.Component parentComponent, java.lang.String msg, java.lang.Object[] choices, java.lang.Object initialValue)
parentComponent
- display the dialog over the given componentmsg
- the message to displaychoices
- an array of items to choose frominitialValue
- the initial value to display
public static int confirm(java.awt.Component parentComponent, java.lang.String msg)
parentComponent
- display the dialog over the given componentmsg
- the message to display
public static int confirm(java.lang.String msg)
msg
- the message to display
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |