|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.metainfo.ShadowInfo
public class ShadowInfo
Represent a shadow element.
Constructor Summary | |
---|---|
ShadowInfo(NodeInfo parent,
ComponentDefinition compdef,
java.lang.String tag,
ConditionImpl cond)
Creates a shadow. |
Method Summary | |
---|---|
void |
addAnnotation(java.lang.String propName,
java.lang.String annotName,
java.util.Map<java.lang.String,java.lang.String[]> annotAttrs,
Location loc)
Adds an annotation to the specified property of this component info. |
void |
addProperty(java.lang.String name,
java.lang.String value,
ConditionImpl cond)
Adds a property initializer. |
void |
appendChild(NodeInfo child)
Adds a child. |
void |
apply(Component comp)
Applies the custom attributes. |
void |
applyProperties(Component comp)
Applies the event handlers and properties to the specified component. |
void |
disableBindingAnnotation()
|
void |
enableBindingAnnotation()
|
AnnotationMap |
getAnnotationMap()
Returns the annotation map defined in this info, or null if no annotation is ever defined. |
java.util.List<NodeInfo> |
getChildren()
Returns a readonly list of children. |
ComponentDefinition |
getComponentDefinition()
Returns the component definition, or null if it is PageDefinition. |
ConditionImpl |
getCondition()
Returns the effectiveness condition. |
Evaluator |
getEvaluator()
Returns the evaluator. |
EvaluatorRef |
getEvaluatorRef()
Returns the evaluator reference. |
LanguageDefinition |
getLanguageDefinition()
Returns the language definition that getComponentDefinition()
belongs to, or null if the component definition is temporary. |
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<Property> |
getProperties()
Returns a readonly list of properties ( Property ) (never null). |
boolean |
hasBindingAnnotation()
|
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)
Creates a shadow element based on this info (never null). |
Component |
newInstance(Page page,
Component parent)
Creates an component based on this info (never null). |
boolean |
removeChild(NodeInfo child)
Removes a child. |
void |
setCondition(ConditionImpl cond)
Sets the effectiveness condition. |
java.lang.String |
toString()
|
boolean |
withCondition()
Tests if the condition is set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ShadowInfo(NodeInfo parent, ComponentDefinition compdef, java.lang.String tag, ConditionImpl cond)
parent
- the parent node (never null)compdef
- the component definition; never nulltag
- the tag name; Note: if component implements
DynamicTag
, this argument must be specified.
If DynamicTag
is not implemented, this argument is optional.Method Detail |
---|
public AnnotationMap getAnnotationMap()
public void applyProperties(Component comp)
It also invokes ComponentDefinition.applyProperties(org.zkoss.zk.ui.Component)
.
Note: annotations are applied to the component when a component
is created. So, this method doesn't and need not to copy them.
See also AbstractComponent.AbstractComponent(boolean)
.
public void addAnnotation(java.lang.String propName, java.lang.String annotName, java.util.Map<java.lang.String,java.lang.String[]> annotAttrs, Location loc)
propName
- the property name.
If null, the annotation is associated with the whole component rather than
a particular property.annotName
- the annotation name (never null, nor empty).annotAttrs
- a map of attributes, or null if no attribute at all.
The attribute must be in a pair of strings (String name, String value),
or (String name, String[] value).loc
- the location information of the annotation in
the document, or null if not available.public void apply(Component comp)
Note: this method does nothing if isEffective(org.zkoss.zk.ui.Component)
returns false.
public Component newInstance(Page page)
If the implementation class doesn't have any EL expression, or its EL expression doesn't have reference to the self variable, the result is the same.
This method is preserved for backward compatibility.
It is better to use newInstance(Page, Component)
.
public Component newInstance(Page page, Component parent)
Like ComponentDefinition.newInstance(org.zkoss.zk.ui.Page, java.lang.String)
,
this method doesn't invoke 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 applyProperties(org.zkoss.zk.ui.Component)
.
public LanguageDefinition getLanguageDefinition()
getComponentDefinition()
belongs to, or null if the component definition is temporary.
public ComponentDefinition getComponentDefinition()
public java.util.List<Property> getProperties()
Property
) (never null).
public void addProperty(java.lang.String name, java.lang.String value, ConditionImpl cond)
name
- the member name. The component must have a valid setter
for it.value
- the value. It might contain expressions (${}).public void appendChild(NodeInfo child)
appendChild
in interface NodeInfo
java.lang.IllegalStateException
- if this is not an instance of
TemplateInfo
and ShadowInfo
.public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasBindingAnnotation()
public void enableBindingAnnotation()
public void disableBindingAnnotation()
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
public NodeInfo getParent()
NodeInfo
getParent
in interface NodeInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |