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
Column model implementation that keeps model indexes aligned with the current column order.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the live list of table columns.voidmoveColumn(int columnIndex, int newIndex) Moves a column and then renumbers the model indexes to match the new order.voidremoveColumn(TableColumn column) Removes a column and then renumbers the remaining model indexes.voidReassigns 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
-
Constructor Details
-
MyTableColumnModel
protected MyTableColumnModel()
-
-
Method Details
-
getColumnList
Returns the live list of table columns.- Returns:
- the backing column list
-
removeColumn
Removes a column and then renumbers the remaining model indexes.- Specified by:
removeColumnin interfaceTableColumnModel- Overrides:
removeColumnin classDefaultTableColumnModel- 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:
moveColumnin interfaceTableColumnModel- Overrides:
moveColumnin classDefaultTableColumnModel- Parameters:
columnIndex- the source column indexnewIndex- the destination column index
-
renumberTableColumns
public void renumberTableColumns()Reassigns model indexes to match the current column order.
-