Class AbstractApplicationTableModel<R extends java.io.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:
java.io.Serializable,javax.swing.table.TableModel
public abstract class AbstractApplicationTableModel<R extends java.io.Serializable>
extends javax.swing.table.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 java.util.List<ColumnIdentifier<R>>identifiersIdentifiers of columns (in initial order).protected java.util.Set<ColumnIdentifier<?>>noneEditableColsSet of non editable columns.protected java.util.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
Modifier and Type Method Description voidaddNewRow()voidaddNewRow(int rowIndex, R newValue)voidaddNewRow(R newValue)protected voidcollectShell(R row, java.util.Set<R> collectedRows)abstract RcreateNewRow()voidfireTableCellUpdated(int rowIndex, ColumnIdentifier<R>... identifiers)voidfireTableRowsInserted(R newValue)voidfireTableRowUpdatedShell(java.util.Set<R> shell)org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer>getCell(R row, java.lang.String propertyName)intgetColumnCount()intgetColumnIndex(java.lang.String propertyName)java.lang.StringgetColumnName(int columnIndex)RgetEntry(int rowIndex)protected ColumnIdentifier<R>getIdentifier(int columnIndex)intgetRowCount()intgetRowIndex(R row)java.util.List<R>getRows()java.lang.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(java.util.List<R> oldRows)protected voidonRowAdded(int rowIndex, R row)protected voidonRowRemoved(int rowIndex, R row)protected voidonRowsChanged(java.util.List<R> newRows)protected voidonRowUpdated(int rowIndex, R row)RremoveRow(int rowIndex)voidsetNoneEditableCols(ColumnIdentifier<?>... noneEditableCols)voidsetRows(java.util.List<R> data)voidsetValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)protected voidsetValueAt(java.lang.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, removeTableModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
public final java.lang.Object getValueAt(int rowIndex, int columnIndex) -
setValueAt
public final void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classjavax.swing.table.AbstractTableModel
-
isCellEditable
public final boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel
-
setValueAt
protected void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName, R entry) -
isCellEditable
-
fireTableCellUpdated
-
fireTableRowUpdatedShell
-
collectShell
-
getColumnName
public java.lang.String getColumnName(int columnIndex)- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel
-
getIdentifier
-
getColumnIndex
public int getColumnIndex(java.lang.String propertyName) -
getCell
public org.apache.commons.lang3.tuple.Pair<java.lang.Integer,java.lang.Integer> getCell(R row, java.lang.String propertyName) -
moveUp
-
moveDown
-
isFirstRow
-
isLastRow
-