|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--com.ibm.as400.ui.framework.java.PanelTableModel
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
.
TableModel
, Serialized FormFields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
PanelTableModel(java.util.Vector tableColumns)
Constructs a PanelTableModel . |
Method Summary | |
void |
addRow(java.util.Vector rowData)
Adds a row to the end of the model. |
java.lang.Object[] |
getColumn(int column)
Returns the list of values for the column at column . |
java.lang.Object[] |
getColumn(java.lang.String name)
Returns the list of values for the column whose identifer is name . |
java.lang.Class |
getColumnClass(int column)
Returns the lowest common denominator Class in the column. |
int |
getColumnCount()
Returns the number of columns managed by this object. |
java.lang.String |
getColumnIdentifier(int column)
Returns the identifier of the column at column . |
java.lang.String |
getColumnName(int column)
Returns the name of the column at column . |
int |
getRowCount()
Returns the number of records managed by this object. |
java.util.Vector[] |
getRows()
Returns a Vector array. |
java.lang.Object |
getValueAt(int row,
int column)
Returns an attribute value for the cell at row
and column . |
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at row and column
is editable. |
void |
removeRow(int rowToRemove)
Removes the row at rowToRemove from the model. |
void |
removeRows(int[] rowsToRemove)
Removes the rows identified in rowsToRemove from the model. |
void |
setCellEditable(boolean editable,
int row,
int column)
Indicates whether the cell at row and column
is editable. |
void |
setColumn(int column,
java.lang.Object[] items)
Sets the list of values for the column at column . |
void |
setRows(java.util.Vector[] rowData)
Reassigns all values in the table. |
void |
setValueAt(java.lang.Object value,
int row,
int column)
Sets an attribute value for the record in the cell at row and column . |
java.lang.String |
toString()
Returns a string representation of the model. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PanelTableModel(java.util.Vector tableColumns)
PanelTableModel
.tableColumns
- a list of ColumnDescriptors
for the table columnsMethod Detail |
public java.lang.Object[] getColumn(int column)
column
.column
- the column whose values are to be looked upsetColumn(int, java.lang.Object[])
public java.lang.Object[] getColumn(java.lang.String name)
name
.name
- the column whose values are to be looked upsetColumn(int, java.lang.Object[])
public void setColumn(int column, java.lang.Object[] items)
column
.column
- the column whose values are to be setthe
- list of values at the specified columngetColumn(int)
public java.lang.String toString()
toString
in class java.lang.Object
public int getColumnCount()
getColumnCount
in class javax.swing.table.AbstractTableModel
getRowCount()
public int getRowCount()
getRowCount
in class javax.swing.table.AbstractTableModel
getColumnCount()
public java.lang.Object getValueAt(int row, int column)
row
and column
.getValueAt
in class javax.swing.table.AbstractTableModel
row
- the row whose value is to be looked upcolumn
- the column whose value is to be looked upsetValueAt(java.lang.Object, int, int)
public java.lang.String getColumnName(int column)
column
.getColumnName
in class javax.swing.table.AbstractTableModel
column
- the index of columnpublic java.lang.String getColumnIdentifier(int column)
column
.column
- the index of columnpublic java.lang.Class getColumnClass(int column)
Class
in the column.getColumnClass
in class javax.swing.table.AbstractTableModel
public boolean isCellEditable(int row, int column)
row
and column
is editable. Otherwise, setValueAt() on the cell will not change
the value of that cell.isCellEditable
in class javax.swing.table.AbstractTableModel
row
- the row whose editable status is to be looked upcolumn
- the column whose editable status is to be looked upsetCellEditable(boolean, int, int)
public void setCellEditable(boolean editable, int row, int column)
row
and column
is editable. Otherwise, setValueAt() on the cell will not change
the value of that cell.editable
- true if the cell should be editable, false otherwiserow
- the row whose value is to be looked upcolumn
- the column whose value is to be looked upisCellEditable(int, int)
public void setValueAt(java.lang.Object value, int row, int column)
row
and column
. value
is
the new value.setValueAt
in class javax.swing.table.AbstractTableModel
value
- the new valuerow
- the row whose value is to be changedcolumn
- the column whose value is to be changedgetValueAt(int, int)
public void addRow(java.util.Vector rowData)
rowData
is specified. Notification
of the row being added will be generated.rowData
- data of the row being added (may be null)removeRow(int)
public void setRows(java.util.Vector[] rowData)
rowData
is specified. Notification
of the rows being added will be generated.rowData
- array of data for the rows being added (may be null)getRows()
public java.util.Vector[] getRows()
setRows(java.util.Vector[])
public void removeRow(int rowToRemove)
rowToRemove
from the model. Notification
of the row being removed will be sent to all listeners.rowToRemove
- the row index of the row to be removedjava.lang.ArrayIndexOutOfBoundsException
- if the row was invalidpublic void removeRows(int[] rowsToRemove)
rowsToRemove
from the model. Notification
of the rows being removed will be sent to all listeners.rowsToRemove
- a list of row indices for the rows to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |