public class NativeInfo extends ComponentInfo
Note:it is not thread-safe.
Constructor and Description |
---|
NativeInfo(EvaluatorRef evlar,
ComponentDefinition compdef,
java.lang.String tag)
Constructs a native info without a parent.
|
NativeInfo(NodeInfo parent,
ComponentDefinition compdef,
java.lang.String tag)
Constructs a native info with a parent.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeclaredNamespace(Namespace ns)
Adds a declared namespace.
|
void |
addEpilogChild(NodeInfo child)
Adds an epilog child.
|
void |
addPrologChild(NodeInfo child)
Adds a prolog child.
|
java.util.List<NodeInfo> |
getChildren()
Returns a readonly list of children.
|
ConditionImpl |
getCondition()
Returns the effectiveness condition.
|
java.util.List<Namespace> |
getDeclaredNamespaces()
Returns a readonly list of the declared namespaces (never null).
|
java.util.List<NodeInfo> |
getEpilogChildren()
Returns a readonly list of the epilog children (
NativeInfo ). |
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.
|
java.util.List<NodeInfo> |
getPrologChildren()
Returns a readonly list of the prolog children (
NativeInfo ). |
NativeInfo |
getSplitChild()
Returns the split child, or null if not available.
|
boolean |
isEffective(Component comp)
Used to evaluate whether it is effective.
|
boolean |
isEffective(Page page)
Used to evaluate whether it is effective.
|
Component |
newInstance(Page page,
Component parent)
Creates an component based on this info (never null).
|
boolean |
removeChild(NodeInfo child)
Removes a child.
|
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). |
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 |
setSplitChild(NativeInfo child)
Sets the split kid.
|
boolean |
withCondition()
Tests if the condition is set
|
boolean |
withForEach()
Returns whether the forEach condition is defined.
|
addAnnotation, addEventHandler, addProperty, addProperty, addWidgetAttribute, addWidgetListener, addWidgetOverride, appendChild, applyProperties, disableBindingAnnotation, duplicate, enableBindingAnnotation, evalProperties, getAnnotationMap, getApply, getComponentDefinition, getEventHandlerNames, getForward, getFulfill, getImplementation, getLanguageDefinition, getProperties, getReplaceableText, getTag, getTextAs, getWidgetClass, hasBindingAnnotation, isBlankPreserved, isChildAllowedInTextAs, newInstance, resolveComposer, resolveImplementationClass, resolveImplementationClass, resolveWidgetClass, setApply, setForward, setFulfill, setImplementation, setReplaceableText, setWidgetClass, toString
public NativeInfo(NodeInfo parent, ComponentDefinition compdef, java.lang.String tag)
parent
- the parent info (never null).compdef
- the component definition (never null).tag
- the name of the tagpublic NativeInfo(EvaluatorRef evlar, ComponentDefinition compdef, java.lang.String tag)
evlar
- the evaluator (never null).compdef
- the component definition (never null).tag
- the name of the tagpublic java.util.List<Namespace> getDeclaredNamespaces()
public void addDeclaredNamespace(Namespace ns)
public java.util.List<NodeInfo> getPrologChildren()
NativeInfo
).
A prolog child is a special child of NativeInfo
.
(it is not part of getChildren()
that is used to optimize the native components such that
ZK can use one native components to represent several NativeInfo
.
In other words, a prolog child won't be created as part of
The prolog children must be rendered before getChildren()
.
public java.util.List<NodeInfo> getEpilogChildren()
NativeInfo
).
The epilog children must be rendered after getChildren()
.public void addPrologChild(NodeInfo child)
Note: if child belong to other ComponentInfo
,
you have to remove them first before calling this method.
Otherwise, the result is unpredictable.
child
- the prolog child.getPrologChildren()
public void addEpilogChild(NodeInfo child)
child
- the epilog child. If child belongs to getChildren()
,
it will be removed first.getPrologChildren()
public NativeInfo getSplitChild()
public void setSplitChild(NativeInfo child)
getSplitChild()
public Component newInstance(Page page, Component parent)
ComponentInfo
Like ComponentDefinition.newInstance(org.zkoss.zk.ui.Page, java.lang.String)
,
this method doesn't invoke ComponentInfo.applyProperties(org.zkoss.zk.ui.Component)
.
It is caller's job to invoke them if necessary.
Since the value of properties might depend on the component tree,
it is better to assign the component with a proper parent
before calling ComponentInfo.applyProperties(org.zkoss.zk.ui.Component)
.
newInstance
in class ComponentInfo
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 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
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.