|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.metainfo.ZkInfo
public class ZkInfo
Represents the zk element in a ZUML page.
Constructor Summary | |
---|---|
ZkInfo(NodeInfo parent,
ConditionImpl cond)
Constructs a ZK info. |
Method Summary | |
---|---|
void |
appendChild(NodeInfo child)
Append a child |
java.util.List<NodeInfo> |
getChildren()
Returns a readonly list of children. |
ConditionImpl |
getCondition()
Returns the effectiveness condition. |
Evaluator |
getEvaluator()
Returns the evaluator. |
EvaluatorRef |
getEvaluatorRef()
Returns the evaluator reference. |
PageDefinition |
getPageDefinition()
Returns the page definition, i.e., the root node, or null if not available. |
NodeInfo |
getParent()
Returns the parent, or null if it has no parent. |
boolean |
isEffective(Component comp)
Used to evaluate whether it is effective. |
boolean |
isEffective(Page page)
Used to evaluate whether it is effective. |
boolean |
removeChild(NodeInfo child)
Removes a child. |
java.lang.Object[] |
resolveCase(Page page,
Component comp)
Returns the case condition's value, or null if no case is specified (i.e., withCase() is false. |
ForEach |
resolveForEach(Page page,
Component comp)
Returns the forEach object if the forEach attribute is defined (or setForEach(java.lang.String, java.lang.String, java.lang.String) is called). |
java.lang.Object |
resolveSwitch(Page page,
Component comp)
Returns the switch condition's value; evaluate EL expression if any. |
void |
setCase(java.lang.String casec)
Sets the case condition. |
void |
setCondition(ConditionImpl cond)
Sets the effectiveness condition. |
void |
setForEach(java.lang.String expr,
java.lang.String begin,
java.lang.String end)
Sets the forEach attribute, which is usually an expression. |
void |
setForEach(java.lang.String expr,
java.lang.String begin,
java.lang.String end,
java.lang.String step)
Sets the forEach attribute, which is usually an expression. |
void |
setSwitch(java.lang.String switchc)
Sets the switch condition. |
java.lang.String |
toString()
|
boolean |
withCase()
Returns whether the case condition is defined. |
boolean |
withCondition()
Tests if the condition is set |
boolean |
withForEach()
Returns whether the forEach condition is defined. |
boolean |
withSwitch()
Returns whether the switch condition is defined. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZkInfo(NodeInfo parent, ConditionImpl cond)
Method Detail |
---|
public boolean withSwitch()
public void setSwitch(java.lang.String switchc)
switchc
- the switch condition; EL allowed.
Ignored if null.
Note: if it is an empty string, the switch condition
(returned by resolveSwitch(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)
) is an empty string.public java.lang.Object resolveSwitch(Page page, Component comp)
Note: unlike resolveCase(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)
, it might return null
even if withSwitch()
is true.
public boolean withCase()
public void setCase(java.lang.String casec)
public java.lang.Object[] resolveCase(Page page, Component comp)
withCase()
is false.
It evaluates EL expression if any.
public java.lang.String toString()
toString
in class java.lang.Object
public ForEach resolveForEach(Page page, Component comp)
setForEach(java.lang.String, java.lang.String, java.lang.String)
is called).
If comp is not null, both pagedef and page are ignored. If comp is null, page must be specified.
page
- the page. It is used only if comp is null.comp
- the component.
public void setForEach(java.lang.String expr, java.lang.String begin, java.lang.String end)
expr
- the expression to return a collection of objects, or
null/empty to denote no iteration.public void setForEach(java.lang.String expr, java.lang.String begin, java.lang.String end, java.lang.String step)
expr
- the expression to return a collection of objects, or
null/empty to denote no iteration.public boolean withForEach()
public ConditionImpl getCondition()
public void setCondition(ConditionImpl cond)
public boolean withCondition()
public void appendChild(NodeInfo child)
NodeInfo
appendChild
in interface NodeInfo
public boolean removeChild(NodeInfo child)
NodeInfo
removeChild
in interface NodeInfo
public java.util.List<NodeInfo> getChildren()
NodeInfo
Note: the returned list is readonly. To modify, please use
NodeInfo.appendChild(org.zkoss.zk.ui.metainfo.NodeInfo)
and NodeInfo.removeChild(org.zkoss.zk.ui.metainfo.NodeInfo)
instead.
getChildren
in interface NodeInfo
public boolean isEffective(Component comp)
Condition
isEffective
in interface Condition
comp
- used as the self variable. Ignored if null.public boolean isEffective(Page page)
Condition
isEffective
in interface Condition
page
- used as the self variable. Ignored if null.public EvaluatorRef getEvaluatorRef()
NodeInfo
getEvaluatorRef
in interface NodeInfo
public PageDefinition getPageDefinition()
NodeInfo
getPageDefinition
in interface NodeInfo
public Evaluator getEvaluator()
NodeInfo
All nodes in the same ZUML tree has the same evaluator reference
(inherited from the root node, PageDefinition.getEvaluatorRef()
).
getEvaluator
in interface NodeInfo
public NodeInfo getParent()
NodeInfo
getParent
in interface NodeInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |