Class DefaultTableModel.MyTableColumnModel

java.lang.Object
javax.swing.table.DefaultTableColumnModel
groovy.swing.model.DefaultTableModel.MyTableColumnModel
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, ListSelectionListener, TableColumnModel
Enclosing class:
DefaultTableModel

protected static class DefaultTableModel.MyTableColumnModel extends DefaultTableColumnModel
Column model implementation that keeps model indexes aligned with the current column order.
See Also:
  • Constructor Details

    • MyTableColumnModel

      protected MyTableColumnModel()
  • Method Details

    • getColumnList

      public List getColumnList()
      Returns the live list of table columns.
      Returns:
      the backing column list
    • removeColumn

      public void removeColumn(TableColumn column)
      Removes a column and then renumbers the remaining model indexes.
      Specified by:
      removeColumn in interface TableColumnModel
      Overrides:
      removeColumn in class DefaultTableColumnModel
      Parameters:
      column - the column to remove
    • moveColumn

      public void moveColumn(int columnIndex, int newIndex)
      Moves a column and then renumbers the model indexes to match the new order.
      Specified by:
      moveColumn in interface TableColumnModel
      Overrides:
      moveColumn in class DefaultTableColumnModel
      Parameters:
      columnIndex - the source column index
      newIndex - the destination column index
    • renumberTableColumns

      public void renumberTableColumns()
      Reassigns model indexes to match the current column order.