|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.util.Clients
public class Clients
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.
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 |
closeErrorBox(Component[] comps)
Closes all the error boxes at the browser belonging to the specified array of components, if any. |
static void |
closeErrorBox(java.util.List comps)
Closes all the error boxes at the browser belonging to the specified list of components, 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()
Asks the client to print the current desktop (aka., browser window). |
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
with response's command (AuResponse.getCommand()) as the key. |
static void |
response(java.lang.String key,
AuResponse response)
Sends an AU response ( AuResponse) to the client
with the specified key. |
static void |
scrollBy(int x,
int y)
Scrolls the current desktop (aka., browser window) by the specified number of pixels. |
static void |
scrollIntoView(Component cmp)
Scrolls the ancestor elements to make the specified element visible. |
static void |
scrollTo(int x,
int y)
Scrolls the current desktop (aka., browser window) to the specified location (in pixels). |
static void |
showBusy(java.lang.String msg,
boolean open)
Asks the browser to show the busy message such that the user knows the system is busy. |
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 |
|---|
public Clients()
| Method Detail |
|---|
public static final void response(AuResponse response)
AuResponse)to the client
with response's command (AuResponse.getCommand()) as the key.
Since response's command is used as the key, so the second invocation of this method with a response that has the same command will override the previous one. For example, the first one will be ignored since both have the same command.
response(new AuShowBusy("this will have no effect", true));
response(new AuShowBusy(null, false));
If this is an issue, use response(String, AuResponse)
instead.
public static final void response(java.lang.String key,
AuResponse response)
AuResponse) to the client
with the specified key.
key - could be anything. The second invocation of this method
in the same execution with the same key will override the previous one.
In other words, the previous one will be dropped.
If null is specified, the response is simply appended to the end
without overriding any previous one.public static final void confirmClose(java.lang.String mesg)
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.
mesg - the message to show when confirming users.
If null (default) or emtpy, users can close the browser window directly.public static final void closeErrorBox(Component owner)
public static final void closeErrorBox(java.util.List comps)
public static final void closeErrorBox(Component[] comps)
public static final void submitForm(java.lang.String formId)
public static final void submitForm(Component form)
public static void print()
public static final void scrollIntoView(Component cmp)
public static final void scrollBy(int x,
int y)
scrollTo(int, int)
public static final void scrollTo(int x,
int y)
scrollBy(int, int)
public static final void resizeBy(int x,
int y)
resizeTo(int, int)
public static final void resizeTo(int x,
int y)
resizeBy(int, int)
public static final void moveBy(int x,
int y)
moveTo(int, int)
public static final void moveTo(int x,
int y)
moveBy(int, int)public static final void evalJavaScript(java.lang.String javaScript)
It has no effect if the client doesn't support JavaScript.
javaScript - the javaScript codes to run at the browser
public static final void showBusy(java.lang.String msg,
boolean open)
It is usually used with Events.echoEvent(java.lang.String, org.zkoss.zk.ui.Component, java.lang.String)
to prevent the user to click another buttons or components.
msg - the message to show. If null, the default message (processing)
is shown. It is ignored if the open argument is false.open - whether to open or to close the busy message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||