org.zkoss.zul
Class SimpleTreeModel

java.lang.Object
  extended by org.zkoss.zul.AbstractTreeModel
      extended by org.zkoss.zul.SimpleTreeModel
All Implemented Interfaces:
java.io.Serializable, TreeModel

public class SimpleTreeModel
extends AbstractTreeModel

A simple implementation of TreeModel. Note: It assumes the content is immutable.

Since:
3.0.0
Author:
Jeff Liu
See Also:
Serialized Form

Constructor Summary
SimpleTreeModel(SimpleTreeNode root)
          Constructor
 
Method Summary
 java.lang.Object getChild(java.lang.Object parent, int index)
          Returns the child of parent at index index in the parent's child array.
 int getChildCount(java.lang.Object parent)
          Returns the number of children of parent.
 boolean isLeaf(java.lang.Object node)
          Returns true if node is a leaf.
 
Methods inherited from class org.zkoss.zul.AbstractTreeModel
addTreeDataListener, fireEvent, getPath, getRoot, removeTreeDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTreeModel

public SimpleTreeModel(SimpleTreeNode root)
Constructor

Parameters:
root - - the root of tree
Method Detail

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Description copied from interface: TreeModel
Returns the child of parent at index index in the parent's child array.

Parameters:
parent - a node in the tree, obtained from this data source
Returns:
the child of parent at index index

getChildCount

public int getChildCount(java.lang.Object parent)
Description copied from interface: TreeModel
Returns the number of children of parent.

Parameters:
parent - a node in the tree, obtained from this data source
Returns:
the number of children of the node parent

isLeaf

public boolean isLeaf(java.lang.Object node)
Description copied from interface: TreeModel
Returns true if node is a leaf.

Parameters:
node - a node in the tree, obtained from this data source
Returns:
true if node is a leafs


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