All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.ui.framework.java.PanelTableModel

java.lang.Object
   |
   +----com.sun.java.swing.table.AbstractTableModel
           |
           +----com.ibm.as400.ui.framework.java.PanelTableModel

public class PanelTableModel
extends AbstractTableModel
An implementation of TableModel that uses a two-dimensional array of objects to store the cell values. The row count will be the length of the largest array that is supplied on a call to setColumn.

See Also:
TableModel

Constructor Index

 o PanelTableModel(Vector)
Constructs a PanelTableModel.

Method Index

 o addRow(Vector)
Adds a row to the end of the model.
 o getColumn(int)
Returns the list of values for the column at column.
 o getColumnClass(int)
Returns the lowest common denominator Class in the column.
 o getColumnCount()
Returns the number of columns managed by this object.
 o getColumnName(int)
Returns the name of the column at column.
 o getRowCount()
Returns the number of records managed by this object.
 o getRows()
Returns a Vector array.
 o getValueAt(int, int)
Returns an attribute value for the cell at row and column.
 o isCellEditable(int, int)
Returns true if the cell at row and column is editable.
 o removeRow(int)
Removes the row at rowToRemove from the model.
 o removeRows(int[])
Removes the rows identified in rowsToRemove from the model.
 o setCellEditable(boolean, int, int)
Indicates whether the cell at row and column is editable.
 o setColumn(int, Object[])
Sets the list of values for the column at column.
 o setRows(Vector[])
Reassigns all values in the table.
 o setValueAt(Object, int, int)
Sets an attribute value for the record in the cell at row and column.
 o toString()
Returns a string representation of the model.

Constructors

 o PanelTableModel
 public PanelTableModel(Vector tableColumns)
Constructs a PanelTableModel.

Parameters:
tableColumns - a list of ColumnDescriptors for the table columns

Methods

 o getColumn
 public Object[] getColumn(int column)
Returns the list of values for the column at column.

Parameters:
column - the column whose values are to be looked up
Returns:
the list of values at the specified column
See Also:
setColumn
 o setColumn
 public void setColumn(int column,
                       Object items[])
Sets the list of values for the column at column.

Parameters:
column - the column whose values are to be set
the - list of values at the specified column
See Also:
getColumn
 o toString
 public String toString()
Returns a string representation of the model.

Returns:
the dimensions of the table as a string
Overrides:
toString in class Object
 o getColumnCount
 public int getColumnCount()
Returns the number of columns managed by this object.

Returns:
the number or columns in the model
Overrides:
getColumnCount in class AbstractTableModel
See Also:
getRowCount
 o getRowCount
 public int getRowCount()
Returns the number of records managed by this object.

Returns:
the number or rows in the model
Overrides:
getRowCount in class AbstractTableModel
See Also:
getColumnCount
 o getValueAt
 public Object getValueAt(int row,
                          int column)
Returns an attribute value for the cell at row and column.

Parameters:
row - the row whose value is to be looked up
column - the column whose value is to be looked up
Returns:
the value Object at the specified cell
Overrides:
getValueAt in class AbstractTableModel
See Also:
setValueAt
 o getColumnName
 public String getColumnName(int column)
Returns the name of the column at column.

Parameters:
column - the index of column
Returns:
the name of the column
Overrides:
getColumnName in class AbstractTableModel
 o getColumnClass
 public Class getColumnClass(int column)
Returns the lowest common denominator Class in the column.

Returns:
the common ancestor class of the object values in the model
Overrides:
getColumnClass in class AbstractTableModel
 o isCellEditable
 public boolean isCellEditable(int row,
                               int column)
Returns true if the cell at row and column is editable. Otherwise, setValueAt() on the cell will not change the value of that cell.

Parameters:
row - the row whose editable status is to be looked up
column - the column whose editable status is to be looked up
Returns:
true if the cell is editable; false otherwise
Overrides:
isCellEditable in class AbstractTableModel
See Also:
setCellEditable
 o setCellEditable
 public void setCellEditable(boolean editable,
                             int row,
                             int column)
Indicates whether the cell at row and column is editable. Otherwise, setValueAt() on the cell will not change the value of that cell.

Parameters:
row - the row whose value is to be looked up
column - the column whose value is to be looked up
See Also:
isCellEditable
 o setValueAt
 public void setValueAt(Object value,
                        int row,
                        int column)
Sets an attribute value for the record in the cell at row and column. value is the new value.

Parameters:
value - the new value
row - the row whose value is to be changed
column - the column whose value is to be changed
Overrides:
setValueAt in class AbstractTableModel
See Also:
getValueAt
 o addRow
 public void addRow(Vector rowData)
Adds a row to the end of the model. The new row will contain null values unless rowData is specified. Notification of the row being added will be generated.

Parameters:
rowData - data of the row being added (may be null)
See Also:
removeRow
 o setRows
 public void setRows(Vector rowData[])
Reassigns all values in the table. The new table will contain null values unless rowData is specified. Notification of the rows being added will be generated.

Parameters:
rowData - array of data for the rows being added (may be null)
See Also:
getRows
 o getRows
 public Vector[] getRows()
Returns a Vector array. Each vector contains the attribute values for each cell in a table row.

See Also:
setRows
 o removeRow
 public void removeRow(int rowToRemove)
Removes the row at rowToRemove from the model. Notification of the row being removed will be sent to all listeners.

Parameters:
rowToRemove - the row index of the row to be removed
Throws: ArrayIndexOutOfBoundsException
if the row was invalid
 o removeRows
 public void removeRows(int rowsToRemove[])
Removes the rows identified in rowsToRemove from the model. Notification of the rows being removed will be sent to all listeners.

Parameters:
rowsToRemove - a list of row indices for the rows to be removed

All Packages  Class Hierarchy  This Package  Previous  Next  Index