nextapp.echo.table
Class DefaultTableColumnModel

java.lang.Object
  extended by nextapp.echo.table.DefaultTableColumnModel
All Implemented Interfaces:
java.io.Serializable, TableColumnModel

public class DefaultTableColumnModel
extends java.lang.Object
implements java.io.Serializable, TableColumnModel

The default TableColumnModel implementation.

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
          A listener storage facility.
 
Constructor Summary
DefaultTableColumnModel()
          Creates a new DefaultTableColumnModel.
 
Method Summary
 void addColumn(TableColumn column)
          Adds a table column to the end of the table column model.
 void addColumnModelListener(TableColumnModelListener l)
          Adds a listener for table column model events.
protected  void fireColumnAdded(TableColumnModelEvent e)
          Notifies listeners that a column was added.
protected  void fireColumnMoved(TableColumnModelEvent e)
          Notifies listeners that a column was moved.
protected  void fireColumnRemoved(TableColumnModelEvent e)
          Notifies listeners that a column was removed.
 TableColumn getColumn(int index)
          Returns the table column found at the specified index.
 int getColumnCount()
          Returns the number of columns in the column model.
 int getColumnIndex(java.lang.Object identifier)
          Returns the index of the table column with the given identifier.
 java.util.Iterator getColumns()
          Returns an iterator over the columns of the column model.
 void moveColumn(int columnIndex, int newIndex)
          Moves a table column to a new index.
 void removeColumn(TableColumn column)
          Remove a table column.
 void removeColumnModelListener(TableColumnModelListener l)
          Removes a listener for table column model events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
A listener storage facility.

Constructor Detail

DefaultTableColumnModel

public DefaultTableColumnModel()
Creates a new DefaultTableColumnModel.

Method Detail

addColumn

public void addColumn(TableColumn column)
Description copied from interface: TableColumnModel
Adds a table column to the end of the table column model.

Specified by:
addColumn in interface TableColumnModel
Parameters:
column - The table column to be added.
See Also:
TableColumnModel.addColumn(TableColumn)

addColumnModelListener

public void addColumnModelListener(TableColumnModelListener l)
Description copied from interface: TableColumnModel
Adds a listener for table column model events.

Specified by:
addColumnModelListener in interface TableColumnModel
Parameters:
l - The listener to add.
See Also:
TableColumnModel.addColumnModelListener(TableColumnModelListener)

fireColumnAdded

protected void fireColumnAdded(TableColumnModelEvent e)
Notifies listeners that a column was added.

Parameters:
e - An event describing the update.

fireColumnMoved

protected void fireColumnMoved(TableColumnModelEvent e)
Notifies listeners that a column was moved.

Parameters:
e - An event describing the update.

fireColumnRemoved

protected void fireColumnRemoved(TableColumnModelEvent e)
Notifies listeners that a column was removed.

Parameters:
e - An event describing the update.

getColumn

public TableColumn getColumn(int index)
Description copied from interface: TableColumnModel
Returns the table column found at the specified index.

Specified by:
getColumn in interface TableColumnModel
Parameters:
index - The index of the TableColumn to return.
Returns:
The table column at the given index.
See Also:
TableColumnModel.getColumn(int)

getColumnCount

public int getColumnCount()
Description copied from interface: TableColumnModel
Returns the number of columns in the column model.

Specified by:
getColumnCount in interface TableColumnModel
Returns:
The number of columns specified in this table column model.
See Also:
TableColumnModel.getColumnCount()

getColumnIndex

public int getColumnIndex(java.lang.Object identifier)
Description copied from interface: TableColumnModel
Returns the index of the table column with the given identifier.

Specified by:
getColumnIndex in interface TableColumnModel
Parameters:
identifier - The identifier of the table column to return.
Returns:
The index of the given table column.
See Also:
TableColumnModel.getColumnIndex(Object)

getColumns

public java.util.Iterator getColumns()
Description copied from interface: TableColumnModel
Returns an iterator over the columns of the column model.

Specified by:
getColumns in interface TableColumnModel
Returns:
An iterator over the columns of the column model.
See Also:
TableColumnModel.getColumns()

moveColumn

public void moveColumn(int columnIndex,
                       int newIndex)
Description copied from interface: TableColumnModel
Moves a table column to a new index.

Specified by:
moveColumn in interface TableColumnModel
Parameters:
columnIndex - The index of the column to move.
newIndex - The index to move the column to.
See Also:
TableColumnModel.moveColumn(int, int)

removeColumn

public void removeColumn(TableColumn column)
Description copied from interface: TableColumnModel
Remove a table column.

Specified by:
removeColumn in interface TableColumnModel
Parameters:
column - The column to remove.
See Also:
TableColumnModel.removeColumn(TableColumn)

removeColumnModelListener

public void removeColumnModelListener(TableColumnModelListener l)
Description copied from interface: TableColumnModel
Removes a listener for table column model events.

Specified by:
removeColumnModelListener in interface TableColumnModel
Parameters:
l - The listener to remove.
See Also:
TableColumnModel.removeColumnModelListener(TableColumnModelListener)