com.ibm.as400.vaccess
Class AS400ListModel

java.lang.Object
  extended by com.ibm.as400.vaccess.AS400ListModel
All Implemented Interfaces:
Serializable, ListModel

Deprecated. Use Java Swing instead, along with the classes in package com.ibm.as400.access

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));

See Also:
AS400ListPane, Serialized Form

Constructor Summary
Constructor and Description
AS400ListModel()
          Deprecated. Constructs an AS400ListModel object.
AS400ListModel(VNode root)
          Deprecated. Constructs an AS400ListModel object.
 
Method Summary
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

AS400ListModel

public AS400ListModel()
Deprecated. 
Constructs an AS400ListModel object.


AS400ListModel

public AS400ListModel(VNode root)
Deprecated. 
Constructs an AS400ListModel object.

Parameters:
root - The root, or the system resource, from which all information for the model is gathered.
Method Detail

addErrorListener

public void addErrorListener(ErrorListener listener)
Deprecated. 
Adds a listener to be notified when an error occurs.

Parameters:
listener - The listener.

addListDataListener

public void addListDataListener(ListDataListener listener)
Deprecated. 
Adds a listener to be notified when the contents of the list change.

Specified by:
addListDataListener in interface ListModel
Parameters:
listener - The listener.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Deprecated. 
Adds a listener to be notified when the value of any bound property changes.

Parameters:
listener - The listener.

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener listener)
Deprecated. 
Adds a listener to be notified when the value of any constrained property changes.

Parameters:
listener - The listener.

addWorkingListener

public void addWorkingListener(WorkingListener listener)
Deprecated. 
Adds a listener to be notified when work starts and stops on potentially long-running operations.

Parameters:
listener - The listener.

getElementAt

public Object getElementAt(int index)
Deprecated. 
Returns the element at the specifed index.

Specified by:
getElementAt in interface ListModel
Parameters:
index - The index.
Returns:
The element at the specified index. It will be null if the index is not valid or the root has not been set.

getRoot

public VNode getRoot()
Deprecated. 
Returns the root, or the system resource, from which all information for the model is gathered.

Returns:
The root, or the system resource, from which all information for the model is gathered. It will be null if none has been set.

getSize

public int getSize()
Deprecated. 
Returns the number of objects in the list.

Specified by:
getSize in interface ListModel
Returns:
The number of objects in the list.

load

public void load()
Deprecated. 
Loads the information from the system.


removeErrorListener

public void removeErrorListener(ErrorListener listener)
Deprecated. 
Removes an error listener.

Parameters:
listener - The listener.

removeListDataListener

public void removeListDataListener(ListDataListener listener)
Deprecated. 
Removes a list data listener.

Specified by:
removeListDataListener in interface ListModel
Parameters:
listener - The listener.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Deprecated. 
Removes a property change listener.

Parameters:
listener - The listener.

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener listener)
Deprecated. 
Removes a vetoable change listener.

Parameters:
listener - The listener.

removeWorkingListener

public void removeWorkingListener(WorkingListener listener)
Deprecated. 
Removes a working listener.

Parameters:
listener - The listener.

setRoot

public void setRoot(VNode root)
             throws PropertyVetoException
Deprecated. 
Sets the root, or the system 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 system resource, from which all information for the model is gathered.
Throws:
PropertyVetoException - If the change is vetoed.

sort

public void sort(Object[] propertyIdentifiers,
                 boolean[] orders)
Deprecated. 
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 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.