All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class improv.util.NestedList

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.List
                   |
                   +----improv.util.NestedList

public final class NestedList
extends List
A NestedList presents the user with a collapsable hierarchical list. This is currently a wrapper on the simple AWT List, which is used to display the list.


Constructor Index

 o NestedList(int)
constructs a list manager for a particular AWT List object

Method Index

 o addItem(Object, int, Object, String)
Adds a new entry with a key value -key- beneath the parent entry identified by -parentKey-.
 o addItem(Object, Object, String)
Add a new entry to the list at the end position.
 o addItem(Object, String)
Add a new top-level entry to the list, identified by the object -key-, with the given label -label-.
 o clear()
 o collapse(Object)
Collapse a list
 o elementAt(int)
 o expand(Object)
Expand a list
 o getLabel(Object)
 o getParent(Object)
 o getSelection()
 o getVisible(Object)
Gets the visibility of an object in the list
 o hasChildren(Object)
 o indexOf(Object)
 o insertAfter(Object, Object, String)
Add a new entry just after the entry identified by prevKey (i.e.
 o isExpanded(Object)
Find out if an object in the list should display its sub-objects
 o isPresent(Object)
 o refresh()
refreshes the contents of a list
 o remove(Object)
Removes an object from the list.
 o setChildrenVisible(Object, boolean)
Specifies if an object in the list should display its sub-objects
 o setLabel(Object, String)
Sets the label used for a particular list object
 o setSelection(Object)
Select an object in the list (nothing happens if the object is not visible or is not in the list)
 o setVisible(Object, boolean)
Sets the visibility of an object in the list

Constructors

 o NestedList
 public NestedList(int numcols)
constructs a list manager for a particular AWT List object

Methods

 o addItem
 public void addItem(Object parentKey,
                     int pos,
                     Object key,
                     String label)
Adds a new entry with a key value -key- beneath the parent entry identified by -parentKey-. The string -label- is the label to use for the entry.

 o addItem
 public void addItem(Object key,
                     String label)
Add a new top-level entry to the list, identified by the object -key-, with the given label -label-.

 o addItem
 public void addItem(Object parent,
                     Object key,
                     String label)
Add a new entry to the list at the end position.

 o insertAfter
 public void insertAfter(Object prevKey,
                         Object key,
                         String label)
Add a new entry just after the entry identified by prevKey (i.e. at the same level as prevKey).

 o remove
 public void remove(Object key)
Removes an object from the list. Does nothing if the object is not in the list.

 o clear
 public void clear()
Overrides:
clear in class List
 o setLabel
 public void setLabel(Object key,
                      String label)
Sets the label used for a particular list object

 o getLabel
 public String getLabel(Object key)
Returns:
the label used for a particular list object
 o getParent
 public Object getParent(Object key)
Returns:
the 'parent' key of an object in the list, or null if the object has no parent.
 o hasChildren
 public boolean hasChildren(Object key)
Returns:
true if a given key is in the list, and there are nested children beneath the key.
 o getSelection
 public Object getSelection()
Returns:
which object is selected in the list
 o setSelection
 public void setSelection(Object key)
Select an object in the list (nothing happens if the object is not visible or is not in the list)

 o isExpanded
 public boolean isExpanded(Object key)
Find out if an object in the list should display its sub-objects

 o setChildrenVisible
 public void setChildrenVisible(Object key,
                                boolean value)
Specifies if an object in the list should display its sub-objects

 o expand
 public void expand(Object key)
Expand a list

 o collapse
 public void collapse(Object key)
Collapse a list

 o getVisible
 public boolean getVisible(Object key)
Gets the visibility of an object in the list

 o setVisible
 public void setVisible(Object key,
                        boolean value)
Sets the visibility of an object in the list

 o isPresent
 public boolean isPresent(Object key)
Returns:
true if a particular object is in the list.
 o elementAt
 public Object elementAt(int position)
Returns:
the object at a given list position
 o indexOf
 public int indexOf(Object key)
Returns:
the list position for a given key
 o refresh
 public void refresh()
refreshes the contents of a list


All Packages  Class Hierarchy  This Package  Previous  Next  Index