|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.sys.ComponentsCtrl
public class ComponentsCtrl
Utilities for implementing components.
| Field Summary | |
|---|---|
static java.lang.String |
ANONYMOUS_ID
The anonymous UUID. |
static ComponentDefinition |
DUMMY
Represents a dummy definition. |
| Constructor Summary | |
|---|---|
ComponentsCtrl()
|
|
| Method Summary | |
|---|---|
static void |
applyForward(Component comp,
java.lang.String forward)
Applies the forward condition to the specified component. |
static java.lang.String |
getAnonymousId()
Deprecated. As of release 2.4.1, replaced by ANONYMOUS_ID |
static java.lang.Object |
getCurrentInfo()
Returns the current component info ComponentInfo,
definition (ComponentDefinition or null, which is used only by
UiEngine to communicate with
AbstractComponent. |
static java.lang.reflect.Method |
getEventMethod(java.lang.Class cls,
java.lang.String evtnm)
Returns the method for handling the specified event, or null if not available. |
static boolean |
isAutoId(java.lang.String id)
Returns whether an ID is generated automatically. |
static boolean |
isReservedAttribute(java.lang.String name)
Returns if the attribute name is reserved. |
static boolean |
isUuid(java.lang.String id)
Returns whether an ID is a valid UUID. |
static java.lang.String |
parseClientScript(Component comp,
java.lang.String script)
Parses a script by resolving #{xx} to make it executable at the client. |
static java.lang.Object[] |
parseEventExpression(Component comp,
java.lang.String evtexpr,
Component defaultComp,
boolean deferred)
Pares the event expression. |
static void |
setCurrentInfo(ComponentDefinition compdef)
Sets the current component definition, which is used only by UiEngine to communicate with
AbstractComponent. |
static void |
setCurrentInfo(ComponentInfo compInfo)
Sets the current component definition, which is used only by UiEngine to communicate with
AbstractComponent. |
static void |
setEventMethodCache(org.zkoss.util.Cache cache)
Sets the cache that stores the information about event handler methods. |
static java.lang.String |
toAutoId(java.lang.String prefix,
int id)
Returns the automatically generate component's UUID/ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ANONYMOUS_ID
public static final ComponentDefinition DUMMY
| Constructor Detail |
|---|
public ComponentsCtrl()
| Method Detail |
|---|
public static final java.lang.String toAutoId(java.lang.String prefix,
int id)
public static final java.lang.String getAnonymousId()
ANONYMOUS_ID
public static final boolean isAutoId(java.lang.String id)
public static final boolean isUuid(java.lang.String id)
public static final boolean isReservedAttribute(java.lang.String name)
public static final java.lang.Object getCurrentInfo()
ComponentInfo,
definition (ComponentDefinition or null, which is used only by
UiEngine to communicate with
AbstractComponent.
public static final void setCurrentInfo(ComponentDefinition compdef)
UiEngine to communicate with
AbstractComponent.
Used only internally.
public static void setCurrentInfo(ComponentInfo compInfo)
UiEngine to communicate with
AbstractComponent.
Used only internally.
public static java.lang.Object[] parseEventExpression(Component comp,
java.lang.String evtexpr,
Component defaultComp,
boolean deferred)
throws ComponentNotFoundException
There are several formats for the event expression:
comp - the component that the event expression is referenced toevtexpr - the event expression.defaultComp - the default component which is used when
evtexpr doesn't specify the component.deferred - whether to defer the conversion of the path
to 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.
ComponentNotFoundException
public static final void applyForward(Component comp,
java.lang.String forward)
The basic format:
onEvent1=id1/id2.onEvent2,onEvent3=id3.onEvent4
See ComponentInfo.setForward(java.lang.String)
for more information.
public static java.lang.String parseClientScript(Component comp,
java.lang.String script)
comp - the component used to resolve the EL expression.script - the Java script to convert
public static final java.lang.reflect.Method getEventMethod(java.lang.Class cls,
java.lang.String evtnm)
public static final void setEventMethodCache(org.zkoss.util.Cache cache)
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).
MultiCache. It is the slowest but
consumes less memory.
cache - the cache. It cannot be null. It must be thread safe.
Once assigned, the caller shall not access it again.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||