| java.lang.Object javax.swing.table.AbstractTableModel org.glasser.swing.table.ListTableModel
All known Subclasses: org.glasser.swing.table.ResultSetTableModel,
Field Summary | |
protected int[] | columnMappings | protected List | dataList This list holds the data for the table, and it is assumed that each
element in this list is analogous to one row in the table. | protected boolean | descendingSort This indicates whether the last sort applied to the dataList was in
descending order or not. | protected SmartEventListenerList | listeners | protected int | sortColumn Index of the last column on which this table was sorted. |
Method Summary | |
public void | addListTableModelListener(ListTableModelListener listener) | public void | addObject(Object obj) | public void | fireTableDataChanged() | public java.lang.Class | getColumnClass(int column) | public int | getColumnCount() | public ColumnManager | getColumnManager() | public int[] | getColumnMappings() | public String | getColumnName(int columnIndex) | public List | getDataList() | public int | getMappedColumnIndex(int columnIndex) | public Object | getObjectAtRow(int row) | public int | getRowCount() | public Object | getValueAt(int rowIndex, int columnIndex) | public void | insertObjectAtRow(Object obj, int row) Inserts the given object into the data list at the given row. | public boolean | isCellEditable(int row, int column) | public void | moveRowDown(int row) Swaps the indicated table row with the one immediately below it. | public void | moveRowUp(int row) Swaps the indicated table row with the one immediately above it. | public void | removeListTableModelListener(ListTableModelListener listener) | public void | removeObject(Object obj) | public void | removeObjectAtRow(int rowToRemove) | public synchronized void | replaceObject(Object oldObject, Object newObject) | public void | setColumnComparator(int columnIndex, Comparator columnComparator) This method is used to set a particular Comparator that will be used when
sorting on a particular column. | public void | setColumnManager(ColumnManager columnManager) | public void | setColumnMappings(int[] columnMappings) | public synchronized void | setDataList(List newData) | public void | setValueAt(Object newCellValue, int rowIndex, int columnIndex) | public void | sort(int columnIndex, boolean sortDescending) Sorts the model's contents on the given column. | public boolean | sort(int columnIndex) Sorts the buffer on the indicated column, and returns true if the sort was in
descending order, or false if it was in ascending order. |
columnMappings | protected int[] columnMappings(Code) | | |
dataList | protected List dataList(Code) | | This list holds the data for the table, and it is assumed that each
element in this list is analogous to one row in the table. The ColumnManager
knows, when given an object representing a row, how to get the value
for a particular column within that row.
|
descendingSort | protected boolean descendingSort(Code) | | This indicates whether the last sort applied to the dataList was in
descending order or not.
|
sortColumn | protected int sortColumn(Code) | | Index of the last column on which this table was sorted.
|
ListTableModel | public ListTableModel()(Code) | | |
fireTableDataChanged | public void fireTableDataChanged()(Code) | | |
getColumnCount | public int getColumnCount()(Code) | | |
getColumnMappings | public int[] getColumnMappings()(Code) | | |
getColumnName | public String getColumnName(int columnIndex)(Code) | | |
getMappedColumnIndex | public int getMappedColumnIndex(int columnIndex)(Code) | | |
getRowCount | public int getRowCount()(Code) | | |
getValueAt | public Object getValueAt(int rowIndex, int columnIndex)(Code) | | |
insertObjectAtRow | public void insertObjectAtRow(Object obj, int row)(Code) | | Inserts the given object into the data list at the given row.
throws: UnsupportedOperationException - if the underlying List does notsupport the addAll() operation. |
isCellEditable | public boolean isCellEditable(int row, int column)(Code) | | |
moveRowDown | public void moveRowDown(int row)(Code) | | Swaps the indicated table row with the one immediately below it. If
it is the bottom row in the table, or out of bounds, nothing happens.
|
moveRowUp | public void moveRowUp(int row)(Code) | | Swaps the indicated table row with the one immediately above it. If
it is the top row in the table, or out of bounds, nothing happens.
|
removeObjectAtRow | public void removeObjectAtRow(int rowToRemove)(Code) | | |
replaceObject | public synchronized void replaceObject(Object oldObject, Object newObject)(Code) | | |
setColumnComparator | public void setColumnComparator(int columnIndex, Comparator columnComparator)(Code) | | This method is used to set a particular Comparator that will be used when
sorting on a particular column. It is especially useful for sorting String columns
in case-insensitive order, by passing String.CASE_INSENSITIVE_ORDER to this method.
throws: RuntimeException - , if the ColumnManager for this ListTableModel is set to null. |
setColumnMappings | public void setColumnMappings(int[] columnMappings)(Code) | | |
setDataList | public synchronized void setDataList(List newData)(Code) | | |
setValueAt | public void setValueAt(Object newCellValue, int rowIndex, int columnIndex)(Code) | | |
sort | public void sort(int columnIndex, boolean sortDescending)(Code) | | Sorts the model's contents on the given column.
Parameters: columnIndex - the zero-based index of the column on which the datawill be sorted. Parameters: sortDescending - if true, the data is sorted in descending order, otherwiseit will be sorted in ascending order. |
sort | public boolean sort(int columnIndex)(Code) | | Sorts the buffer on the indicated column, and returns true if the sort was in
descending order, or false if it was in ascending order. The order
will usually be ascending, unless the same column is sorted multiple times
consecutively, in which case the sort order is reversed each time.
|
|
|