Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.table
Class DefaultVetoableColumnModel

java.lang.Object
  extended by javax.swing.table.DefaultTableColumnModel
      extended by com.sciapp.table.DefaultVetoableColumnModel
All Implemented Interfaces:
VetoableTableColumnModel, PropertyChangeListener, Serializable, EventListener, ListSelectionListener, TableColumnModel

public class DefaultVetoableColumnModel
extends DefaultTableColumnModel
implements VetoableTableColumnModel

DefaultVetoableColumnModel provides a standard implementation for a VetoableTableColumnModel.

Since:
3.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
DefaultVetoableColumnModel()
          Constructs a DefaultVetoableColumnModel.
 
Method Summary
 void addColumn(TableColumn aColumn)
          Appends aColumn to the end of the tableColumns array.
 void addVetoableColumnModelListener(VetoableTableColumnModelListener l)
          Adds a listener that is notified when a table column is about to be added, moved or removed.
protected  void fireColumnWillBeAdded(TableColumnModelEvent e)
          Notifies 'veto' listeners that a table column is about to be added.
protected  void fireColumnWillBeMoved(TableColumnModelEvent e)
          Notifies 'veto' listeners that a table column is about to be moved.
protected  void fireColumnWillBeRemoved(TableColumnModelEvent e)
          Notifies 'veto' listeners that a table column is about to be removed.
 void moveColumn(int columnIndex, int newIndex)
          Moves the column and heading at columnIndex to newIndex.
 void removeColumn(TableColumn column)
          Deletes the column from the tableColumns array.
 void removeVetoableColumnModelListener(VetoableTableColumnModelListener l)
          Removes a listener that is notified when a table column is about to be added, moved or removed.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
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
 
Methods inherited from interface javax.swing.table.TableColumnModel
addColumnModelListener, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumns, getColumnSelectionAllowed, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel
 

Constructor Detail

DefaultVetoableColumnModel

public DefaultVetoableColumnModel()
Constructs a DefaultVetoableColumnModel.

Method Detail

addColumn

public void addColumn(TableColumn aColumn)
Appends aColumn to the end of the tableColumns array. This method also posts the columnAdded event to its listeners.

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

addVetoableColumnModelListener

public void addVetoableColumnModelListener(VetoableTableColumnModelListener l)
Adds a listener that is notified when a table column is about to be added, moved or removed.

Specified by:
addVetoableColumnModelListener in interface VetoableTableColumnModel
Parameters:
l - the listener to be added

fireColumnWillBeAdded

protected void fireColumnWillBeAdded(TableColumnModelEvent e)
                              throws ColumnModelVetoException
Notifies 'veto' listeners that a table column is about to be added.

Parameters:
e - the event identifying the addition
Throws:
ColumnModelVetoException

fireColumnWillBeMoved

protected void fireColumnWillBeMoved(TableColumnModelEvent e)
                              throws ColumnModelVetoException
Notifies 'veto' listeners that a table column is about to be moved.

Parameters:
e - the event identifying the move
Throws:
ColumnModelVetoException

fireColumnWillBeRemoved

protected void fireColumnWillBeRemoved(TableColumnModelEvent e)
                                throws ColumnModelVetoException
Notifies 'veto' listeners that a table column is about to be removed.

Parameters:
e - the event identifying the removal
Throws:
ColumnModelVetoException

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 TableColumnModel
Overrides:
moveColumn in class DefaultTableColumnModel
Parameters:
columnIndex - the index of column to be moved
newIndex - new index to move the column

removeColumn

public void removeColumn(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 TableColumnModel
Overrides:
removeColumn in class DefaultTableColumnModel
Parameters:
column - the TableColumn to be removed
See Also:
DefaultTableColumnModel.addColumn(javax.swing.table.TableColumn)

removeVetoableColumnModelListener

public void removeVetoableColumnModelListener(VetoableTableColumnModelListener l)
Removes a listener that is notified when a table column is about to be added, moved or removed.

Specified by:
removeVetoableColumnModelListener in interface VetoableTableColumnModel
Parameters:
l - the listener to be removed

Copyright © 2005 Scientific Applications. All Rights Reserved.