|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object_global_.zUtl
public class zUtl
The basic utilties.
For more utilities, refer to Utl.
| Field Summary | |
|---|---|
static String |
cellps0
A shortcut of ' cellpadding="0" cellspacing="0" border="0"'. |
static String |
i0
A shortcut of '<i style="height:0;width:0"/>'. |
static String |
img0
A shortcut of '<img style="height:0;width:0"/>'. |
| Method Summary | |
|---|---|
static void |
appendAttr(String nm,
java.lang.Object val)
Appends an attribute. |
static void |
appendAttr(String nm,
java.lang.Object val,
boolean force)
Appends an attribute. |
static String |
decodeXML(String txt)
Decodes the XML string into a normal string. |
static void |
destroyProgressbox(String id)
Removes the message box created by progressbox(_global_.String, _global_.String, boolean, _global_.String). |
static String |
encodeXML(String txt,
Map opts)
Encodes the string to a valid XML string. |
static void |
fireShown(Widget wgt,
int bfsz)
Fires onBeforeSize, onShow, onFitSize, and onSize |
static void |
fireSized(Widget wgt,
int bfsz)
Fires beforeSize, onFitSize and onSize |
static Array |
frames(Window w)
Returns all descendant frames of the given window. |
static void |
go(String url,
Map opts)
Navigates to the specified URL. |
static String |
intsToString(int[] ary)
Converts an integer array to a string (separated by comma). |
static boolean |
isAncestor(java.lang.Object p,
java.lang.Object c)
Returns if one is ancestor of the other. |
static boolean |
isChar(char cc,
Map opts)
Returns whether the character is according to its opts. |
static void |
isImageLoading()
Checks whether all the loading images are finish. |
static void |
loadImage(String url)
Loads an image before ZK client engine to calculate the widget's layout. |
static String |
mapToString(Map map,
String assign,
String separator)
Converts a map to a string |
static long |
now()
Deprecated. As of release 5.0.6, replaced with jq.now(). |
static Map |
parseMap(String text,
String separator,
String quote)
Parses the specifie text into a map. |
static void |
progressbox(String id,
String msg,
boolean mask,
String icon)
Creates a message box to indicate something is being processed |
static int[] |
stringToInts(String text,
int defaultValue)
Converts a string separated by comma to an array of integers. |
static Date |
today(boolean full)
Returns today. |
static Date |
today(String fmt)
Returns today. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String cellps0
' cellpadding="0" cellspacing="0" border="0"'.
public static String img0
'<img style="height:0;width:0"/>'.
public static String i0
'<i style="height:0;width:0"/>'.
| Method Detail |
|---|
public static boolean isChar(char cc,
Map opts)
cc - the characteropts - the options.
| Name | Allowed Values | Description |
|---|---|---|
| digit | true, false | Specifies the character is digit only. |
| upper | true, false | Specifies the character is upper case only. |
| lower | true, false | Specifies the character is lower case only. |
| whitespace | true, false | Specifies the character is whitespace only. |
| opts[cc] | true, false | Specifies the character is allowed only. |
public static Map parseMap(String text,
String separator,
String quote)
zUtl.parseMap("a=b,c=d");
zUtl.parseMap("a='b c',c=de", ',', "'\"");
text - the text to parseseparator - the separator. If omitted, ','
is assumedquote - the quote to handle. Ignored if omitted.
public static String encodeXML(String txt,
Map opts)
Utl for more XML utilities.
txt - the text to encodeopts - [optional] the options. Allowd value:
public static String decodeXML(String txt)
txt - the text to decode
public static Date today(String fmt)
fmt - the time format, such as HH:mm:ss.SSS
If a time element such as seconds not specified in the format, it will
be considered as 0. For example, if the format is "HH:mm", then
the returned object will be today, this hour and this minute, but
the second and milliseconds will be zero.
public static Date today(boolean full)
full - if true, returns the full time,
else only returns year, month, and day.
If omitted, false is assumed
public static boolean isAncestor(java.lang.Object p,
java.lang.Object c)
getParent
or a field called parent.
A typical example is used to test the widgets (Widget).
Notice that, if you want to test DOM elements, please use
jq.isAncestor(_global_.DOMElement, _global_.DOMElement) instead.
p - the parent. This method return true if p is null
or p is the same as cc - the child
jq.isAncestor(_global_.DOMElement, _global_.DOMElement)
public static void progressbox(String id,
String msg,
boolean mask,
String icon)
id - the ID of the DOM element being createdmsg - the message to shownmask - whether to show sem-transparent mask to prevent
the user from accessing it.icon - the CSS class used to shown an icon in the box.
Ignored if not specified.destroyProgressbox(_global_.String)public static void destroyProgressbox(String id)
progressbox(_global_.String, _global_.String, boolean, _global_.String).
id - the ID of the DOM element of the message box
public static void go(String url,
Map opts)
url - the URL to go toopts - [optional] the options. Allowed values:
public static Array frames(Window w)
To retrieve all, invoke zUtl.frames(top).
Notice: w is included in the returned array.
If you want to exclude it, invoke zUtl.frames(w).$remove(w).
w - the browser window
public static String intsToString(int[] ary)
ary - the integer array to convert.
If null, an empty string is returned.
stringToInts(_global_.String, int)
public static int[] stringToInts(String text,
int defaultValue)
text - the string to convert.
If null, null is returned.defaultValue - the default value used if the value
is not specified. For example, zUtl.stringToInts("1,,3", 2) returns [1, 2, 3].
intsToString(int[])
public static String mapToString(Map map,
String assign,
String separator)
map - the map to convertassign - the symbol for assignment. If omitted, '=' is assumed.separator - the symbol for separator. If omitted, ',' is assumed.
intsToString(int[])
public static void appendAttr(String nm,
java.lang.Object val,
boolean force)
nm - the name of the attributeval - the value of the attributeforce - whether to append attribute no matter what value it is.
If false (or omitted), it is the same as appendAttr(String, Object).
public static void appendAttr(String nm,
java.lang.Object val)
val ? ' ' + nm + '="' + val + '"': "".
If you want to generate the attribute no matter what val is, use
appendAttr(String, Object, boolean).
nm - the name of the attributeval - the value of the attribute
public static void fireSized(Widget wgt,
int bfsz)
wgt - the widget which the zWatch event will be fired against.bfsz - the beforeSize mode:
public static void fireShown(Widget wgt,
int bfsz)
wgt - the widget which the zWatch event will be fired against.bfsz - the beforeSize mode:
public static void loadImage(String url)
url - the loading image's localationpublic static void isImageLoading()
loadImage(_global_.String)public static long now()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||