java.io.Serializable
, javax.swing.table.TableModel
public class BeanTableModel
extends javax.swing.table.AbstractTableModel
Constructor | Description |
---|---|
BeanTableModel(java.lang.Class clazz) |
Constructs a new table model for displaying beans of a given class.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Class |
getColumnClass(int icol) |
|
int |
getColumnCount() |
|
java.lang.String |
getColumnName(int icol) |
|
java.lang.Object[] |
getData() |
Returns the array of objects which this model displays, one per row.
|
int |
getRowCount() |
|
java.lang.Object |
getValueAt(int irow,
int icol) |
|
boolean |
isCellEditable(int irow,
int icol) |
|
java.util.Comparator |
propertySorter(java.lang.String propertyName) |
Returns a sorter which can be used to sort rows of this table
(data array elements).
|
void |
setData(java.lang.Object[] data) |
Populates this model with items.
|
void |
setValueAt(java.lang.Object value,
int irow,
int icol) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public BeanTableModel(java.lang.Class clazz) throws java.beans.IntrospectionException
clazz
- class of items which will be displayed in this tablejava.beans.IntrospectionException
public void setData(java.lang.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 java.lang.Object[] getData()
public java.util.Comparator propertySorter(java.lang.String propertyName)
propertyName
- name of readable bean property to sort onpublic java.lang.String getColumnName(int icol)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Class getColumnClass(int icol)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public int getColumnCount()
public int getRowCount()
public java.lang.Object getValueAt(int irow, int icol)
public boolean isCellEditable(int irow, int icol)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object value, int irow, int icol)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.