com.ibm.commons.swt.data.controls.tabletree
Class TreeNode

java.lang.Object
  extended by com.ibm.commons.swt.data.controls.tabletree.TreeNode
Direct Known Subclasses:
CategoryNode, MemberNode, RootNode

public abstract class TreeNode
extends java.lang.Object

An abstract node class. Subclasses appear in the DCPropertyTree and related controls.

See Also:
DCPropertyTree

Method Summary
 void addChild(TreeNode child)
          Adds a child to the current node.
protected  void clearChildrenNode()
           
protected  void dispose()
          Disposes the TreeItem corresponding to this node.
abstract  void fillItem()
          Fill the contents of the corresponding TreeItem.
 void fillNode(IClassDef classDef, java.lang.Object object)
          Creates a tree structure based on the provided class definition and object.
 java.util.ArrayList<TreeNode> getChildren()
          Returns all of the children of the current node.
 DataChangeNotifier getDataChangeNotifier()
          A DataChangeNotifier associated with the property tree.
 ILoader getLoader()
          Returns an ILoader associated with this node.
 TreeNode getParent()
          Returns the parent of the current node
 DCPropertyTree getPropertyTree()
          Returns the tree control associated with this node.
 RootNode getRootNode()
          Returns the root of the tree, i.e.
 org.eclipse.swt.widgets.TreeItem getTreeItem()
          Returns the TreeItem associated with this tree node.
protected  boolean isShowing()
           
protected  boolean isVisible()
          Returns whether or not the current tree node is visible.
 void refreshTree(DCPropertyTree tableTree)
          Refreshes the contents of the given tree.
protected static java.lang.String toEdit(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParent

public final TreeNode getParent()
Returns the parent of the current node

Returns:
the parent of the current node, may be null.

getRootNode

public final RootNode getRootNode()
Returns the root of the tree, i.e. the highest ancestor.

Returns:
the root of the tree

fillNode

public void fillNode(IClassDef classDef,
                     java.lang.Object object)
              throws com.ibm.commons.iloader.node.NodeException
Creates a tree structure based on the provided class definition and object.

Parameters:
classDef - a class definition which will be described by the resulting tree
object - the object that is to appear in the tree
Throws:
com.ibm.commons.iloader.node.NodeException - an exception will be generated if a null class definition is provided and the object provided does not have a corresponding class definition
See Also:
IClassDef

getPropertyTree

public DCPropertyTree getPropertyTree()
Returns the tree control associated with this node.

Returns:
a DCPropertyTree control associated with this node

getDataChangeNotifier

public final DataChangeNotifier getDataChangeNotifier()
A DataChangeNotifier associated with the property tree.

Returns:
the DataChangeNotifier associated with the property tree control, may be null.
See Also:
DataChangeNotifier

getLoader

public ILoader getLoader()
Returns an ILoader associated with this node.

Returns:
the ILoader which is used with this tree, may be null
See Also:
ILoader

isShowing

protected boolean isShowing()

isVisible

protected boolean isVisible()
Returns whether or not the current tree node is visible.

Returns:
true if visible

dispose

protected void dispose()
Disposes the TreeItem corresponding to this node.


fillItem

public abstract void fillItem()
Fill the contents of the corresponding TreeItem. Typically this method will call getTreeItem() and manipulate the resulting TreeItem.


getTreeItem

public org.eclipse.swt.widgets.TreeItem getTreeItem()
Returns the TreeItem associated with this tree node.

Returns:

refreshTree

public void refreshTree(DCPropertyTree tableTree)
Refreshes the contents of the given tree.

Parameters:
tableTree - the DCPropertyTree that is to be refreshed

addChild

public void addChild(TreeNode child)
Adds a child to the current node.

Parameters:
child -

getChildren

public java.util.ArrayList<TreeNode> getChildren()
Returns all of the children of the current node.

Returns:
a list of children, may be empty or null

toEdit

protected static java.lang.String toEdit(java.lang.String value)

clearChildrenNode

protected void clearChildrenNode()