All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.ui.framework.java.PanelTableModel
java.lang.Object
|
+----javax.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
-
PanelTableModel(Vector)
- Constructs a
PanelTableModel
.
-
addRow(Vector)
- Adds a row to the end of the model.
-
getColumn(int)
- Returns the list of values for the column at
column
.
-
getColumnClass(int)
- Returns the lowest common denominator
Class
in the column.
-
getColumnCount()
- Returns the number of columns managed by this object.
-
getColumnName(int)
- Returns the name of the column at
column
.
-
getRowCount()
- Returns the number of records managed by this object.
-
getRows()
- Returns a Vector array.
-
getValueAt(int, int)
- Returns an attribute value for the cell at
row
and column
.
-
isCellEditable(int, int)
- Returns true if the cell at
row
and column
is editable.
-
removeRow(int)
- Removes the row at
rowToRemove
from the model.
-
removeRows(int[])
- Removes the rows identified in
rowsToRemove
from the model.
-
setCellEditable(boolean, int, int)
- Indicates whether the cell at
row
and column
is editable.
-
setColumn(int, Object[])
- Sets the list of values for the column at
column
.
-
setRows(Vector[])
- Reassigns all values in the table.
-
setValueAt(Object, int, int)
- Sets an attribute value for the record in the cell at
row
and column
.
-
toString()
- Returns a string representation of the model.
PanelTableModel
public PanelTableModel(Vector tableColumns)
- Constructs a
PanelTableModel
.
- Parameters:
- tableColumns - a list of
ColumnDescriptors
for the table columns
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
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
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
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
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
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
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
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
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
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
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
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
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
getRows
public Vector[] getRows()
- Returns a Vector array. Each vector contains the attribute values
for each cell in a table row.
- See Also:
- setRows
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
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