|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
.
TableModel
,
Serialized FormModifier and Type | Field and Description |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor and Description |
---|
PanelTableModel(Vector tableColumns)
Constructs a PanelTableModel . |
Modifier and Type | Method and Description |
---|---|
void |
addRow(Vector rowData)
Adds a row to the end of the model. |
Object[] |
getColumn(int column)
Returns the list of values for the column at column . |
Object[] |
getColumn(String name)
Returns the list of values for the column whose identifer is name . |
Class |
getColumnClass(int column)
Returns the lowest common denominator Class in the column. |
int |
getColumnCount()
Returns the number of columns managed by this object. |
String |
getColumnIdentifier(int column)
Returns the identifier of the column at column . |
String |
getColumnName(int column)
Returns the name of the column at column . |
int |
getRowCount()
Returns the number of records managed by this object. |
Vector[] |
getRows()
Returns a Vector array. |
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,
Object[] items)
Sets the list of values for the column at column . |
void |
setRows(Vector[] rowData)
Reassigns all values in the table. |
void |
setValueAt(Object value,
int row,
int column)
Sets an attribute value for the record in the cell at row and column . |
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, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PanelTableModel(Vector tableColumns)
PanelTableModel
.
tableColumns
- a list of ColumnDescriptors
for the table columnsMethod Detail |
---|
public Object[] getColumn(int column)
column
.
column
- the column whose values are to be looked upsetColumn(int, java.lang.Object[])
public Object[] getColumn(String name)
name
.
name
- the column whose values are to be looked upsetColumn(int, java.lang.Object[])
public void setColumn(int column, Object[] items)
column
.
column
- the column whose values are to be setthe
- list of values at the specified columngetColumn(int)
public String toString()
toString
in class Object
public int getColumnCount()
getRowCount()
public int getRowCount()
getColumnCount()
public Object getValueAt(int row, int column)
row
and column
.
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 String getColumnName(int column)
column
.
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- the index of columnpublic String getColumnIdentifier(int column)
column
.
column
- the index of columnpublic Class getColumnClass(int column)
Class
in the column.
getColumnClass
in interface TableModel
getColumnClass
in class 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 interface TableModel
isCellEditable
in class 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(Object value, int row, int column)
row
and column
. value
is
the new value.
setValueAt
in interface TableModel
setValueAt
in class 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(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(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 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 removedArrayIndexOutOfBoundsException
- 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |