|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
com.darwinsys.swingui.ArrayListTableModel
JTable model for ArrayList of heterogeneous objects. Subclasses must set String columnNames[] and Class columnClasses[], which MUST be in the same order. Subclasses need only implement these AbstractTableModel methods:
public int getColumnCount() { public Object getValueAt(int row, int col) { public void setValueAt(Object val, int row, int col) {
Field Summary | |
protected java.lang.Class[] |
columnClasses
List of column names, must be provided by subclass. |
protected java.lang.String[] |
columnNames
List of column names, must be provided by subclass. |
protected java.util.ArrayList |
methods
The list of Method object |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
ArrayListTableModel(java.util.ArrayList m)
Constructor requires the list of objects |
Method Summary | |
java.lang.Object |
getCached(int row)
Cache one most-recently-used item. |
java.lang.Class |
getColumnClass(int n)
Get the class of a given column, from the list provided by subclass |
java.lang.String |
getColumnName(int n)
Get the name of a given column, from the list provided by subclass |
int |
getRowCount()
Returns the number of objects in the list. |
void |
invalidateCache()
Invalidate the cache. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
All cells are editable. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
getColumnCount, getValueAt |
Field Detail |
protected java.lang.String[] columnNames
protected java.lang.Class[] columnClasses
protected java.util.ArrayList methods
Constructor Detail |
public ArrayListTableModel(java.util.ArrayList m)
Method Detail |
public java.lang.String getColumnName(int n)
public java.lang.Class getColumnClass(int n)
public int getRowCount()
public boolean isCellEditable(int rowIndex, int columnIndex)
public java.lang.Object getCached(int row)
public void setValueAt(int row, ...) { MyDataType current = (MyDataType) getCached(row); ... }
public void invalidateCache()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |