All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.vaccess.AS400TreePane

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.ibm.as400.vaccess.AS400TreePane

public class AS400TreePane
extends JComponent
implements Serializable
The AS400TreePane class represents a graphical user interface that presents a tree, where all information for the tree is gathered from the hierarchy of objects rooted at an AS/400 resource. You must explicitly call load() to load the information from the AS/400.

Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.

AS400TreePane objects generate the following events:

The following example creates a tree pane filled with the contents of a directory in the integrated file system of an AS/400.

// Set up the tree pane.
AS400 system = new AS400 ("MySystem", "Userid", "Password");
VIFSDirectory directory = new VIFSDirectory (system, "/myDirectory");
AS400TreePane treePane = new AS400TreePane (directory);
treePane.load ();

// Add the tree pane to a frame. JFrame frame = new JFrame ("My Window"); frame.getContentPane().add (treePane);

See Also:
AS400TreeModel

Constructor Index

 o AS400TreePane()
Constructs an AS400TreePane object.
 o AS400TreePane(VNode)
Constructs an AS400TreePane object.

Method Index

 o addErrorListener(ErrorListener)
Adds a listener to be notified when an error occurs.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener to be notified when the value of any bound property changes.
 o addTreeSelectionListener(TreeSelectionListener)
Adds a listener to be notified when a tree selection occurs.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener to be notified when the value of any constrained property changes.
 o collapse(VNode)
Collapses the specified object.
 o expand(VNode)
Expands the specified object.
 o getActionContext()
Returns the context in which actions will be performed.
 o getAllowActions()
Indicates if actions can be invoked on objects.
 o getConfirm()
Indicates if certain actions are confirmed with the user.
 o getModel()
Returns the model which contains the data for the tree.
 o getPath(VNode)
Returns the path from the root to get to this object in the tree hierarchy.
 o getRoot()
Returns the root, or the AS/400 resource, from which all information for the model is gathered.
 o getSelectedObject()
Returns the first selected object.
 o getSelectedObjects()
Returns the selected objects.
 o getSelectionModel()
Returns the selection model that is used to maintain selection state.
 o isCollapsed(VNode)
Indicates if the object is currently collapsed.
 o isExpanded(VNode)
Indicates if the object is currently expanded.
 o isSelected(VNode)
Indicates if the object is selected.
 o isVisible(VNode)
Indicates if the object is currently visible.
 o load()
Loads the information from the AS/400.
 o makeVisible(VNode)
Makes the object visible in the tree by expanding its parent objects as needed.
 o removeErrorListener(ErrorListener)
Removes an error listener.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a property change listener.
 o removeTreeSelectionListener(TreeSelectionListener)
Removes a tree selection listener.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable change listener.
 o setAllowActions(boolean)
Sets whether actions are allowed.
 o setConfirm(boolean)
Sets whether certain actions are confirmed with the user.
 o setRoot(VNode)
Sets the root, or the AS/400 resource, from which all information for the model is gathered.
 o setSelectionModel(TreeSelectionModel)
Sets the selection model that is used to maintain selection state.

Constructors

 o AS400TreePane
 public AS400TreePane()
Constructs an AS400TreePane object.

 o AS400TreePane
 public AS400TreePane(VNode root)
Constructs an AS400TreePane object.

Parameters:
root - The root, or the AS/400 resource, from which all information for the model is gathered.

Methods

 o addErrorListener
 public void addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs.

Parameters:
listener - The listener.
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes.

Parameters:
listener - The listener.
Overrides:
addPropertyChangeListener in class JComponent
 o addTreeSelectionListener
 public void addTreeSelectionListener(TreeSelectionListener listener)
Adds a listener to be notified when a tree selection occurs.

Parameters:
listener - The listener.
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes.

Parameters:
listener - The listener.
Overrides:
addVetoableChangeListener in class JComponent
 o collapse
 public void collapse(VNode object)
Collapses the specified object.

Parameters:
object - The object.
 o expand
 public void expand(VNode object)
Expands the specified object.

Parameters:
object - The object.
 o getActionContext
 public VActionContext getActionContext()
Returns the context in which actions will be performed.

Returns:
The action context.
 o getAllowActions
 public boolean getAllowActions()
Indicates if actions can be invoked on objects.

Returns:
true if actions can be invoked; false otherwise.
 o getConfirm
 public boolean getConfirm()
Indicates if certain actions are confirmed with the user.

Returns:
true if certain actions are confirmed with the user; false otherwise.
 o getModel
 public TreeModel getModel()
Returns the model which contains the data for the tree.

Returns:
The tree model.
 o getPath
 public TreePath getPath(VNode object)
Returns the path from the root to get to this object in the tree hierarchy. The last element in the path will be this object.

Parameters:
object - The object.
Returns:
The path, or null if the object is not a valid object.
 o getRoot
 public VNode getRoot()
Returns the root, or the AS/400 resource, from which all information for the model is gathered.

Returns:
The root, or the AS/400 resource, from which all information for the model is gathered. It will be null if none has been set.
 o getSelectedObject
 public VNode getSelectedObject()
Returns the first selected object.

Returns:
The first selected object, or null if none are selected.
 o getSelectedObjects
 public VNode[] getSelectedObjects()
Returns the selected objects.

Returns:
The selected objects.
 o getSelectionModel
 public TreeSelectionModel getSelectionModel()
Returns the selection model that is used to maintain selection state. This provides the ability to programmatically select and deselect objects.

Returns:
The selection model, or null if selections are not allowed.
 o isCollapsed
 public boolean isCollapsed(VNode object)
Indicates if the object is currently collapsed.

Parameters:
object - The object.
Returns:
true if the object is collapsed; false otherwise.
 o isExpanded
 public boolean isExpanded(VNode object)
Indicates if the object is currently expanded.

Parameters:
object - The object.
Returns:
true if the object is expanded; false otherwise.
 o isSelected
 public boolean isSelected(VNode object)
Indicates if the object is selected.

Parameters:
object - The object.
Returns:
true if the object is selected; false otherwise.
 o isVisible
 public boolean isVisible(VNode object)
Indicates if the object is currently visible.

Parameters:
object - The object.
Returns:
true if the object is visible; false otherwise.
 o load
 public void load()
Loads the information from the AS/400.

 o makeVisible
 public void makeVisible(VNode object)
Makes the object visible in the tree by expanding its parent objects as needed.

Parameters:
object - The object.
 o removeErrorListener
 public void removeErrorListener(ErrorListener listener)
Removes an error listener.

Parameters:
listener - The listener.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.

Parameters:
listener - The listener.
Overrides:
removePropertyChangeListener in class JComponent
 o removeTreeSelectionListener
 public void removeTreeSelectionListener(TreeSelectionListener listener)
Removes a tree selection listener.

Parameters:
listener - The listener.
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable change listener.

Parameters:
listener - The listener.
Overrides:
removeVetoableChangeListener in class JComponent
 o setAllowActions
 public void setAllowActions(boolean allowActions)
Sets whether actions are allowed. The following are enabled only when actions are allowed:

The default is true.

Parameters:
allowActions - true if actions are allowed; false otherwise.
 o setConfirm
 public void setConfirm(boolean confirm)
Sets whether certain actions are confirmed with the user. The default is true.

Parameters:
confirm - true if certain actions are confirmed with the user; false otherwise.
 o setRoot
 public void setRoot(VNode root) throws PropertyVetoException
Sets the root, or the AS/400 resource, from which all information for the model is gathered. It will not take effect until load() is done.

Parameters:
root - The root, or the AS/400 resource, from which all information for the model is gathered.
Throws: PropertyVetoException
If the change is vetoed.
 o setSelectionModel
 public void setSelectionModel(TreeSelectionModel selectionModel)
Sets the selection model that is used to maintain selection state. This provides the ability to programmatically select and deselect objects.

Parameters:
selectionModel - The selection model, or null if selections are not allowed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index