Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.ui.checktree
Class TriStateNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by oracle.javatools.ui.checktree.TriStateNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class TriStateNode
extends javax.swing.tree.DefaultMutableTreeNode

A type of DefaultMutableTreeNode for use in a CheckboxTree. The node has a NodeState which determines the checkbox rendering in the CheckboxTree. Override the getLabel() of this node to return the label displayed for this node in the tree. Similarly Override getIcon() to return the appropriate icon for this node.

Since:
11.0
See Also:
Serialized Form

Nested Class Summary
static class TriStateNode.NodeState
           
 
Field Summary
static java.lang.String PROP_STATE_CHANGE
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TriStateNode(java.lang.Object userData)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          PropertyChangeEvents with the PROP_STATE_CHANGE id will be fired when this node changes state.
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
 javax.swing.Icon getIcon()
          Return the icon used to render this object in the tree.
 java.lang.String getLabel()
          Return the text used to render this object in the tree.
 TriStateNode.NodeState getNodeState()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
           
 void setNodeState(TriStateNode.NodeState nodeState)
          Set this node to the given status.
 void setNodeState(TriStateNode.NodeState nodeState, boolean propagateStateUp, boolean propagateStateDown)
          Set the state of this node, and optionally set the children and ancestors to appropriate status.
 void sort()
          Sort the children of this node, and recursively their children Most derivisions will probably want to override compareTo(...) to get an appropriate sort.
 
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

PROP_STATE_CHANGE

public static final java.lang.String PROP_STATE_CHANGE
See Also:
Constant Field Values
Constructor Detail

TriStateNode

public TriStateNode(java.lang.Object userData)
Method Detail

setNodeState

public void setNodeState(TriStateNode.NodeState nodeState)
Set this node to the given status. The children and ancestor nodes will automatically by set to the appropriate state.

Parameters:
nodeState -

setNodeState

public void setNodeState(TriStateNode.NodeState nodeState,
                         boolean propagateStateUp,
                         boolean propagateStateDown)
Set the state of this node, and optionally set the children and ancestors to appropriate status.

Parameters:
nodeState - - the new state to set on this node.
propagateStateUp - - examine the parents all the way to the root, and set the state appropriatly (not necessarily the same state as this node)
propagateStateDown - - examine the children all the way to the leaves, and set the state to the same given value.

getNodeState

public TriStateNode.NodeState getNodeState()

sort

public void sort()
Sort the children of this node, and recursively their children Most derivisions will probably want to override compareTo(...) to get an appropriate sort.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
PropertyChangeEvents with the PROP_STATE_CHANGE id will be fired when this node changes state.

Parameters:
pcl -

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

getIcon

public javax.swing.Icon getIcon()
Return the icon used to render this object in the tree.

Returns:
null by default.

getLabel

public java.lang.String getLabel()
Return the text used to render this object in the tree. By default returns the toString() representation of the this node, which is usually the userObject.toString().

Returns:
the text to render

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.