public class BeanTableModel extends AbstractTableModel
java.beans package any cleverer stuff
held in BeanInfos will get used as well/instead.
What a neat idea!listenerList| Constructor and Description |
|---|
BeanTableModel(Class<?> clazz)
Constructs a new table model for displaying beans of a given class.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
getColumnClass(int icol) |
int |
getColumnCount() |
String |
getColumnName(int icol) |
Object[] |
getData()
Returns the array of objects which this model displays, one per row.
|
int |
getRowCount() |
Object |
getValueAt(int irow,
int icol) |
boolean |
isCellEditable(int irow,
int icol) |
Comparator<?> |
propertySorter(String propertyName)
Returns a sorter which can be used to sort rows of this table
(data array elements).
|
void |
setData(Object[] data)
Populates this model with items.
|
void |
setValueAt(Object value,
int irow,
int icol) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerpublic BeanTableModel(Class<?> clazz) throws IntrospectionException
clazz - class of items which will be displayed in this tableIntrospectionExceptionpublic void setData(Object[] data)
data - array of items, one for each row. This array's
runtime type must match that for which this model was
constructed (on pain of ClassCastException)public Object[] getData()
public Comparator<?> propertySorter(String propertyName)
propertyName - name of readable bean property to sort onpropertyName, or
null if propertyName does not name a suitable
propertypublic String getColumnName(int icol)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic Class<?> getColumnClass(int icol)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelpublic int getColumnCount()
public int getRowCount()
public Object getValueAt(int irow, int icol)
public boolean isCellEditable(int irow,
int icol)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelpublic void setValueAt(Object value, int irow, int icol)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.