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
-
TreeViewPane(UIContext, HostContext, ResourceStack, Item, String)
- Construct a TreeViewPane.
-
addActionListener(ActionListener)
- Add a listener that gets called when an action is performed
on a node in the tree.
-
addTreeSelectionListener(TreeSelectionListener)
- Adds a listener for TreeSelection events.
-
collapseAll()
- Collapse all of the nodes in the tree.
-
expandAll()
- Expand all of the nodes in the tree.
-
extraCleanup()
- Dereference CategoryListeners so we get garbage-collected.
-
getAutoExpand()
- Get the current value of the autoExpand flag.
-
getJTree()
- Get the JTree.
-
getTreeNames()
- Get the names of the trees.
-
removeActionListener(ActionListener)
- Remove an Action listener.
-
removeTreeSelectionListener(TreeSelectionListener)
- Remove a TreeSelection listener.
-
setAutoExpand(boolean)
- Set the auto expand flag.
-
setRoot(Item)
- Change the root of the tree.
-
setTree(int)
- Choose the tree to display.
-
setTree(String)
- Choose the tree to display.
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.
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
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
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.
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
expandAll
public void expandAll()
- Expand all of the nodes in the tree.
collapseAll
public void collapseAll()
- Collapse all of the nodes in the tree.
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
getAutoExpand
public boolean getAutoExpand()
- Get the current value of the autoExpand flag.
- Returns:
- Current value of the autoExpand flag.
getJTree
public JTree getJTree()
- Get the JTree.
- Returns:
- The JTree displayed in the TreeViewPane.
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
removeTreeSelectionListener
public void removeTreeSelectionListener(TreeSelectionListener listener)
- Remove a TreeSelection listener.
- Parameters:
- listener - TreeSelectionListener to remove.
- See Also:
- JTree
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.
removeActionListener
public void removeActionListener(ActionListener listener)
- Remove an Action listener.
- Parameters:
- listener - listener to remove.
extraCleanup
public void extraCleanup()
- Dereference CategoryListeners so we get garbage-collected.
- See Also:
- ExtraCleanup
All Packages Class Hierarchy This Package Previous Next Index