org.fopps.ui
Class PersistentColumnModel

java.lang.Object
  |
  +--javax.swing.table.DefaultTableColumnModel
        |
        +--org.fopps.ui.PersistentColumnModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.table.TableColumnModel

public class PersistentColumnModel
extends javax.swing.table.DefaultTableColumnModel

PersistentColumnModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
PersistentColumnModel()
           
 
Method Summary
 void addColumn(javax.swing.table.TableColumn aColumn)
          Appends aColumn to the end of the tableColumns array.
protected  void fireColumnMarginChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 void moveColumn(int columnIndex, int newIndex)
          Moves the column and heading at columnIndex to newIndex.
 void removeColumn(javax.swing.table.TableColumn column)
          Deletes the column from the tableColumns array.
 void setColumnMargin(int newMargin)
          Sets the column margin to newMargin.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, propertyChange, recalcWidthCache, removeColumnModelListener, setColumnSelectionAllowed, setSelectionModel, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentColumnModel

public PersistentColumnModel()
Method Detail

addColumn

public void addColumn(javax.swing.table.TableColumn aColumn)
Appends aColumn to the end of the tableColumns array. This method also posts the columnAdded event to its listeners and restores the column widths, if possible.

Specified by:
addColumn in interface javax.swing.table.TableColumnModel
Overrides:
addColumn in class javax.swing.table.DefaultTableColumnModel
Throws:
java.lang.IllegalArgumentException - if aColumn is null
See Also:
removeColumn(javax.swing.table.TableColumn)

fireColumnMarginChanged

protected void fireColumnMarginChanged()
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Overrides:
fireColumnMarginChanged in class javax.swing.table.DefaultTableColumnModel
See Also:
EventListenerList

setColumnMargin

public void setColumnMargin(int newMargin)
Sets the column margin to newMargin. This method also posts a columnMarginChanged event to its listeners.

Specified by:
setColumnMargin in interface javax.swing.table.TableColumnModel
Overrides:
setColumnMargin in class javax.swing.table.DefaultTableColumnModel
Parameters:
newMargin - the new margin width, in pixels
See Also:
DefaultTableColumnModel.getColumnMargin(), DefaultTableColumnModel.getTotalColumnWidth()

removeColumn

public void removeColumn(javax.swing.table.TableColumn column)
Deletes the column from the tableColumns array. This method will do nothing if column is not in the table's columns list. tile is called to resize both the header and table views. This method also posts a columnRemoved event to its listeners.

Specified by:
removeColumn in interface javax.swing.table.TableColumnModel
Overrides:
removeColumn in class javax.swing.table.DefaultTableColumnModel
Parameters:
column - the TableColumn to be removed
See Also:
addColumn(javax.swing.table.TableColumn)

moveColumn

public void moveColumn(int columnIndex,
                       int newIndex)
Moves the column and heading at columnIndex to newIndex. The old column at columnIndex will now be found at newIndex. The column that used to be at newIndex is shifted left or right to make room. This will not move any columns if columnIndex equals newIndex. This method also posts a columnMoved event to its listeners.

Specified by:
moveColumn in interface javax.swing.table.TableColumnModel
Overrides:
moveColumn in class javax.swing.table.DefaultTableColumnModel
Parameters:
columnIndex - the index of column to be moved
newIndex - new index to move the column
Throws:
java.lang.IllegalArgumentException - if column or newIndex are not in the valid range


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.