|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zul.Messagebox
public class Messagebox
Represents the message box.
You don't create Messagebox
directly. Rather, use show(java.lang.String, java.lang.String, int, java.lang.String)
.
A non-XUL extension.
Field Summary | |
---|---|
static int |
ABORT
A Abort button. |
static int |
CANCEL
A Cancel button. |
static java.lang.String |
ERROR
A symbol consisting of a white X in a circle with a red background. |
static java.lang.String |
EXCLAMATION
A symbol consisting of an exclamation point in a triangle with a yellow background Since 3.5.0, they are actually style class names to display the icon. |
static int |
IGNORE
A IGNORE button. |
static java.lang.String |
INFORMATION
A symbol of a lowercase letter i in a circle. |
static int |
NO
A No button. |
static java.lang.String |
NONE
Contains no symbols. |
static int |
OK
A OK button. |
static java.lang.String |
QUESTION
A symbol consisting of a question mark in a circle. |
static int |
RETRY
A Retry button. |
static int |
YES
A Yes button. |
Constructor Summary | |
---|---|
Messagebox()
|
Method Summary | |
---|---|
static java.lang.String |
getTemplate()
Returns the template used to create the message dialog. |
static void |
setTemplate(java.lang.String uri)
Sets the template used to create the message dialog. |
static int |
show(int messageCode,
int titleCode,
int buttons,
java.lang.String icon)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
int titleCode,
int buttons,
java.lang.String icon,
int focus)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
int titleCode,
int buttons,
java.lang.String icon,
int focus,
EventListener listener)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object[] args,
int titleCode,
int buttons,
java.lang.String icon)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object[] args,
int titleCode,
int buttons,
java.lang.String icon,
int focus)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object[] args,
int titleCode,
int buttons,
java.lang.String icon,
int focus,
EventListener listener)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object arg,
int titleCode,
int buttons,
java.lang.String icon)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object arg,
int titleCode,
int buttons,
java.lang.String icon,
int focus)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(int messageCode,
java.lang.Object arg,
int titleCode,
int buttons,
java.lang.String icon,
int focus,
EventListener listener)
Shows a message box by specifying a message code, and returns what button is pressed. |
static int |
show(java.lang.String message)
Shows a message box and returns what button is pressed. |
static int |
show(java.lang.String message,
java.lang.String title,
int buttons,
java.lang.String icon)
Shows a message box and returns what button is pressed. |
static int |
show(java.lang.String message,
java.lang.String title,
int buttons,
java.lang.String icon,
EventListener listener)
Shows a message box and returns what button is pressed. |
static int |
show(java.lang.String message,
java.lang.String title,
int buttons,
java.lang.String icon,
int focus)
Shows a message box and returns what button is pressed. |
static int |
show(java.lang.String message,
java.lang.String title,
int buttons,
java.lang.String icon,
int focus,
EventListener listener)
Shows a message box and returns what button is pressed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String QUESTION
Since 3.5.0, they are actually style class names to display the icon.
public static final java.lang.String EXCLAMATION
Since 3.5.0, they are actually style class names to display the icon.
public static final java.lang.String INFORMATION
Since 3.5.0, they are actually style class names to display the icon.
public static final java.lang.String ERROR
Since 3.5.0, they are actually style class names to display the icon.
public static final java.lang.String NONE
public static final int OK
public static final int CANCEL
public static final int YES
public static final int NO
public static final int ABORT
public static final int RETRY
public static final int IGNORE
Constructor Detail |
---|
public Messagebox()
Method Detail |
---|
public static int show(java.lang.String message, java.lang.String title, int buttons, java.lang.String icon) throws java.lang.InterruptedException
title
- the title. If null, WebApp.getAppName()
is used.buttons
- a combination of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
. If zero, OK
is assumedicon
- one of predefined images: QUESTION
,
EXCLAMATION
, ERROR
, NONE
, or any style class
name(s) to show an image.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(java.lang.String message, java.lang.String title, int buttons, java.lang.String icon, EventListener listener) throws java.lang.InterruptedException
title
- the title. If null, WebApp.getAppName()
is used.buttons
- a combination of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
. If zero, OK
is assumedicon
- one of predefined images: QUESTION
,
EXCLAMATION
, ERROR
, NONE
, or any style class
name(s) to show an image.listener
- the event listener which is invoked when a button
is clicked. Ignored if null.
It is useful if the event processing thread is disabled
(Configuration.enableEventThread(boolean)
).
If the event processing thread is disable, this method always
return OK
. To know which button is pressed, you have to pass an
event listener. Then, when the user clicks a button, the event
listener is invoked. You can identify which button is clicked
by examining the event name (Event.getName()
) as shown
in the following table. Alternatively, you can examine the value
of Event.getData()
, which must be an
integer represetinng the button, such as OK
, YES
and so on.
Button Name | Event Name |
OK | onOK |
Cancel | onCancel |
Yes | onYes |
No | onNo |
Retry | onRetry |
Abort | onAbort |
Ignore | onIgnore |
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(java.lang.String message, java.lang.String title, int buttons, java.lang.String icon, int focus) throws java.lang.InterruptedException
title
- the title. If null, WebApp.getAppName()
is used.buttons
- a combination of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
. If zero, OK
is assumedicon
- one of predefined images: QUESTION
,
EXCLAMATION
, ERROR
, NONE
, or any style class
name(s) to show an image.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(java.lang.String message, java.lang.String title, int buttons, java.lang.String icon, int focus, EventListener listener) throws java.lang.InterruptedException
title
- the title. If null, WebApp.getAppName()
is used.buttons
- a combination of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
. If zero, OK
is assumedicon
- one of predefined images: QUESTION
,
EXCLAMATION
, ERROR
, NONE
, or any style class
name(s) to show an image.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.listener
- the event listener which is invoked when a button
is clicked. Ignored if null.
It is useful if the event processing thread is disabled
(Configuration.enableEventThread(boolean)
).
If the event processing thread is disable, this method always
return OK
. To know which button is pressed, you have to pass an
event listener. Then, when the user clicks a button, the event
listener is invoked. You can identify which button is clicked
by examining the event name (Event.getName()
) as shown
in the following table. Alternatively, you can examine the value
of Event.getData()
, which must be an
integer represetinng the button, such as OK
, YES
and so on.
Button | Event Name |
OK | onOK |
Cancel | onCancel |
Yes | onYes |
No | onNo |
Retry | onRetry |
Abort | onAbort |
Ignore | onIgnore |
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(java.lang.String message) throws java.lang.InterruptedException
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object[] args, int titleCode, int buttons, java.lang.String icon) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object[] args, int titleCode, int buttons, java.lang.String icon, int focus) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object[] args, int titleCode, int buttons, java.lang.String icon, int focus, EventListener listener) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.listener
- the event listener which is invoked when a button
is clicked. Ignored if null.
It is useful if the event processing thread is disabled
(Configuration.enableEventThread(boolean)
).
If the event processing thread is disable, this method always
return OK
. To know which button is pressed, you have to pass an
event listener. Then, when the user clicks a button, the event
listener is invoked. You can identify which button is clicked
by examining the event name (Event.getName()
) as shown
in the following table. Alternatively, you can examine the value
of Event.getData()
, which must be an
integer represetinng the button, such as OK
, YES
and so on.
Button | Event Name |
OK | onOK |
Cancel | onCancel |
Yes | onYes |
No | onNo |
Retry | onRetry |
Abort | onAbort |
Ignore | onIgnore |
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object arg, int titleCode, int buttons, java.lang.String icon) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object arg, int titleCode, int buttons, java.lang.String icon, int focus) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, java.lang.Object arg, int titleCode, int buttons, java.lang.String icon, int focus, EventListener listener) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.listener
- the event listener which is invoked when a button
is clicked. Ignored if null.
It is useful if the event processing thread is disabled
(Configuration.enableEventThread(boolean)
).
If the event processing thread is disable, this method always
return OK
. To know which button is pressed, you have to pass an
event listener. Then, when the user clicks a button, the event
listener is invoked. You can identify which button is clicked
by examining the event name (Event.getName()
) as shown
in the following table. Alternatively, you can examine the value
of Event.getData()
, which must be an
integer represetinng the button, such as OK
, YES
and so on.
Button | Event Name |
OK | onOK |
Cancel | onCancel |
Yes | onYes |
No | onNo |
Retry | onRetry |
Abort | onAbort |
Ignore | onIgnore |
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static int show(int messageCode, int titleCode, int buttons, java.lang.String icon) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.
java.lang.InterruptedException
public static int show(int messageCode, int titleCode, int buttons, java.lang.String icon, int focus) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.
java.lang.InterruptedException
public static int show(int messageCode, int titleCode, int buttons, java.lang.String icon, int focus, EventListener listener) throws java.lang.InterruptedException
titleCode
- the message code for the title. If non-positive,
the default title is used.focus
- one of button to have to focus. If 0, the first button
will gain the focus. One of OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
.listener
- the event listener which is invoked when a button
is clicked. Ignored if null.
It is useful if the event processing thread is disabled
(Configuration.enableEventThread(boolean)
).
If the event processing thread is disable, this method always
return OK
. To know which button is pressed, you have to pass an
event listener. Then, when the user clicks a button, the event
listener is invoked. You can identify which button is clicked
by examining the event name (Event.getName()
) as shown
in the following table. Alternatively, you can examine the value
of Event.getData()
, which must be an
integer represetinng the button, such as OK
, YES
and so on.
Button | Event Name |
OK | onOK |
Cancel | onCancel |
Yes | onYes |
No | onNo |
Retry | onRetry |
Abort | onAbort |
Ignore | onIgnore |
OK
, CANCEL
,
YES
, NO
, ABORT
, RETRY
,
and IGNORE
).
Note: if the event processing thread is disable, it always
returns OK
.
java.lang.InterruptedException
public static void setTemplate(java.lang.String uri)
The template must follow the default template: ~./zul/html/messagebox.zul
In other words, just adjust the label and layout and don't change the component's ID.
public static java.lang.String getTemplate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |