org.zkoss.zul
Class Messagebox

java.lang.Object
  extended by org.zkoss.zul.Messagebox

public class Messagebox
extends java.lang.Object

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.

Author:
tomyeh

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.
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 button, 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 button, 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 button, java.lang.String icon)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUESTION

public static final java.lang.String QUESTION
A symbol consisting of a question mark in a circle.

See Also:
Constant Field Values

EXCLAMATION

public static final java.lang.String EXCLAMATION
A symbol consisting of an exclamation point in a triangle with a yellow background.

See Also:
Constant Field Values

INFORMATION

public static final java.lang.String INFORMATION
A symbol of a lowercase letter i in a circle.

See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
A symbol consisting of a white X in a circle with a red background.

See Also:
Constant Field Values

NONE

public static final java.lang.String NONE
Contains no symbols.


OK

public static final int OK
A OK button.

See Also:
Constant Field Values

CANCEL

public static final int CANCEL
A Cancel button.

See Also:
Constant Field Values

YES

public static final int YES
A Yes button.

See Also:
Constant Field Values

NO

public static final int NO
A No button.

See Also:
Constant Field Values

ABORT

public static final int ABORT
A Abort button.

See Also:
Constant Field Values

RETRY

public static final int RETRY
A Retry button.

See Also:
Constant Field Values

IGNORE

public static final int IGNORE
A IGNORE button.

See Also:
Constant Field Values
Constructor Detail

Messagebox

public Messagebox()
Method Detail

show

public static final int show(java.lang.String message,
                             java.lang.String title,
                             int buttons,
                             java.lang.String icon)
                      throws java.lang.InterruptedException
Shows a message box and returns what button is pressed.

Parameters:
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 assumed
icon - one of predefined images: QUESTION, EXCLAMATION, ERROR, NONE, or any URI of an image.
Returns:
the button being pressed (one of OK, CANCEL, YES, NO, ABORT, RETRY, and IGNORE).
Throws:
java.lang.InterruptedException

show

public static final int show(java.lang.String message)
                      throws java.lang.InterruptedException
Shows a message box and returns what button is pressed. A shortcut to show(message, null, OK, INFORMATION).

Throws:
java.lang.InterruptedException

show

public static final int show(int messageCode,
                             java.lang.Object[] args,
                             int titleCode,
                             int button,
                             java.lang.String icon)
                      throws java.lang.InterruptedException
Shows a message box by specifying a message code, and returns what button is pressed.

Parameters:
titleCode - the message code for the title. If non-positive, the default title is used.
Throws:
java.lang.InterruptedException

show

public static final int show(int messageCode,
                             java.lang.Object arg,
                             int titleCode,
                             int button,
                             java.lang.String icon)
                      throws java.lang.InterruptedException
Shows a message box by specifying a message code, and returns what button is pressed.

Parameters:
titleCode - the message code for the title. If non-positive, the default title is used.
Throws:
java.lang.InterruptedException

show

public static final int show(int messageCode,
                             int titleCode,
                             int button,
                             java.lang.String icon)
                      throws java.lang.InterruptedException
Shows a message box by specifying a message code, and returns what button is pressed.

Parameters:
titleCode - the message code for the title. If non-positive, the default title is used.
Throws:
java.lang.InterruptedException

setTemplate

public static void setTemplate(java.lang.String uri)
Sets the template used to create the message dialog.

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.


getTemplate

public static java.lang.String getTemplate()
Returns the template used to create the message dialog.



Copyright © 2005-2007 Potix Corporation. All Rights Reserved.