All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.treeView.TreeViewPane

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JScrollPane
                                   |
                                   +----com.sgi.sysadm.ui.treeView.TreeViewPane

public class TreeViewPane
extends JScrollPane
implements TreeViewProperties, ExtraCleanup

TreeViewPane contains a scrolling tree pane. The pane may display a number of different trees, one at a time.

The structure of the tree is defined by properties in the ResourceStack:

<prefix>.tree<n> specifies an array of tree names, one for each tree structure. For each treename so specified, <prefix>.<treename>.level<n> specifies an array of Category corresponding to each level in the tree.

The Category at level 0 of each tree must match the type of the root Item of the TreeViewPane. Each level of the tree is populated by the members of an Association between the Item we're displaying and the Category at the next level. For each Item in level <n>, we monitor the Association with the Category at level <n+1>.

If it is necessary to use a Category instead of an Association at a given level in the tree, specify it by setting the property

   <prefix>.<treename>.level<n>.useAssoc = false

See Also:
TreeViewProperties, JScrollPane

Constructor Index

 o TreeViewPane(UIContext, HostContext, ResourceStack, Item, String)
Construct a TreeViewPane.

Method Index

 o addActionListener(ActionListener)
Add a listener that gets called when an action is performed on a node in the tree.
 o addTreeSelectionListener(TreeSelectionListener)
Adds a listener for TreeSelection events.
 o collapseAll()
Collapse all of the nodes in the tree.
 o expandAll()
Expand all of the nodes in the tree.
 o extraCleanup()
Dereference CategoryListeners so we get garbage-collected.
 o getAutoExpand()
Get the current value of the autoExpand flag.
 o getJTree()
Get the JTree.
 o getTreeNames()
Get the names of the trees.
 o removeActionListener(ActionListener)
Remove an Action listener.
 o removeTreeSelectionListener(TreeSelectionListener)
Remove a TreeSelection listener.
 o setAutoExpand(boolean)
Set the auto expand flag.
 o setRoot(Item)
Change the root of the tree.
 o setTree(int)
Choose the tree to display.
 o setTree(String)
Choose the tree to display.

Constructors

 o TreeViewPane
 public TreeViewPane(UIContext uic,
                     HostContext hc,
                     ResourceStack rs,
                     Item rootItem,
                     String prefix)
Construct a TreeViewPane. Read the specifications of the trees we will display from the ResourceStack.

Parameters:
uic - UIContext for busy state.
hc - HostContext for getting Categories.
rs - ResourceStack for getting tree structure.
rootItem - Item at the root of the tree.
prefix - String used to retrieve properties from the ResourceStack.

Methods

 o setTree
 public void setTree(int treeIndex)
Choose the tree to display. The list of trees is specified by the TREE property.

Parameters:
treeIndex - Index of the tree to display. If the specified tree does not exist, nothing happens.
See Also:
TREE
 o setTree
 public void setTree(String treeName)
Choose the tree to display. The list of trees is specified by the TREE property.

Parameters:
treeName - name of the tree to display. If the tree by that name cannot be found, nothing happens.
See Also:
TREE
 o setRoot
 public void setRoot(Item rootItem)
Change the root of the tree.

Parameters:
rootItem - the new item to be at the root of the tree.
 o getTreeNames
 public String[] getTreeNames()
Get the names of the trees. The list of trees is specified by the TREE property.

Returns:
An array of tree names
See Also:
TREE
 o expandAll
 public void expandAll()
Expand all of the nodes in the tree.

 o collapseAll
 public void collapseAll()
Collapse all of the nodes in the tree.

 o setAutoExpand
 public void setAutoExpand(boolean autoExpand)
Set the auto expand flag. When autoExpand is true, parent nodes automatically expand when children are added, and expandAll is called immediately. By default, nodes are automatically expanded.

Parameters:
autoExpand - Whether or not to automatically expand child nodes.
See Also:
expandAll, collapseAll
 o getAutoExpand
 public boolean getAutoExpand()
Get the current value of the autoExpand flag.

Returns:
Current value of the autoExpand flag.
 o getJTree
 public JTree getJTree()
Get the JTree.

Returns:
The JTree displayed in the TreeViewPane.
 o addTreeSelectionListener
 public void addTreeSelectionListener(TreeSelectionListener listener)
Adds a listener for TreeSelection events.

Parameters:
listener - the TreeSelectionListener that will be notified when a node is selected or deselected (a "negative selection")
See Also:
JTree
 o removeTreeSelectionListener
 public void removeTreeSelectionListener(TreeSelectionListener listener)
Remove a TreeSelection listener.

Parameters:
listener - TreeSelectionListener to remove.
See Also:
JTree
 o addActionListener
 public void addActionListener(ActionListener listener)
Add a listener that gets called when an action is performed on a node in the tree. This event is triggered by the user single-clicking on a node in the tree.

Parameters:
listener - listener to add.
 o removeActionListener
 public void removeActionListener(ActionListener listener)
Remove an Action listener.

Parameters:
listener - listener to remove.
 o extraCleanup
 public void extraCleanup()
Dereference CategoryListeners so we get garbage-collected.

See Also:
ExtraCleanup

All Packages  Class Hierarchy  This Package  Previous  Next  Index