| java.lang.Object org.zkoss.zk.ui.sys.ComponentsCtrl
ComponentsCtrl | public class ComponentsCtrl (Code) | | Utilities for implementing components.
author: tomyeh |
Method Summary | |
final public static void | applyForward(Component comp, String forward) Applies the forward condition to the specified component. | final public static String | getAnonymousId() | final public static Object | getCurrentInfo() Returns the current component info
ComponentInfo ,
definition (
ComponentDefinition or null, which is used only by
org.zkoss.zk.ui.sys.UiEngine to communicate with
org.zkoss.zk.ui.AbstractComponent . | final public static Method | getEventMethod(Class cls, String evtnm) Returns the method for handling the specified event, or null
if not available. | final public static boolean | isAutoId(String id) Returns whether an ID is generated automatically. | final public static boolean | isReservedAttribute(String name) Returns if the attribute name is reserved. | final public static boolean | isUuid(String id) Returns whether an ID is a valid UUID. | public static String | parseClientScript(Component comp, String script) Parses a script by resolving #{xx} to make it executable
at the client. | public static Object[] | parseEventExpression(Component comp, String evtexpr, Component defaultComp, boolean deferred) Pares the event expression.
There are several formats for the event expression:
- onClick
- self.onClick
- id.onClick
- ../id1/id2.onClick
- ${elexpr}.onClick
Parameters: comp - the component that the event expression is referenced to Parameters: evtexpr - the event expression. Parameters: defaultComp - the default component which is used whenevtexpr doesn't specify the component. Parameters: deferred - whether to defer the conversion of the pathto a component. | final public static void | setCurrentInfo(ComponentDefinition compdef) Sets the current component definition, which is used only by
org.zkoss.zk.ui.sys.UiEngine to communicate with
org.zkoss.zk.ui.AbstractComponent . | public static void | setCurrentInfo(ComponentInfo compInfo) Sets the current component definition, which is used only by
org.zkoss.zk.ui.sys.UiEngine to communicate with
org.zkoss.zk.ui.AbstractComponent . | final public static void | setEventMethodCache(Cache cache) Sets the cache that stores the information about event handler methods.
Since the performance of the cache is critical to the
performance of the overall system. | final public static String | toAutoId(String prefix, int id) Returns the automatically generate component's UUID/ID. |
ANONYMOUS_ID | final public static String ANONYMOUS_ID(Code) | | The anonymous UUID. Used only internally.
|
getEventMethod | final public static Method getEventMethod(Class cls, String evtnm)(Code) | | Returns the method for handling the specified event, or null
if not available.
|
isAutoId | final public static boolean isAutoId(String id)(Code) | | Returns whether an ID is generated automatically.
|
isReservedAttribute | final public static boolean isReservedAttribute(String name)(Code) | | Returns if the attribute name is reserved.
If name is null, false is returned.
since: 3.0.0 |
isUuid | final public static boolean isUuid(String id)(Code) | | Returns whether an ID is a valid UUID.
|
parseClientScript | public static String parseClientScript(Component comp, String script)(Code) | | Parses a script by resolving #{xx} to make it executable
at the client.
Parameters: comp - the component used to resolve the EL expression. Parameters: script - the Java script to convert since: 2.4.0 |
parseEventExpression | public static Object[] parseEventExpression(Component comp, String evtexpr, Component defaultComp, boolean deferred) throws ComponentNotFoundException(Code) | | Pares the event expression.
There are several formats for the event expression:
- onClick
- self.onClick
- id.onClick
- ../id1/id2.onClick
- ${elexpr}.onClick
Parameters: comp - the component that the event expression is referenced to Parameters: evtexpr - the event expression. Parameters: defaultComp - the default component which is used whenevtexpr doesn't specify the component. Parameters: deferred - whether to defer the conversion of the pathto a component. If true and EL not specified or evaluated to a string,it returns the path directly rather than converting it to a component. a two element array. The first element is the componentif deferred is false or EL is evaluated to a component,or a path, otherwise.The second component is the event name. since: 3.0.0 |
setEventMethodCache | final public static void setEventMethodCache(Cache cache)(Code) | | Sets the cache that stores the information about event handler methods.
Since the performance of the cache is critical to the
performance of the overall system. There is several options to
choose from:
-
ThreadLocalCache : the default.
It is the fastest but consumes more memory since it maintains
a cache per thread (about 10MB - 16M for over 400 concurrent users).
-
org.zkoss.util.MultiCache . It is the slowest but
consumes less memory.
Parameters: cache - the cache. It cannot be null. It must be thread safe.Once assigned, the caller shall not access it again. since: 3.0.0 |
toAutoId | final public static String toAutoId(String prefix, int id)(Code) | | Returns the automatically generate component's UUID/ID.
|
|
|