org.zkoss.zk.ui.util
Class Clients

java.lang.Object
  extended by org.zkoss.zk.ui.util.Clients

public class Clients
extends java.lang.Object

Utilities to send AuResponse to the client.

Utilities here are mainly to control how the client (aka., the browser window) behaves. To get the status, you might refer to ClientInfoEvent.

Author:
tomyeh
See Also:
ClientInfoEvent

Constructor Summary
Clients()
           
 
Method Summary
static void closeErrorBox(Component owner)
          Closes the error box at the browser belonging to the specified component, if any.
static void confirmClose(java.lang.String mesg)
          Asks the browser to confirm users whether to close the browser window.
static void evalJavaScript(java.lang.String javaScript)
          Asks the browser to evaluate the specified JavaScript.
static void moveBy(int x, int y)
          Moves the current desktop (aka., browser window) by the specified number of pixels.
static void moveTo(int x, int y)
          Moves the current desktop (aka., browser window) to the specified location (in pixels).
static void print()
          Prints the current desktop (aka., browser window) to the client the printer.
static void resizeBy(int x, int y)
          Resizes the current desktop (aka., browser window) by the specified number of pixels.
static void resizeTo(int x, int y)
          Resizes the current desktop (aka., browser window) to the specified size (in pixels).
static void response(AuResponse response)
          Sends an AU response (AuResponse)to the client.
static void scrollBy(int x, int y)
          Scrolls the current desktop (aka., browser window) by the specified number of pixels.
static void scrollTo(int x, int y)
          Scrolls the current desktop (aka., browser window) to the specified location (in pixels).
static void submitForm(Component form)
          Submits the form with the specified form.
static void submitForm(java.lang.String formId)
          Submits the form with the specified ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clients

public Clients()
Method Detail

response

public static final void response(AuResponse response)
Sends an AU response (AuResponse)to the client.

Since:
3.0.0

confirmClose

public static final void confirmClose(java.lang.String mesg)
Asks the browser to confirm users whether to close the browser window.

If an non-null (non-empty) string is set, the browser will show up a confirmation dialog when an user tries to close the browser window, or browse to another URL. To reset (i.e., not showing any confirmation dialog), just call this method again with null.

Parameters:
mesg - the message to show when confirming users. If null (default) or emtpy, users can close the browser window directly.

closeErrorBox

public static final void closeErrorBox(Component owner)
Closes the error box at the browser belonging to the specified component, if any.


submitForm

public static final void submitForm(java.lang.String formId)
Submits the form with the specified ID.


submitForm

public static final void submitForm(Component form)
Submits the form with the specified form. It assumes the form component is a HTML form.


print

public static void print()
Prints the current desktop (aka., browser window) to the client the printer.


scrollBy

public static final void scrollBy(int x,
                                  int y)
Scrolls the current desktop (aka., browser window) by the specified number of pixels. If the number passed is positive, the desktop is scrolled down. If negative, it is scrolled up.

See Also:
scrollTo(int, int)

scrollTo

public static final void scrollTo(int x,
                                  int y)
Scrolls the current desktop (aka., browser window) to the specified location (in pixels).

See Also:
scrollBy(int, int)

resizeBy

public static final void resizeBy(int x,
                                  int y)
Resizes the current desktop (aka., browser window) by the specified number of pixels. If the numbers passed are positive, the desktop size is increased. Negative numbers reduce the size of the desktop.

See Also:
resizeTo(int, int)

resizeTo

public static final void resizeTo(int x,
                                  int y)
Resizes the current desktop (aka., browser window) to the specified size (in pixels).

See Also:
resizeBy(int, int)

moveBy

public static final void moveBy(int x,
                                int y)
Moves the current desktop (aka., browser window) by the specified number of pixels. If the number passed is positive, the desktop is moved down. If negative, it is moved up.

See Also:
moveTo(int, int)

moveTo

public static final void moveTo(int x,
                                int y)
Moves the current desktop (aka., browser window) to the specified location (in pixels).

See Also:
moveBy(int, int)

evalJavaScript

public static final void evalJavaScript(java.lang.String javaScript)
Asks the browser to evaluate the specified JavaScript.

It has no effect if the client doesn't support JavaScript.

Parameters:
javaScript - the javaScript codes to run at the browser


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