|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.vaccess.AS400ListModel
public class AS400ListModel extends Object implements ListModel, Serializable
The AS400ListModel class implements an underlying model for a list, where all information for the model is gathered from the contents of a system resource, known as the root. You must explicitly call load() to load the information from the system.
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(ListDataListener listener)
Deprecated. Adds a listener to be notified when the contents of the list change. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Deprecated. Adds a listener to be notified when the value of any bound property changes. |
void |
addVetoableChangeListener(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. |
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(ListDataListener listener)
Deprecated. Removes a list data listener. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deprecated. Removes a property change listener. |
void |
removeVetoableChangeListener(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(Object[] propertyIdentifiers,
boolean[] orders)
Deprecated. 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 system resource, from which all information for the model is gathered.Method Detail |
---|
public void addErrorListener(ErrorListener listener)
listener
- The listener.public void addListDataListener(ListDataListener listener)
addListDataListener
in interface ListModel
listener
- The listener.public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener.public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener.public void addWorkingListener(WorkingListener listener)
listener
- The listener.public Object getElementAt(int index)
getElementAt
in interface ListModel
index
- The index.public VNode getRoot()
public int getSize()
getSize
in interface ListModel
public void load()
public void removeErrorListener(ErrorListener listener)
listener
- The listener.public void removeListDataListener(ListDataListener listener)
removeListDataListener
in interface ListModel
listener
- The listener.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener.public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener.public void removeWorkingListener(WorkingListener listener)
listener
- The listener.public void setRoot(VNode root) throws PropertyVetoException
root
- The root, or the system resource, from which all information for the model is gathered.PropertyVetoException
- If the change is vetoed.public void sort(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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |