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

NodeListModel (NetBeans Explorer API) - NetBeans API Javadoc 5.0.0

 

org.openide.explorer.view
Class NodeListModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byorg.openide.explorer.view.NodeListModel
All Implemented Interfaces:
ComboBoxModel, ListModel, Serializable

public class NodeListModel
extends AbstractListModel
implements ComboBoxModel

Model for displaying the nodes in list and choice.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
NodeListModel()
          Creates new NodeTreeModel
NodeListModel(Node root)
          Creates new NodeTreeModel
 
Method Summary
 int getDepth()
          Getter for depth.
 Object getElementAt(int i)
          Child at given index.
 int getIndex(Object o)
          Finds index of given object.
 Object getSelectedItem()
           
 int getSize()
          Number of elements in the model.
 void setDepth(int depth)
          Depth of nodes to display.
 void setNode(Node root)
          Changes the root of the model.
 void setSelectedItem(Object anObject)
          Currently selected item.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Constructor Detail

NodeListModel

public NodeListModel()
Creates new NodeTreeModel


NodeListModel

public NodeListModel(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

setDepth

public void setDepth(int depth)
Depth of nodes to display.

Parameters:
depth - the depth

getDepth

public int getDepth()
Getter for depth.

Returns:
number of levels to display

getSize

public int getSize()
Number of elements in the model.

Specified by:
getSize in interface ListModel

getElementAt

public Object getElementAt(int i)
Child at given index.

Specified by:
getElementAt in interface ListModel

getIndex

public int getIndex(Object o)
Finds index of given object.

Parameters:
o - object produced by this model
Returns:
index, or -1 if the object is not in the list

setSelectedItem

public void setSelectedItem(Object anObject)
Currently selected item.

Specified by:
setSelectedItem in interface ComboBoxModel

getSelectedItem

public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel

 

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