org.jcreme.swing.table.columnmodel
Class EditableTableColumnModel

java.lang.Object
  extended byjavax.swing.table.DefaultTableColumnModel
      extended byorg.jcreme.swing.table.columnmodel.EditableTableColumnModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.table.TableColumnModel

public class EditableTableColumnModel
extends javax.swing.table.DefaultTableColumnModel

This extension of the DefaultTableModel enables to handle hidden columns.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
EditableTableColumnModel()
           
 
Method Summary
 javax.swing.table.TableColumn[] getAllColumns()
          Gives access to a complete list of the columns in the model regardless of whether they are hidden or not.
 int getColumnIndex(java.lang.Object identifier)
          Provides the index of the column associated to the Identifier.
 javax.swing.table.TableColumn[] getHiddenColumns()
          Gives access to the hidden columns.
 void hideColumn(javax.swing.table.TableColumn column)
          Hide a column.
 void removeColumn(javax.swing.table.TableColumn column)
          Removes a column from the model (whether hidden or not).
 void showColumn(javax.swing.table.TableColumn column)
          Shows a previously hidden column.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, 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 Detail

EditableTableColumnModel

public EditableTableColumnModel()
Method Detail

hideColumn

public void hideColumn(javax.swing.table.TableColumn column)
Hide a column. If the column was present in the model it will not be displayed anymore.

Parameters:
column - the column to hide.

removeColumn

public void removeColumn(javax.swing.table.TableColumn column)
Removes a column from the model (whether hidden or not).

Parameters:
column - the column to remove.

showColumn

public void showColumn(javax.swing.table.TableColumn column)
Shows a previously hidden column. If the column was not hidden, same as addColumn.

Parameters:
column - the column to show.

getHiddenColumns

public javax.swing.table.TableColumn[] getHiddenColumns()
Gives access to the hidden columns.

Returns:
the hidden columns.

getColumnIndex

public int getColumnIndex(java.lang.Object identifier)
Provides the index of the column associated to the Identifier. Behaves as the superclass's implementation, except for hidden columns (returns -1).

Parameters:
identifier - the identifier of a column.
Returns:
the index of the column or -1 if the column is hidden.

getAllColumns

public javax.swing.table.TableColumn[] getAllColumns()
Gives access to a complete list of the columns in the model regardless of whether they are hidden or not.

Returns:
the TableColumns in the model.


Copyright 2006 null. All Rights Reserved.