T
- the type of table model entriespublic abstract class AbstractCustomColumnHistoryReferencesTableModel<T extends HistoryReferencesTableEntry> extends AbstractHistoryReferencesTableModel<T>
HistoryReferencesTableModel
with support for custom
columns.HistoryReferencesTableModel.Column
listenerList
Constructor and Description |
---|
AbstractCustomColumnHistoryReferencesTableModel(HistoryReferencesTableModel.Column[] columns)
Constructs an
AbstractCustomColumnHistoryReferencesTableModel with the specified
columns (in the specified order). |
Modifier and Type | Method and Description |
---|---|
protected abstract Class<?> |
getColumnClass(HistoryReferencesTableModel.Column column)
Returns the
Class of the column. |
Class<?> |
getColumnClass(int columnIndex)
Returns the
Class of the given column. |
String |
getColumnName(int columnIndex) |
protected abstract Class<?> |
getCustomColumnClass(int columnIndex)
Returns the
Class of the column at the given column index. |
protected int |
getCustomColumnIndex(int columnIndex)
Returns the index of the custom column as if no default columns existed.
|
protected abstract String |
getCustomColumnName(int columnIndex)
Returns the name of the column at the given column index.
|
protected abstract Object |
getCustomPrototypeValue(int columnIndex)
Returns the prototype value for the column at the given column index.
|
protected abstract Object |
getCustomValueAt(T entry,
int columnIndex)
Returns the value for the entry at the given column index.
|
protected abstract Object |
getPrototypeValue(HistoryReferencesTableModel.Column column)
Returns the prototype value for the given column.
|
Object |
getPrototypeValue(int columnIndex)
Returns the prototype value for the given column index.
|
Object |
getValueAt(int rowIndex,
int columnIndex) |
getColumn, getColumnCount, getColumnIndex, getColumns, isColumnEnabled, isCustomColumn, isCustomColumn
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEntry, clear, getEntry, getEntryRowIndex, getEntryWithHistoryId, refreshEntryRow, removeEntry
addTableModelListener, getRowCount, isCellEditable, removeTableModelListener, setValueAt
public AbstractCustomColumnHistoryReferencesTableModel(HistoryReferencesTableModel.Column[] columns)
AbstractCustomColumnHistoryReferencesTableModel
with the specified
columns (in the specified order).columns
- the columns that will have the modelIllegalArgumentException
- if columns
is null or empty.public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
getValueAt
in class AbstractHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
protected abstract Object getCustomValueAt(T entry, int columnIndex)
Column#CUSTOM
.entry
- the entry with the valuescolumnIndex
- the column indexgetCustomColumnIndex(int)
,
HistoryReferencesTableModel.Column.CUSTOM
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
protected abstract String getCustomColumnName(int columnIndex)
Column#CUSTOM
.columnIndex
- the column indexgetCustomColumnIndex(int)
,
HistoryReferencesTableModel.Column.CUSTOM
public final Class<?> getColumnClass(int columnIndex)
Class
of the given column.getColumnClass
in interface TableModel
getColumnClass
in class AbstractHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
columnIndex
- the column being queriedClass
of the columngetColumnClass(HistoryReferencesTableModel.Column)
,
getCustomColumnClass(int)
protected abstract Class<?> getColumnClass(HistoryReferencesTableModel.Column column)
Class
of the column.column
- the columnClass
of the columnprotected abstract Class<?> getCustomColumnClass(int columnIndex)
Class
of the column at the given column index. Called when the column is
a Column#CUSTOM
.columnIndex
- the column indexClass
of the custom columngetCustomColumnIndex(int)
,
HistoryReferencesTableModel.Column.CUSTOM
public Object getPrototypeValue(int columnIndex)
HistoryReferencesTableModel
columnIndex
- the column index that will be checked.protected abstract Object getPrototypeValue(HistoryReferencesTableModel.Column column)
column
- the columnprotected abstract Object getCustomPrototypeValue(int columnIndex)
Column#CUSTOM
.columnIndex
- the column indexgetCustomColumnIndex(int)
,
HistoryReferencesTableModel.Column.CUSTOM
protected int getCustomColumnIndex(int columnIndex)
Helper method for subclasses to use the column index without worrying of the actual position of the column in relation to default columns.
It can be used, for example, with getCustomColumnClass(int)
as:
protected Class<?> getCustomColumnClass(int columnIndex) { switch (getCustomColumnIndex(columnIndex)) { case 0: // Class of the first custom column return String.class; break; case 1: // Class of the second custom column return Integer.class; default: return String.class; } }
columnIndex
- the column index