com.fullspan.pwkeep.model
Class PwkTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.fullspan.pwkeep.model.PwkTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class PwkTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

Represents a node in the PWKeep hierarchy of categories and items.

Version:
$Revision: 1.4 $, $Date: 2004/01/18 08:09:06 $
Author:
Mitch Stuart, $Author: mitch $
See Also:
Serialized Form

Field Summary
static java.util.Comparator COMPARATOR
          Comparator for case-insensitive alphabetical comparison/sorting based on the name of the PwkBean (category or item) stored in each node.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
PwkTreeNode(PwkBean pwkBean, boolean allowsChildren)
           
 
Method Summary
 PwkBean getBean()
          Returns the PwkBean stored in this tree node.
 void sortChildren()
          Sorts the immediate children of the current node without descending the tree and sorting lower levels.
 void sortChildren(boolean recurse)
          Sorts the children of the current node, optionally descending the tree and sorting lower levels.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARATOR

public static final java.util.Comparator COMPARATOR
Comparator for case-insensitive alphabetical comparison/sorting based on the name of the PwkBean (category or item) stored in each node.

See Also:
PwkBean.getName()
Constructor Detail

PwkTreeNode

public PwkTreeNode(PwkBean pwkBean,
                   boolean allowsChildren)
Method Detail

getBean

public PwkBean getBean()
Returns the PwkBean stored in this tree node.

Returns:
the PwkBean stored in this node

sortChildren

public void sortChildren()
Sorts the immediate children of the current node without descending the tree and sorting lower levels.

Equivalent to calling sortChildren(false)


sortChildren

public void sortChildren(boolean recurse)
Sorts the children of the current node, optionally descending the tree and sorting lower levels.

Uses COMPARATOR to perform a case-insensitive sort of the child nodes.

Parameters:
recurse - true to sort all levels of the tree below this node, false to sort only the immediate children of this node
See Also:
COMPARATOR