T
- The Type we have for a table row entrypublic abstract class ListTableMapperBase<T> extends Object implements TableModel, ListSelectionListener
Modifier and Type | Class and Description |
---|---|
static class |
ListTableMapperBase.IdentityIndexConverter
Small helper class that provides a model index = view index mapping.
|
Modifier and Type | Field and Description |
---|---|
protected SelectionInList<T> |
mSelectionInList
value model holding the list, never null
|
Constructor and Description |
---|
ListTableMapperBase() |
Modifier and Type | Method and Description |
---|---|
void |
addTableModelListener(TableModelListener pTableModelListener) |
protected void |
fireTableChanged(TableModelEvent pEvent)
Helper to fire a table event to all our table model listeners.
|
int |
getRowCount() |
protected void |
init(JTable pTable,
SelectionInList<T> pValueModel)
Common construction stuff, it creates a new adaption between
a JTable and a SelectionInList value model.
|
boolean |
isCellEditable(int pRowIndex,
int pColumnIndex) |
void |
removeTableModelListener(TableModelListener pTableModelListener) |
protected void |
setIndexConverter(IndexConverter pIndexConverter)
Setter for IndexConverter, see ListTableMapper for details.
|
void |
setValueAt(Object pValue,
int pRowIndex,
int pColumnIndex) |
void |
valueChanged(ListSelectionEvent pEvent)
Called whenever the selection of the JTable changes, we update
our SelectionInList index.
|
void |
vmDataChanged(ChangeEvent pEvent)
Called whenever the data of the SelectionInList changes.
|
void |
vmSelectionChanged(ChangeEvent pEvent)
Called whenever the selection of the SelectionInList changes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnClass, getColumnCount, getColumnName, getValueAt
protected SelectionInList<T> mSelectionInList
protected void init(JTable pTable, SelectionInList<T> pValueModel)
pTable
- the table for which we provide TableModel and ListSelectionModel behaviourpValueModel
- the value model that drives the table (data, selection)
and gets updated by the table (selection only)IllegalArgumentException
- if a parameter is bogusprotected void setIndexConverter(IndexConverter pIndexConverter)
pIndexConverter
- the new IndexConverter, must not be nullpublic void vmDataChanged(ChangeEvent pEvent)
pEvent
- not usedpublic void vmSelectionChanged(ChangeEvent pEvent)
pEvent
- not usedpublic void valueChanged(ListSelectionEvent pEvent)
valueChanged
in interface ListSelectionListener
pEvent
- event describing the new selectionpublic int getRowCount()
getRowCount
in interface TableModel
public boolean isCellEditable(int pRowIndex, int pColumnIndex)
isCellEditable
in interface TableModel
public void setValueAt(Object pValue, int pRowIndex, int pColumnIndex)
setValueAt
in interface TableModel
public void addTableModelListener(TableModelListener pTableModelListener)
addTableModelListener
in interface TableModel
public void removeTableModelListener(TableModelListener pTableModelListener)
removeTableModelListener
in interface TableModel
protected void fireTableChanged(TableModelEvent pEvent)
pEvent
- the table eventCopyright © 2017 Jürgen Zeller (privat). All rights reserved.