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