|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.vaccess.AS400ListModel
The AS400ListModel class implements an underlying model for a list, where all information for the model is gathered from the contents of an AS/400 resource, known as the root. You must explicitly call load() to load the information from the AS/400.
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 an AS/400. 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 Summary | |
AS400ListModel()
Constructs an AS400ListModel object. |
|
AS400ListModel(VNode root)
Constructs an AS400ListModel object. |
Method Summary | |
void |
addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs. |
void |
addListDataListener(javax.swing.event.ListDataListener listener)
Adds a listener to be notified when the contents of the list change. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes. |
void |
addWorkingListener(WorkingListener listener)
Adds a listener to be notified when work starts and stops on potentially long-running operations. |
java.lang.Object |
getElementAt(int index)
Returns the element at the specifed index. |
VNode |
getRoot()
Returns the root, or the AS/400 resource, from which all information for the model is gathered. |
int |
getSize()
Returns the number of objects in the list. |
void |
load()
Loads the information from the AS/400. |
void |
removeErrorListener(ErrorListener listener)
Removes an error listener. |
void |
removeListDataListener(javax.swing.event.ListDataListener listener)
Removes a list data listener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a vetoable change listener. |
void |
removeWorkingListener(WorkingListener listener)
Removes a working listener. |
void |
setRoot(VNode root)
Sets the root, or the AS/400 resource, from which all information for the model is gathered. |
void |
sort(java.lang.Object[] propertyIdentifiers,
boolean[] orders)
Sorts the contents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AS400ListModel()
public AS400ListModel(VNode root)
root
- The root, or the AS/400 resource, from which all information for the model is gathered.Method Detail |
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 AS/400 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |