Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.explorer 6.5.22 1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.explorer.view
Class NodeListModel

    java.lang.Object
      javax.swing.AbstractListModel
          org.openide.explorer.view.NodeListModel

All Implemented Interfaces:
  Serializable, ComboBoxModel, ListModel

    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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.explorer 6.5.22 1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.