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.-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractApplicationTableModel(org.jdesktop.swingx.table.TableColumnModelExt columnModel, boolean createNewRow, boolean createEmptyRowIsEmpty)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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 Detail
-
rows
protected List<R extends Serializable> rows
Data in the model.- Since:
- 0.2
-
noneEditableCols
protected Set<ColumnIdentifier<?>> noneEditableCols
Set of non editable columns.- Since:
- 0.2
-
createNewRow
protected final boolean createNewRow
Creates a new row when moving to next editable cell / row ?- Since:
- 0.3
-
createEmptyRowIsEmpty
protected final boolean createEmptyRowIsEmpty
Creates a first empty row when setting a null or empty list of rows ?- Since:
- 0.3
-
identifiers
protected final List<ColumnIdentifier<R extends Serializable>> identifiers
Identifiers of columns (in initial order).- Since:
- 1.1
-
-
Method Detail
-
createNewRow
public abstract R createNewRow()
-
isCreateNewRow
public boolean isCreateNewRow()
-
isCreateEmptyRowIsEmpty
public boolean isCreateEmptyRowIsEmpty()
-
addNewRow
public final void addNewRow()
-
addNewRow
public final void addNewRow(R newValue)
-
addNewRow
public final void addNewRow(int rowIndex, R newValue)
-
fireTableRowsInserted
public final void fireTableRowsInserted(R newValue)
-
updateRow
public final int updateRow(R row)
-
removeRow
public final R removeRow(int rowIndex)
-
onRowAdded
protected void onRowAdded(int rowIndex, R row)
-
onRowUpdated
protected void onRowUpdated(int rowIndex, R row)
-
onRowRemoved
protected void onRowRemoved(int rowIndex, R row)
-
getRowIndex
public final int getRowIndex(R row)
-
getEntry
public final R getEntry(int rowIndex)
-
setNoneEditableCols
public final void setNoneEditableCols(ColumnIdentifier<?>... noneEditableCols)
-
getRowCount
public final int getRowCount()
-
getColumnCount
public final int getColumnCount()
-
getValueAt
public final Object getValueAt(int rowIndex, int columnIndex)
-
setValueAt
public final void setValueAt(Object aValue, int rowIndex, int columnIndex)
- 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
protected boolean isCellEditable(int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName)
-
fireTableCellUpdated
public final void fireTableCellUpdated(int rowIndex, ColumnIdentifier<R>... identifiers)
-
getColumnName
public String getColumnName(int columnIndex)
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getIdentifier
protected ColumnIdentifier<R> getIdentifier(int columnIndex)
-
getColumnIndex
public int getColumnIndex(String propertyName)
-
getCell
public org.apache.commons.lang3.tuple.Pair<Integer,Integer> getCell(R row, String propertyName)
-
moveUp
public void moveUp(R row)
-
moveDown
public void moveDown(R row)
-
isFirstRow
public boolean isFirstRow(R row)
-
isLastRow
public boolean isLastRow(R row)
-
-