站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

NodeTreeModel (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.explorer.view
Class NodeTreeModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeModel
      extended byorg.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.



Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.