org.zkoss.zk.ui.metainfo
Class NativeInfo

java.lang.Object
  extended by org.zkoss.zk.ui.metainfo.NodeInfo
      extended by org.zkoss.zk.ui.metainfo.ComponentInfo
          extended by org.zkoss.zk.ui.metainfo.NativeInfo
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, Condition

public class NativeInfo
extends ComponentInfo

Represents the compmonent infomation about the native components.

Note:it is not thread-safe.

Since:
3.0.0
Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
NativeInfo(EvaluatorRef evlar, ComponentDefinition compdef, java.lang.String tagnm)
          Constructs a native info without a parent.
NativeInfo(NodeInfo parent, ComponentDefinition compdef, java.lang.String tagnm)
          Constructs a native info with a parent.
 
Method Summary
 void addDeclaredNamespace(Namespace ns)
          Adds a declared namespace.
 void addEpilogChild(AttributesInfo child)
          Adds an epilog child.
 void addEpilogChild(NativeInfo child)
          Adds an epilog child.
 void addEpilogChild(VariablesInfo child)
          Adds an epilog child.
 void addEpilogChild(ZScript child)
          Adds an epilog child.
 void addPrologChild(AttributesInfo child)
          Adds a prolog child.
 void addPrologChild(NativeInfo child)
          Adds a prolog child.
 void addPrologChild(TextInfo text)
          Adds a text as a prolog child.
 void addPrologChild(VariablesInfo child)
          Adds a prolog child.
 void addPrologChild(ZScript child)
          Adds a prolog child.
 java.lang.Object clone()
          Clones this info.
 java.util.List getDeclaredNamespaces()
          Returns a readonly list of the declared namespaces (never null).
 java.util.List getEpilogChildren()
          Returns a readonly list of the epilog children (NativeInfo).
 java.util.List getPrologChildren()
          Returns a readonly list of the prolog children (NativeInfo).
 NativeInfo getSplitChild()
          Returns the split child, or null if not available.
 Component newInstance(Page page, Component parent)
          Creates an component based on this info (never null).
 void setSplitChild(NativeInfo child)
          Sets the split kid.
 
Methods inherited from class org.zkoss.zk.ui.metainfo.ComponentInfo
addAnnotation, addAnnotation, addEventHandler, addProperty, addProperty, addWidgetListener, addWidgetOverride, appendChild, applyProperties, duplicate, evalProperties, getAnnotationMap, getApply, getComponentDefinition, getEvaluator, getEvaluatorRef, getEventHandlerNames, getForward, getFulfill, getImplementation, getLanguageDefinition, getPageDefinition, getParent, getProperties, getReplaceableText, getTag, getTextAs, isBlankPreserved, isEffective, isEffective, newInstance, readExternal, resolveComposer, resolveForEach, resolveImplementationClass, resolveImplementationClass, setApply, setCondition, setForEach, setForward, setFulfill, setImplementation, setParent, setReplaceableText, toString, withCondition, withForEach, writeExternal
 
Methods inherited from class org.zkoss.zk.ui.metainfo.NodeInfo
appendChild, appendChild, appendChild, appendChild, getChildren, removeChild, removeChild, removeChild, removeChild
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NativeInfo

public NativeInfo(NodeInfo parent,
                  ComponentDefinition compdef,
                  java.lang.String tagnm)
Constructs a native info with a parent.

Parameters:
parent - the parnet info (never null).
compdef - the component definition (never null).

NativeInfo

public NativeInfo(EvaluatorRef evlar,
                  ComponentDefinition compdef,
                  java.lang.String tagnm)
Constructs a native info without a parent.

Parameters:
compdef - the component definition (never null).
Since:
3.5.0
Method Detail

getDeclaredNamespaces

public java.util.List getDeclaredNamespaces()
Returns a readonly list of the declared namespaces (never null).


addDeclaredNamespace

public void addDeclaredNamespace(Namespace ns)
Adds a declared namespace.


getPrologChildren

public java.util.List getPrologChildren()
Returns a readonly list of the prolog children (NativeInfo). A prolog child is a special child of NativeInfo. (it is not part of NodeInfo.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 NodeInfo.getChildren().


getEpilogChildren

public java.util.List getEpilogChildren()
Returns a readonly list of the epilog children (NativeInfo). The epilog children must be rendered after NodeInfo.getChildren().


addPrologChild

public void addPrologChild(NativeInfo child)
Adds a prolog child.

Note: if child belong to other ComponentInfo, you have to remove them first before calling this method. Otherwise, the result is unpreditable.

Parameters:
child - the prolog child.
See Also:
getPrologChildren()

addPrologChild

public void addPrologChild(ZScript child)
Adds a prolog child.

Parameters:
child - the prolog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

addPrologChild

public void addPrologChild(VariablesInfo child)
Adds a prolog child.

Parameters:
child - the prolog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

addPrologChild

public void addPrologChild(AttributesInfo child)
Adds a prolog child.

Note: if child belong to other ComponentInfo, you have to remove them first before calling this method. Otherwise, the result is unpreditable.

Parameters:
child - the prolog child.
See Also:
getPrologChildren()

addPrologChild

public void addPrologChild(TextInfo text)
Adds a text as a prolog child.


addEpilogChild

public void addEpilogChild(NativeInfo child)
Adds an epilog child.

Parameters:
child - the epilog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

addEpilogChild

public void addEpilogChild(ZScript child)
Adds an epilog child.

Parameters:
child - the epilog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

addEpilogChild

public void addEpilogChild(VariablesInfo child)
Adds an epilog child.

Parameters:
child - the epilog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

addEpilogChild

public void addEpilogChild(AttributesInfo child)
Adds an epilog child.

Parameters:
child - the epilog child. If child belongs to NodeInfo.getChildren(), it will be removed first.
See Also:
getPrologChildren()

getSplitChild

public NativeInfo getSplitChild()
Returns the split child, or null if not available. Each native info has at most one split child. If a native info has a single child and the child is also a native info, we can merge them by making the child as the split child.

Since:
3.0.0

setSplitChild

public void setSplitChild(NativeInfo child)
Sets the split kid.

Since:
3.0.0
See Also:
getSplitChild()

newInstance

public Component newInstance(Page page,
                             Component parent)
Description copied from class: ComponentInfo
Creates an component based on this info (never null).

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).

Overrides:
newInstance in class ComponentInfo

clone

public java.lang.Object clone()
Description copied from class: ComponentInfo
Clones this info. After cloned, ComponentInfo.getParent() is null. The children (@{link #getChildren}) is not cloned, either. Thus, it is better to use ComponentInfo.duplicate() with ComposerExt.doBeforeCompose(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.metainfo.ComponentInfo) if you want to override some properties.

Overrides:
clone in class ComponentInfo


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