public class AS400ListModel
extends java.lang.Object
implements javax.swing.ListModel, java.io.Serializable
Use this class if you want to customize the graphical user interface that presents a list. If you do not need to customize the interface, then use AS400ListPane instead.
Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.
AS400ListModel objects generate the following events:
The following example creates a list model filled with the contents of a directory in the integrated file system of a system. It then presents the list in a JList object.
// Set up the list model and JList. AS400 system = new AS400 ("MySystem", "Userid", "Password"); VIFSDirectory directory = new VIFSDirectory (system, "/myDirectory"); AS400ListModel listModel = new AS400ListModel (directory); listModel.load (); JList list = new JList (listModel);
// Add the JList to a frame. JFrame frame = new JFrame ("My Window"); frame.getContentPane().add(new JScrollPane(list));
AS400ListPane
,
Serialized FormConstructor and Description |
---|
AS400ListModel()
Deprecated.
Constructs an AS400ListModel object.
|
AS400ListModel(VNode root)
Deprecated.
Constructs an AS400ListModel object.
|
Modifier and Type | Method and Description |
---|---|
void |
addErrorListener(ErrorListener listener)
Deprecated.
Adds a listener to be notified when an error occurs.
|
void |
addListDataListener(javax.swing.event.ListDataListener listener)
Deprecated.
Adds a listener to be notified when the contents of
the list change.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.
Adds a listener to be notified when the value of any
bound property changes.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.
Adds a listener to be notified when the value of any
constrained property changes.
|
void |
addWorkingListener(WorkingListener listener)
Deprecated.
Adds a listener to be notified when work starts and stops
on potentially long-running operations.
|
java.lang.Object |
getElementAt(int index)
Deprecated.
Returns the element at the specifed index.
|
VNode |
getRoot()
Deprecated.
Returns the root, or the system resource, from which all information for the model is gathered.
|
int |
getSize()
Deprecated.
Returns the number of objects in the list.
|
void |
load()
Deprecated.
Loads the information from the system.
|
void |
removeErrorListener(ErrorListener listener)
Deprecated.
Removes an error listener.
|
void |
removeListDataListener(javax.swing.event.ListDataListener listener)
Deprecated.
Removes a list data listener.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.
Removes a property change listener.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.
Removes a vetoable change listener.
|
void |
removeWorkingListener(WorkingListener listener)
Deprecated.
Removes a working listener.
|
void |
setRoot(VNode root)
Deprecated.
Sets the root, or the system resource, from which all information for the model is gathered.
|
void |
sort(java.lang.Object[] propertyIdentifiers,
boolean[] orders)
Deprecated.
Sorts the contents.
|
public AS400ListModel()
public AS400ListModel(VNode root)
root
- The root, or the system resource, from which all information for the model is gathered.public void addErrorListener(ErrorListener listener)
listener
- The listener.public void addListDataListener(javax.swing.event.ListDataListener listener)
addListDataListener
in interface javax.swing.ListModel
listener
- The listener.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public void addWorkingListener(WorkingListener listener)
listener
- The listener.public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
index
- The index.public VNode getRoot()
public int getSize()
getSize
in interface javax.swing.ListModel
public void load()
public void removeErrorListener(ErrorListener listener)
listener
- The listener.public void removeListDataListener(javax.swing.event.ListDataListener listener)
removeListDataListener
in interface javax.swing.ListModel
listener
- The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public void removeWorkingListener(WorkingListener listener)
listener
- The listener.public void setRoot(VNode root) throws java.beans.PropertyVetoException
root
- The root, or the system resource, from which all information for the model is gathered.java.beans.PropertyVetoException
- If the change is vetoed.public void sort(java.lang.Object[] propertyIdentifiers, boolean[] orders)
propertyIdentifiers
- The property identifiers. If any of
the property identifiers are null, it
indicates 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.