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 Details

    • rows

      protected java.util.List<R extends java.io.Serializable> rows
      Data in the model.
      Since:
      0.2
    • noneEditableCols

      protected java.util.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 java.util.List<ColumnIdentifier<R extends java.io.Serializable>> 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

      public abstract R createNewRow()
    • getRows

      public final java.util.List<R> getRows()
    • setRows

      public final void setRows​(java.util.List<R> data)
    • 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)
    • onRowsChanged

      protected void onRowsChanged​(java.util.List<R> newRows)
    • onBeforeRowsChanged

      protected void onBeforeRowsChanged​(java.util.List<R> oldRows)
    • 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 java.lang.Object getValueAt​(int rowIndex, int columnIndex)
    • setValueAt

      public final void setValueAt​(java.lang.Object aValue, int rowIndex, int columnIndex)
      Specified by:
      setValueAt in interface javax.swing.table.TableModel
      Overrides:
      setValueAt in class javax.swing.table.AbstractTableModel
    • isCellEditable

      public final boolean isCellEditable​(int rowIndex, int columnIndex)
      Specified by:
      isCellEditable in interface javax.swing.table.TableModel
      Overrides:
      isCellEditable in class javax.swing.table.AbstractTableModel
    • setValueAt

      protected void setValueAt​(java.lang.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)
    • fireTableRowUpdatedShell

      public final void fireTableRowUpdatedShell​(java.util.Set<R> shell)
    • collectShell

      protected void collectShell​(R row, java.util.Set<R> collectedRows)
    • getColumnName

      public java.lang.String getColumnName​(int columnIndex)
      Specified by:
      getColumnName in interface javax.swing.table.TableModel
      Overrides:
      getColumnName in class javax.swing.table.AbstractTableModel
    • getIdentifier

      protected ColumnIdentifier<R> getIdentifier​(int columnIndex)
    • 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

      public void moveUp​(R row)
    • moveDown

      public void moveDown​(R row)
    • isFirstRow

      public boolean isFirstRow​(R row)
    • isLastRow

      public boolean isLastRow​(R row)