org.openide.explorer 6.5.22 1

org.openide.explorer.view
Class NodeTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by org.openide.explorer.view.NodeTreeModel
All Implemented Interfaces:
Serializable, TreeModel

public class NodeTreeModel
extends DefaultTreeModel

Model for displaying the nodes in tree.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
NodeTreeModel()
          Creates new NodeTreeModel
NodeTreeModel(Node root)
          Creates new NodeTreeModel
 
Method Summary
 void setNode(Node root)
          Changes the root of the model.
 void valueForPathChanged(TreePath path, Object newValue)
          This sets the user object of the TreeNode identified by path and posts a node changed.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTreeModel

public NodeTreeModel()
Creates new NodeTreeModel


NodeTreeModel

public NodeTreeModel(Node root)
Creates new NodeTreeModel

Parameters:
root - the root of the model
Method Detail

setNode

public void setNode(Node root)
Changes the root of the model. This is thread safe method.

Parameters:
root - the root of the model

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
This sets the user object of the TreeNode identified by path and posts a node changed. If you use custom user objects in the TreeModel you'returngoing to need to subclass this and set the user object of the changed node to something meaningful.

Specified by:
valueForPathChanged in interface TreeModel
Overrides:
valueForPathChanged in class DefaultTreeModel

org.openide.explorer 6.5.22 1

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.