|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.Components
public class Components
Utilities to access Component.
| Constructor Summary | |
|---|---|
protected |
Components()
|
| Method Summary | |
|---|---|
static java.lang.String |
componentToPath(Component comp,
Component ref)
Converts a component to a path (relavant to another component). |
static int |
getScope(java.lang.String scope)
Converts a string to an integer that can be used to access Component.getAttribute(String, int) |
static java.util.Collection |
getVisibleChildren(Component comp)
Returns a collection of visible children. |
static boolean |
isAncestor(Component node1,
Component node2)
Tests whether node1 is an ancessor of node 2. |
static boolean |
isAutoId(java.lang.String id)
Returns whether an ID is generated automatically. |
static boolean |
isRealVisible(Component comp)
Returns whether this component is real visible (all its parents are visible). |
static Component |
pathToComponent(java.lang.String path,
Component ref)
Converts a path, generated by componentToPath(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component), to
a component. |
static void |
removeAllChildren(Component comp)
Removes all children of the specified component. |
static java.lang.String |
scopeToString(int scope)
Converts an integer to the string representing the scope. |
static void |
sort(java.util.List list,
java.util.Comparator cpr)
Sorts the components in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Components()
| Method Detail |
|---|
public static void sort(java.util.List list,
java.util.Comparator cpr)
Note: you cannot use Collections.sort to sort
Component.getChildren() because Collections.sort might cause
some replicated item in the list.
public static boolean isAncestor(Component node1,
Component node2)
public static void removeAllChildren(Component comp)
public static boolean isRealVisible(Component comp)
Component.isVisible()public static java.util.Collection getVisibleChildren(Component comp)
The performance of the returned collection's size() is NO GOOD.
public static final int getScope(java.lang.String scope)
Component.getAttribute(String, int)
public static final java.lang.String scopeToString(int scope)
scope - one of Component.COMPONENT_SCOPE,
Component.SPACE_SCOPE, Component.PAGE_SCOPE,
Component.DESKTOP_SCOPE, Component.SESSION_SCOPE,
Component.REQUEST_SCOPE, and Component.APPLICATION_SCOPE.public static final boolean isAutoId(java.lang.String id)
public static final java.lang.String componentToPath(Component comp,
Component ref)
Rather, it is better to store the path related, and then restore
it back to a component by calling pathToComponent(java.lang.String, org.zkoss.zk.ui.Component).
comp - the component to be converted to path. It cannot be null.ref - the component used to generated the path from.
It cannot be null.
pathToComponent(java.lang.String, org.zkoss.zk.ui.Component)
to convert it back.
java.lang.UnsupportedOperationException - if we cannot find a path
to the component to write.
public static final Component pathToComponent(java.lang.String path,
Component ref)
componentToPath(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component), to
a component.
ref - the component used to generated the path from.
It cannot be null. It is the same as the one when calling
componentToPath(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||