com.antelmann.mgmt
Class EntityTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.antelmann.mgmt.EntityTableModel
- All Implemented Interfaces:
- Serializable, TableModel
public class EntityTableModel
- extends AbstractTableModel
a TableModel that first uses the value of method names and then tries to retrieve properties
based on the name as key.
The functionality is derived from MethodTableName, but is extended to refer to property values,
if no appropriate method is found.
- Author:
- Holger Antelmann
- See Also:
MethodTableModel,
Serialized Form
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
protected final List<Entity> list
methodOrPropertyNames
protected String[] methodOrPropertyNames
methods
protected Method[] methods
EntityTableModel
public EntityTableModel(List<? extends Entity> list,
String... methodOrPropertyNames)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
refresh
public void refresh(List<? extends Entity> list,
String... methodOrPropertyNames)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
getList
public List<Entity> getList()
- returns an unmodifiable view of the embedded list.
getRow
public Entity getRow(int row)
getRowCount
public int getRowCount()
getColumnCount
public int getColumnCount()
getValueAt
public Object getValueAt(int row,
int column)
getColumnName
public String getColumnName(int column)
- returns the column name which - in the case of a method name - may be altered according to Beans specifications
(i.e. "is" and "get" is removed at the beginning if the following letter is upper-case).
If the given column doesn't reflect on a method name, the methodOrPropertyName originally given is returned.
- Specified by:
getColumnName in interface TableModel- Overrides:
getColumnName in class AbstractTableModel
(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads