All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.vaccess.AS400ListPane
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.ibm.as400.vaccess.AS400ListPane
- public class AS400ListPane
- extends JComponent
- implements Serializable
The AS400ListPane class represents a graphical user interface
that presents a list of the contents of an AS/400 resource,
known as the root. 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.
AS400ListPane objects generate the following events:
- ErrorEvent
- ListSelectionEvent
- PropertyChangeEvent
The following example creates a list pane filled with
the list of printers on an AS/400.
// Set up the list pane.
AS400 system = new AS400 ("MySystem", "Userid", "Password");
VPrinters printers = new VPrinters (system);
AS400ListPane listPane = new AS400ListPane (printers);
listPane.load ();
// Add the list pane to a frame.
JFrame frame = new JFrame ("My Window");
frame.getContentPane().add (listPane);
- See Also:
- AS400ListModel
-
AS400ListPane()
- Constructs an AS400ListPane object.
-
AS400ListPane(VNode)
- Constructs an AS400ListPane object.
-
addErrorListener(ErrorListener)
- Adds a listener to be notified when an error occurs.
-
addListSelectionListener(ListSelectionListener)
- Adds a listener to be notified when a list selection occurs.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to be notified when the value of any
bound property changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener to be notified when the value of any
constrained property changes.
-
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 list model.
-
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.
-
getVisibleRowCount()
- Returns the preferred number of visible rows.
-
isSelected(VObject)
- Indicates if the object is selected.
-
load()
- Loads the information from the AS/400.
-
removeErrorListener(ErrorListener)
- Removes an error listener.
-
removeListSelectionListener(ListSelectionListener)
- Removes a list selection listener.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a property change 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(ListSelectionModel)
- Sets the selection model that is used to maintain selection
state.
-
setVisibleRowCount(int)
- Sets the preferred number of visible rows.
-
sort(Object[], boolean[])
- Sorts the contents.
AS400ListPane
public AS400ListPane()
- Constructs an AS400ListPane object.
AS400ListPane
public AS400ListPane(VNode root)
- Constructs an AS400ListPane 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.
addListSelectionListener
public void addListSelectionListener(ListSelectionListener listener)
- Adds a listener to be notified when a list selection 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
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
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 ListModel getModel()
- Returns the list model.
- Returns:
- The list model.
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 VObject getSelectedObject()
- Returns the first selected object.
- Returns:
- The first selected object, or null if none are
selected.
getSelectedObjects
public VObject[] getSelectedObjects()
- Returns the selected objects.
- Returns:
- The selected objects.
getSelectionModel
public ListSelectionModel 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.
getVisibleRowCount
public int getVisibleRowCount()
- Returns the preferred number of visible rows.
- Returns:
- The preferred number of visible rows.
isSelected
public boolean isSelected(VObject object)
- Indicates if the object is selected.
- Parameters:
- object - The object.
- Returns:
- true if the object is selected; false otherwise.
load
public void load()
- Loads the information from the AS/400.
removeErrorListener
public void removeErrorListener(ErrorListener listener)
- Removes an error listener.
- Parameters:
- listener - The listener.
removeListSelectionListener
public void removeListSelectionListener(ListSelectionListener listener)
- Removes a list selection 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
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:
- pop-up menu on selected object
- double clicking on a object performs the default action.
The default is false.
- 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(ListSelectionModel 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.
setVisibleRowCount
public void setVisibleRowCount(int visibleRowCount)
- Sets the preferred number of visible rows.
- Parameters:
- visibleRowCount - The preferred number of visible rows.
sort
public void sort(Object propertyIdentifiers[],
boolean orders[])
- Sorts the contents. The propertyIdentifer[0], orders[0] combination is used to do the sort. If the values are equal, propertyIdentifier[1], orders[1] is used to break the tie, and so forth.
- Parameters:
- propertyIdentifiers - The property identifiers. If any of
the property identifiers are null, it
means to sort using the string
representation of the object.
- orders - The sort orders for each property
identifier; true for ascending order,
false for descending order.
All Packages Class Hierarchy This Package Previous Next Index