|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.utils.MsgBox
public class MsgBox
A general-purpose message box. The idea was to come up with something
similar to (and maybe a little better than) the win32 MessageBox function.
Before swing, we did this ourselves; now, MsgBox is a simplifying wrapper
around FormDialog
, which is in turn a wrapper around
JOptionPane
.
As a workaround to a bug in Swing 1.0.1, the window title of the box is invariant across all message boxes seen in the app. The app title is the best candidate for this title. The title of the message itself (which is not invariant) is displayed as a line of larger text inside the window. This may no longer be needed - we haven't checked recently.
Field Summary | |
---|---|
static int |
ARGH
|
static java.lang.String |
boxtitle
The Window title. |
static int |
CANCEL
User selected cancel. |
static int |
INFO
A message for your information. |
static int |
LOSE
A minor problem |
static int |
NO
User selected No. |
static int |
NOALL
User selected No to All. |
static int |
YES
User selected Yes. |
static int |
YESALL
User selected Yes to All. |
Constructor Summary | |
---|---|
MsgBox()
|
Method Summary | |
---|---|
static boolean |
confirm(java.awt.Component parent,
java.lang.String title,
java.lang.Object msg)
Display an OK / Cancel confirmation dialog. |
static javax.swing.JComponent |
flushRight(javax.swing.JComponent c)
Right-align the supplied component within a panel, and return the panel. |
static void |
msg(java.awt.Component parent,
java.lang.String title,
java.lang.Object msg,
int type)
Display a multiline message box. |
static int |
multiconfirm(java.awt.Component parent,
java.lang.String title,
java.lang.Object msg)
Display a Yes / No / Cancel confirmation dialog. |
static int |
quinConfirm(java.awt.Component parent,
java.lang.String title,
java.lang.Object msg)
|
static void |
setBoxTitle(java.lang.String s)
Set the window title for all JOptionPane users within the app. |
static boolean |
ynconfirm(java.awt.Component parent,
java.lang.String title,
java.lang.Object msg)
Display a Yes / No confirmation dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String boxtitle
public static final int INFO
public static final int LOSE
public static final int ARGH
public static final int CANCEL
public static final int YES
public static final int NO
public static final int YESALL
public static final int NOALL
Constructor Detail |
---|
public MsgBox()
Method Detail |
---|
public static void setBoxTitle(java.lang.String s)
s
- The window title.public static void msg(java.awt.Component parent, java.lang.String title, java.lang.Object msg, int type)
parent
- The parent Component. May be null.title
- the "title" of the dialog.msg
- the detail message, anything that JOptionPane can relate to.type
- the type (severity) of the incident.public static boolean confirm(java.awt.Component parent, java.lang.String title, java.lang.Object msg)
parent
- The parent Component. May be null.title
- the "title" of the dialog.msg
- The detail message - anything JOptionPane can render.
public static boolean ynconfirm(java.awt.Component parent, java.lang.String title, java.lang.Object msg)
parent
- The parent Component. May be null.title
- the "title" of the dialog.msg
- The detail message - anything JOptionPane can render.
public static int multiconfirm(java.awt.Component parent, java.lang.String title, java.lang.Object msg)
parent
- The parent Component. May be null.title
- the "title" of the dialog.msg
- the detail message - anything a JOptionPane can render.
public static int quinConfirm(java.awt.Component parent, java.lang.String title, java.lang.Object msg)
public static javax.swing.JComponent flushRight(javax.swing.JComponent c)
c
- The component to right-align.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |