Class AbstractApplicationTableModel<R extends Serializable>
java.lang.Object
javax.swing.table.AbstractTableModel
org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel<R>
- Type Parameters:
R- type of a row.
- All Implemented Interfaces:
Serializable,TableModel
public abstract class AbstractApplicationTableModel<R extends Serializable> extends AbstractTableModel
Abstract model of a table.
- Since:
- 2.8
- Author:
- Tony Chemit - chemit@codelutin.com
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected booleancreateEmptyRowIsEmptyCreates a first empty row when setting a null or empty list of rows ?protected booleancreateNewRowCreates a new row when moving to next editable cell / row ?protected List<ColumnIdentifier<R>>identifiersIdentifiers of columns (in initial order).protected Set<ColumnIdentifier<?>>noneEditableColsSet of non editable columns.protected List<R>rowsData in the model. -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractApplicationTableModel(org.jdesktop.swingx.table.TableColumnModelExt columnModel, boolean createNewRow, boolean createEmptyRowIsEmpty) -
Method Summary
Modifier and Type Method Description voidaddNewRow()voidaddNewRow(int rowIndex, R newValue)voidaddNewRow(R newValue)protected voidcollectShell(R row, Set<R> collectedRows)abstract RcreateNewRow()voidfireTableCellUpdated(int rowIndex, ColumnIdentifier<R>... identifiers)voidfireTableRowsInserted(R newValue)voidfireTableRowUpdatedShell(Set<R> shell)org.apache.commons.lang3.tuple.Pair<Integer,Integer>getCell(R row, String propertyName)intgetColumnCount()intgetColumnIndex(String propertyName)StringgetColumnName(int columnIndex)RgetEntry(int rowIndex)protected ColumnIdentifier<R>getIdentifier(int columnIndex)intgetRowCount()intgetRowIndex(R row)List<R>getRows()ObjectgetValueAt(int rowIndex, int columnIndex)booleanisCellEditable(int rowIndex, int columnIndex)protected booleanisCellEditable(int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName)booleanisCreateEmptyRowIsEmpty()booleanisCreateNewRow()booleanisFirstRow(R row)booleanisLastRow(R row)voidmoveDown(R row)voidmoveUp(R row)protected voidonBeforeRowsChanged(List<R> oldRows)protected voidonRowAdded(int rowIndex, R row)protected voidonRowRemoved(int rowIndex, R row)protected voidonRowsChanged(List<R> newRows)protected voidonRowUpdated(int rowIndex, R row)RremoveRow(int rowIndex)voidsetNoneEditableCols(ColumnIdentifier<?>... noneEditableCols)voidsetRows(List<R> data)voidsetValueAt(Object aValue, int rowIndex, int columnIndex)protected voidsetValueAt(Object aValue, int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName, R entry)intupdateRow(R row)Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
rows
Data in the model.- Since:
- 0.2
-
noneEditableCols
Set of non editable columns.- Since:
- 0.2
-
createNewRow
protected final boolean createNewRowCreates a new row when moving to next editable cell / row ?- Since:
- 0.3
-
createEmptyRowIsEmpty
protected final boolean createEmptyRowIsEmptyCreates a first empty row when setting a null or empty list of rows ?- Since:
- 0.3
-
identifiers
Identifiers of columns (in initial order).- Since:
- 1.1
-
-
Constructor Details
-
AbstractApplicationTableModel
protected AbstractApplicationTableModel(org.jdesktop.swingx.table.TableColumnModelExt columnModel, boolean createNewRow, boolean createEmptyRowIsEmpty)
-
-
Method Details
-
createNewRow
-
getRows
-
setRows
-
isCreateNewRow
public boolean isCreateNewRow() -
isCreateEmptyRowIsEmpty
public boolean isCreateEmptyRowIsEmpty() -
addNewRow
public final void addNewRow() -
addNewRow
-
addNewRow
-
fireTableRowsInserted
-
updateRow
-
removeRow
-
onRowsChanged
-
onBeforeRowsChanged
-
onRowAdded
-
onRowUpdated
-
onRowRemoved
-
getRowIndex
-
getEntry
-
setNoneEditableCols
-
getRowCount
public final int getRowCount() -
getColumnCount
public final int getColumnCount() -
getValueAt
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
isCellEditable
public final boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
setValueAt
protected void setValueAt(Object aValue, int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName, R entry) -
isCellEditable
-
fireTableCellUpdated
-
fireTableRowUpdatedShell
-
collectShell
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getIdentifier
-
getColumnIndex
-
getCell
-
moveUp
-
moveDown
-
isFirstRow
-
isLastRow
-