Package groovy.swing.model

# 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:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class javax.swing.table.DefaultTableColumnModel

  `changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `MyTableColumnModel()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List`
  `getColumnList()`
  Returns the live list of table columns.
  `void`
  `moveColumn(int columnIndex, int newIndex)`
  Moves a column and then renumbers the model indexes to match the new order.
  `void`
  `removeColumn(TableColumn column)`
  Removes a column and then renumbers the remaining model indexes.
  `void`
  `renumberTableColumns()`
  Reassigns model indexes to match the current column order.

  ### Methods inherited from class javax.swing.table.DefaultTableColumnModel

  `addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, propertyChange, recalcWidthCache, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel, valueChanged`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.