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:
- ErrorEvent
- PropertyChangeEvent
- TreeSelectionEvent
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
-
AS400TreePane()
- Constructs an AS400TreePane object.
-
AS400TreePane(VNode)
- Constructs an AS400TreePane object.
-
addErrorListener(ErrorListener)
- Adds a listener to be notified when an error occurs.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to be notified when the value of any
bound property changes.
-
addTreeSelectionListener(TreeSelectionListener)
- Adds a listener to be notified when a tree selection occurs.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener to be notified when the value of any
constrained property changes.
-
collapse(VNode)
- Collapses the specified object.
-
expand(VNode)
- Expands the specified object.
-
getActionContext()
- Returns the context in which actions will be performed.
-
getAllowActions()
- Indicates if actions can be invoked on objects.
-
getConfirm()
- Indicates if certain actions are confirmed with the user.
-
getModel()
- Returns the model which contains the data for the tree.
-
getPath(VNode)
- Returns the path from the root to get to this object in the tree
hierarchy.
-
getRoot()
- Returns the root, or the AS/400 resource, from which all information for the model is gathered.
-
getSelectedObject()
- Returns the first selected object.
-
getSelectedObjects()
- Returns the selected objects.
-
getSelectionModel()
- Returns the selection model that is used to maintain
selection state.
-
isCollapsed(VNode)
- Indicates if the object is currently collapsed.
-
isExpanded(VNode)
- Indicates if the object is currently expanded.
-
isSelected(VNode)
- Indicates if the object is selected.
-
isVisible(VNode)
- Indicates if the object is currently visible.
-
load()
- Loads the information from the AS/400.
-
makeVisible(VNode)
- Makes the object visible in the tree by expanding its
parent objects as needed.
-
removeErrorListener(ErrorListener)
- Removes an error listener.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a property change listener.
-
removeTreeSelectionListener(TreeSelectionListener)
- Removes a tree selection listener.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable change listener.
-
setAllowActions(boolean)
- Sets whether actions are allowed.
-
setConfirm(boolean)
- Sets whether certain actions are confirmed with the user.
-
setRoot(VNode)
- Sets the root, or the AS/400 resource, from which all information for the model is gathered.
-
setSelectionModel(TreeSelectionModel)
- Sets the selection model that is used to maintain selection
state.
AS400TreePane
public AS400TreePane()
- Constructs an AS400TreePane object.
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.
addErrorListener
public void addErrorListener(ErrorListener listener)
- Adds a listener to be notified when an error occurs.
- Parameters:
- listener - The listener.
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
addTreeSelectionListener
public void addTreeSelectionListener(TreeSelectionListener listener)
- Adds a listener to be notified when a tree selection occurs.
- Parameters:
- listener - The listener.
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
collapse
public void collapse(VNode object)
- Collapses the specified object.
- Parameters:
- object - The object.
expand
public void expand(VNode object)
- Expands the specified object.
- Parameters:
- object - The object.
getActionContext
public VActionContext getActionContext()
- Returns the context in which actions will be performed.
- Returns:
- The action context.
getAllowActions
public boolean getAllowActions()
- Indicates if actions can be invoked on objects.
- Returns:
- true if actions can be invoked; false otherwise.
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.
getModel
public TreeModel getModel()
- Returns the model which contains the data for the tree.
- Returns:
- The tree model.
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.
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.
getSelectedObject
public VNode getSelectedObject()
- Returns the first selected object.
- Returns:
- The first selected object, or null if none are
selected.
getSelectedObjects
public VNode[] getSelectedObjects()
- Returns the selected objects.
- Returns:
- The selected objects.
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.
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.
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.
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.
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.
load
public void load()
- Loads the information from the AS/400.
makeVisible
public void makeVisible(VNode object)
- Makes the object visible in the tree by expanding its
parent objects as needed.
- Parameters:
- object - The object.
removeErrorListener
public void removeErrorListener(ErrorListener listener)
- Removes an error listener.
- Parameters:
- listener - The listener.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a property change listener.
- Parameters:
- listener - The listener.
- Overrides:
- removePropertyChangeListener in class JComponent
removeTreeSelectionListener
public void removeTreeSelectionListener(TreeSelectionListener listener)
- Removes a tree selection listener.
- Parameters:
- listener - The listener.
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable change listener.
- Parameters:
- listener - The listener.
- Overrides:
- removeVetoableChangeListener in class JComponent
setAllowActions
public void setAllowActions(boolean allowActions)
- Sets whether actions are allowed. The following are enabled only when
actions are allowed:
- popup menu on selected object
The default is true.
- Parameters:
- allowActions - true if actions are allowed; false otherwise.
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.
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.
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