org.openide.explorer.view
Class NodeListModel
java.lang.Object
|
+--javax.swing.AbstractListModel
|
+--org.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeListModel
public NodeListModel()
- Creates new NodeTreeModel
NodeListModel
public NodeListModel(Node root)
- Creates new NodeTreeModel
- Parameters:
root
- the root of the model
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
- Overrides:
getSize
in class AbstractListModel
getElementAt
public Object getElementAt(int i)
- Child at given index.
- Specified by:
getElementAt
in interface ListModel
- Overrides:
getElementAt
in class AbstractListModel
getIndex
public int getIndex(Object o)
- Finds index of given object.
- Parameters:
obj
- object produced by this model- Returns:
- if the object is not in the list, then return -1
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 December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.