|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gwtext.client.widgets.MessageBox
public class MessageBox
Utility class for generating different styles of message boxes.
Note that the MessageBox is asynchronous. Unlike a regular JavaScript alert (which will halt browser execution), showing a MessageBox will not cause the code to stop. For this reason, if you have code that should only run after some user feedback from the MessageBox, you must use a callback function.
Nested Class Summary | |
---|---|
static interface |
MessageBox.AlertCallback
|
static class |
MessageBox.Button
|
static interface |
MessageBox.ConfirmCallback
|
static interface |
MessageBox.PromptCallback
|
Field Summary | |
---|---|
static MessageBox.Button |
CANCEL
|
static java.lang.String |
ERROR
|
static java.lang.String |
INFO
|
static MessageBox.Button |
OK
|
static MessageBox.Button |
OKCANCEL
|
static java.lang.String |
QUESTION
|
static java.lang.String |
WARNING
|
static MessageBox.Button |
YESNO
|
static MessageBox.Button |
YESNOCANCEL
|
Constructor Summary | |
---|---|
MessageBox()
|
Method Summary | |
---|---|
static void |
alert(java.lang.String message)
Displays a standard read-only message box with an OK button (comparable to the basic JavaScript Window.alert). |
static void |
alert(java.lang.String title,
java.lang.String message)
Displays a standard read-only message box with an OK button (comparable to the basic JavaScript Window.alert). |
static void |
alert(java.lang.String title,
java.lang.String message,
MessageBox.AlertCallback cb)
Displays a standard read-only message box with an OK button (comparable to the basic JavaScript Window.alert). |
static void |
confirm(java.lang.String title,
java.lang.String message)
Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's Window.confirm). |
static void |
confirm(java.lang.String title,
java.lang.String message,
MessageBox.ConfirmCallback cb)
Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's Window.confirm). |
static Window |
getDialog()
Returns a reference to the underlying Window element. |
static void |
hide()
Hides the message box if it is displayed. |
static boolean |
isVisible()
Returns true if the message box is currently displayed. |
static void |
progress(java.lang.String title,
java.lang.String message)
Displays a message box with a progress bar. |
static void |
prompt(java.lang.String title,
java.lang.String message)
Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's Window.prompt). |
static void |
prompt(java.lang.String title,
java.lang.String message,
MessageBox.PromptCallback cb)
Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's Window.prompt). |
static void |
prompt(java.lang.String title,
java.lang.String message,
MessageBox.PromptCallback cb,
boolean multiline)
Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's Window.prompt). |
static void |
setDefaultTextHeight(int height)
The default height in pixels of the message box's multiline textarea if displayed (defaults to 75). |
static void |
setIconCls(java.lang.String iconCls)
Adds the specified icon to the dialog. |
static void |
setMaxWidth(int width)
The maximum width in pixels of the message box (defaults to 600). |
static void |
setMinProgressWidth(int minProgressWidth)
The minimum width in pixels of the message box if it is a progress-style dialog. |
static void |
setMinWidth(int minWidth)
The minimum width in pixels of the message box (defaults to 100). |
static void |
show(MessageBoxConfig config)
Displays a new message box, or reinitializes an existing message box, based on the config options passed in. |
static void |
updateProgress(int percentage)
Updates a progress-style message box's text and progress bar. |
static void |
updateProgress(int percentage,
java.lang.String message)
Updates a progress-style message box's text and progress bar. |
static void |
updateText(java.lang.String message)
Updates the message box body text. |
static void |
wait(java.lang.String message)
Displays a message box with an infinitely auto-updating progress bar. |
static void |
wait(java.lang.String message,
java.lang.String title)
Displays a message box with an infinitely auto-updating progress bar. |
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 INFO
public static java.lang.String QUESTION
public static java.lang.String WARNING
public static java.lang.String ERROR
public static MessageBox.Button CANCEL
public static MessageBox.Button OK
public static MessageBox.Button OKCANCEL
public static MessageBox.Button YESNO
public static MessageBox.Button YESNOCANCEL
Constructor Detail |
---|
public MessageBox()
Method Detail |
---|
public static void alert(java.lang.String message)
message
- the messagepublic static void alert(java.lang.String title, java.lang.String message)
title
- the titlemessage
- the messagepublic static void alert(java.lang.String title, java.lang.String message, MessageBox.AlertCallback cb)
title
- the titlemessage
- the messagecb
- the callback functionpublic static void confirm(java.lang.String title, java.lang.String message)
title
- the titlemessage
- the messagepublic static void confirm(java.lang.String title, java.lang.String message, MessageBox.ConfirmCallback cb)
title
- the titlemessage
- the messagecb
- the callback functionpublic static void hide()
public static boolean isVisible()
public static void progress(java.lang.String title, java.lang.String message)
updateProgress(int)
and closing the message
box when the process is complete.
title
- the titlemessage
- the messagepublic static void prompt(java.lang.String title, java.lang.String message)
title
- the titlemessage
- the messagepublic static void prompt(java.lang.String title, java.lang.String message, MessageBox.PromptCallback cb)
title
- the titlemessage
- the messagecb
- the prompt callbackpublic static void prompt(java.lang.String title, java.lang.String message, MessageBox.PromptCallback cb, boolean multiline)
title
- the titlemessage
- the messagemultiline
- true for multilinecb
- the prompt callbackpublic static void setIconCls(java.lang.String iconCls)
MessageBox.INFO MessageBox.WARNING MessageBox.QUESTION MessageBox.ERROR
iconCls
- a CSS classname specifying the icon's background image url, or empty string to clear the iconpublic static void show(MessageBoxConfig config)
config
- the message box configpublic static void updateProgress(int percentage)
progress(String, String)
or by calling show(com.gwtext.client.widgets.MessageBoxConfig)
with progress config value true.
percentage
- the progress percentagepublic static void updateProgress(int percentage, java.lang.String message)
progress(String, String)
or by calling show(com.gwtext.client.widgets.MessageBoxConfig)
with progress config value true.
percentage
- the progress percentagemessage
- the progress messagepublic static void updateText(java.lang.String message)
message
- Replaces the message box element's innerHTML with the specified string (defaults to the XHTML-compliant non-breaking space character ' ')public static void wait(java.lang.String message)
message
- the wait messagepublic static void wait(java.lang.String message, java.lang.String title)
message
- the wait messagetitle
- the titlepublic static void setDefaultTextHeight(int height)
height
- the default heightpublic static void setMaxWidth(int width)
width
- the max widthpublic static void setMinProgressWidth(int minProgressWidth)
minProgressWidth
- the min progress widthpublic static void setMinWidth(int minWidth)
minWidth
- the min widthpublic static Window getDialog()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |