org.zkoss.zk.ui.metainfo
Class NodeInfo

java.lang.Object
  extended by org.zkoss.zk.ui.metainfo.NodeInfo
Direct Known Subclasses:
ComponentInfo, PageDefinition

public abstract class NodeInfo
extends java.lang.Object

Represents a node of the ZUML tree. It is an abstract class while the concrete classes include PageDefinition and ComponentInfo. The root must be an instance of PageDefinition and the other nodes must be instances of ComponentInfo, ZScript, or AttributesInfo.

Note:it is not thread-safe.

Author:
tomyeh

Constructor Summary
NodeInfo()
           
 
Method Summary
 void appendChild(AttributesInfo custAttrs)
          Adds a custom-attributes child.
 void appendChild(ComponentInfo compInfo)
          Adds a ComponentInfo child.
 void appendChild(VariablesInfo variables)
          Adds a variables child.
 void appendChild(ZScript zscript)
          Adds a zscript child.
 java.util.List getChildren()
          Returns a list of children.
protected abstract  EvaluatorRef getEvaluatorRef()
          Returns the evaluator reference (never null).
abstract  PageDefinition getPageDefinition()
          Returns the page definition, or null if not available.
abstract  NodeInfo getParent()
          Returns the parent, or null if no parent.
 boolean removeChild(AttributesInfo custAttrs)
          Removes a custom-attributes child.
 boolean removeChild(ComponentInfo compInfo)
          Removes a ComponentInfo child.
 boolean removeChild(VariablesInfo variables)
          Removes a variables child.
 boolean removeChild(ZScript zscript)
          Removes a zscript child.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeInfo

public NodeInfo()
Method Detail

getPageDefinition

public abstract PageDefinition getPageDefinition()
Returns the page definition, or null if not available.


getParent

public abstract NodeInfo getParent()
Returns the parent, or null if no parent.


getEvaluatorRef

protected abstract EvaluatorRef getEvaluatorRef()
Returns the evaluator reference (never null).

This method is used only for implementation only.

Since:
3.0.0

appendChild

public void appendChild(ZScript zscript)
Adds a zscript child.


appendChild

public void appendChild(VariablesInfo variables)
Adds a variables child.


appendChild

public void appendChild(AttributesInfo custAttrs)
Adds a custom-attributes child.


appendChild

public void appendChild(ComponentInfo compInfo)
Adds a ComponentInfo child.

Since:
2.4.0

removeChild

public boolean removeChild(ZScript zscript)
Removes a zscript child.

Returns:
whether the child is removed successfully.

removeChild

public boolean removeChild(VariablesInfo variables)
Removes a variables child.

Returns:
whether the child is removed successfully.

removeChild

public boolean removeChild(AttributesInfo custAttrs)
Removes a custom-attributes child.

Returns:
whether the child is removed successfully.

removeChild

public boolean removeChild(ComponentInfo compInfo)
Removes a ComponentInfo child.

Call ComponentInfo.setParent(org.zkoss.zk.ui.metainfo.NodeInfo) instead.

Returns:
whether the child is removed successfully.
Since:
2.4.0

getChildren

public java.util.List getChildren()
Returns a list of children. Children include instances of ComponentInfo, ZScript VariablesInfo, or AttributesInfo.

Note: the returned list is live but it is not a good idea to modify it directly, because, unlike Component, it doesn't maintain getParent(). Thus, it is better to invoke appendChild(ComponentInfo) and removeChild(ComponentInfo) instead.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo