to.etc.domui.component.tree
Class AbstractTreeNodeBase<T extends ITreeNode<T>>

java.lang.Object
  extended by to.etc.domui.component.tree.AbstractTreeNodeBase<T>
All Implemented Interfaces:
ITreeNode<T>

public abstract class AbstractTreeNodeBase<T extends ITreeNode<T>>
extends java.lang.Object
implements ITreeNode<T>


Constructor Summary
AbstractTreeNodeBase(T dad)
           
 
Method Summary
 T getChild(int index)
          Returns the nth child in the parent's list.
 int getChildCount()
          Returns the #of children for this object.
protected  java.util.List<T> getChildList()
           
 T getParent()
           
 boolean hasChildren()
          If possible this should quickly decide if this node has children or not.
abstract  java.util.List<T> loadChildren()
           
protected  void setChildList(java.util.List<T> childList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTreeNodeBase

public AbstractTreeNodeBase(T dad)
Method Detail

loadChildren

public abstract java.util.List<T> loadChildren()
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

getChild

public T getChild(int index)
                                throws java.lang.Exception
Description copied from interface: ITreeNode
Returns the nth child in the parent's list.

Specified by:
getChild in interface ITreeNode<T extends ITreeNode<T>>
Returns:
Throws:
java.lang.Exception

getChildCount

public int getChildCount()
                  throws java.lang.Exception
Description copied from interface: ITreeNode
Returns the #of children for this object. This must return the actual number.

Specified by:
getChildCount in interface ITreeNode<T extends ITreeNode<T>>
Returns:
Throws:
java.lang.Exception

hasChildren

public boolean hasChildren()
                    throws java.lang.Exception
Description copied from interface: ITreeNode
If possible this should quickly decide if this node has children or not. This is used to render an expanded node's state icons. If determining whether a node has children is an expensive option this method should return TRUE always; this causes the state icon to display as if children are available and the user has the possibility to expand that node. At that time we'll call getChildCount() which must determine the #of children. If that returns zero it will at that time properly re-render the state of the node, showing that the node is actually a leaf and cannot be expanded further.

Specified by:
hasChildren in interface ITreeNode<T extends ITreeNode<T>>
Returns:
Throws:
java.lang.Exception

getParent

public T getParent()
                                 throws java.lang.Exception
Specified by:
getParent in interface ITreeNode<T extends ITreeNode<T>>
Throws:
java.lang.Exception

getChildList

protected java.util.List<T> getChildList()

setChildList

protected void setChildList(java.util.List<T> childList)