All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.vaccess.AS400DetailsModel

java.lang.Object
   |
   +----com.ibm.as400.vaccess.AS400DetailsModel

public class AS400DetailsModel
extends Object
implements TableModel, Serializable
The AS400DetailsModel class implements an underlying model for a table, 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 table. If you do not need to customize the interface, then use AS400DetailsPane 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.

AS400DetailsModel objects generate the following events:

The following example creates a details model filled with details about the jobs running on an AS/400. It then presents the table in a JTable object.


// Set up the details model and JTable. AS400 system = new AS400 ("MySystem", "Userid", "Password"); VJobList jobList = new VJobList (system); AS400DetailsModel detailsModel = new AS400DetailsModel (jobList); detailsModel.load (); JTable table = new JTable (detailsModel);
// Add the JTable to a frame. JFrame frame = new JFrame ("My Window"); frame.getContentPane().add(JTable.createScrollPaneForTable(table));

See Also:
AS400DetailsPane

Constructor Index

 o AS400DetailsModel()
Constructs an AS400DetailsModel object.
 o AS400DetailsModel(VNode)
Constructs an AS400DetailsModel object.

Method Index

 o addErrorListener(ErrorListener)
Adds a listener to be notified when an error occurs.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener to be notified when the value of any bound property changes.
 o addTableModelListener(TableModelListener)
Adds a listener to be notified when the contents of the table change.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener to be notified when the value of any constrained property changes.
 o addWorkingListener(WorkingListener)
Adds a listener to be notified when work starts and stops on potentially long-running operations.
 o getColumnClass(int)
Returns the class for objects that are contained in a column.
 o getColumnCount()
Returns the number of columns.
 o getColumnName(int)
Returns the name of a column.
 o getObjectAt(int)
Returns the object at the specifed row.
 o getRoot()
Returns the root, or the AS/400 resource, from which all information for the model is gathered.
 o getRowCount()
Returns the number of rows in the table.
 o getValueAt(int, int)
Returns the value at the specifed row and column.
 o isCellEditable(int, int)
Indicates if the cell is editable.
 o load()
Loads the information from the AS/400.
 o removeErrorListener(ErrorListener)
Removes an error listener.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a property change listener.
 o removeTableModelListener(TableModelListener)
Removes a table model listener.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable change listener.
 o removeWorkingListener(WorkingListener)
Removes a working listener.
 o setRoot(VNode)
Sets the root, or the AS/400 resource, from which all information for the model is gathered.
 o setValueAt(Object, int, int)
Sets the value at the specifed row and column.
 o sort(Object[], boolean[])
Sorts the contents.

Constructors

 o AS400DetailsModel
 public AS400DetailsModel()
Constructs an AS400DetailsModel object.

 o AS400DetailsModel
 public AS400DetailsModel(VNode root)
Constructs an AS400DetailsModel object.

Parameters:
root - The root, or the AS/400 resource, from which all information for the model is gathered.

Methods

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

Parameters:
listener - The listener.
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes.

Parameters:
listener - The listener.
 o addTableModelListener
 public void addTableModelListener(TableModelListener listener)
Adds a listener to be notified when the contents of the table change.

Parameters:
listener - The listener.
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes.

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

Parameters:
listener - The listener.
 o getColumnClass
 public Class getColumnClass(int columnIndex)
Returns the class for objects that are contained in a column.

Parameters:
columnIndex - The column index.
Returns:
The column class. It will be null if the column index is not valid or the root has not been set.
 o getColumnCount
 public int getColumnCount()
Returns the number of columns.

Returns:
The number of columns. This will be 0 if the root has not been set.
 o getColumnName
 public String getColumnName(int columnIndex)
Returns the name of a column.

Parameters:
columnIndex - The column index.
Returns:
The column name. It will be null if the column index is not valid or the root has not been set.
 o getObjectAt
 public VObject getObjectAt(int rowIndex)
Returns the object at the specifed row.

Parameters:
rowIndex - The row index.
Returns:
The object at the specified row. It will be null if the index is not valid or the root has not been set.
 o 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.
 o getRowCount
 public int getRowCount()
Returns the number of rows in the table.

Returns:
The number of rows in the table, or 0 if the root has not been set.
 o getValueAt
 public Object getValueAt(int rowIndex,
                          int columnIndex)
Returns the value at the specifed row and column.

Parameters:
rowIndex - The row index.
columnIndex - The column index.
Returns:
The value at the specified row and column. It will be null if the column index is not valid or the root has not been set.
 o isCellEditable
 public boolean isCellEditable(int rowIndex,
                               int columnIndex)
Indicates if the cell is editable.

Parameters:
rowIndex - The row index.
columnIndex - The column index.
Returns:
true if the cell is editable; false if the cell is not editable, the index is not valid, or the root has not been set.
 o load
 public void load()
Loads the information from the AS/400.

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

Parameters:
listener - The listener.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.

Parameters:
listener - The listener.
 o removeTableModelListener
 public void removeTableModelListener(TableModelListener listener)
Removes a table model listener.

Parameters:
listener - The listener.
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable change listener.

Parameters:
listener - The listener.
 o removeWorkingListener
 public void removeWorkingListener(WorkingListener listener)
Removes a working listener.

Parameters:
listener - The listener.
 o 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.
 o setValueAt
 public void setValueAt(Object value,
                        int rowIndex,
                        int columnIndex)
Sets the value at the specifed row and column. This method has no effect, the value will not change.

Parameters:
value - The value.
rowIndex - The row index.
columnIndex - The column index.
 o 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 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index