com.sas.servlet.tbeans.tableview
Interface TableColumnModel

All Known Implementing Classes:
DefaultTableColumnModel

public interface TableColumnModel

Defines the requirements for a table column model object suitable for use with TableView. This model is 0 based.


Method Summary
 void addColumn(TableColumn column)
          Appends a column to the end of the tableColumns array.
 void addColumnModelListener(TableColumnModelListener listener)
          Adds a listener for table column model events.
 TableColumn getColumn(int columnIndex)
          Returns the TableColumn object for the column at columnIndex.
 int getColumnCount()
          Returns the number of columns in the model.
 int getColumnIndex(java.lang.Object columnIdentifier)
          Returns the index of the first column in the table whose identifier is equal to identifier, when compared using equals.
 java.util.Enumeration getColumns()
          Returns an Enumeration of all the columns in the tableColumns array in the order they are to be displayed.
 java.util.Locale getLocale()
          Gets the locale.
 void moveColumn(int columnIndex, int newIndex)
          Moves the column and its header at columnIndex to newIndex.
 void removeColumn(TableColumn column)
          Deletes the TableColumn column from the tableColumns array.
 void removeColumnModelListener(TableColumnModelListener listener)
          Removes a listener for table column model events.
 void setColumnOrder(int[] columnIndexes)
          Set the order to display the columns that are currently in the tableColumns array.
 void setLocale(java.util.Locale loc)
          Sets the locale.
 

Method Detail

addColumn

void addColumn(TableColumn column)
Appends a column to the end of the tableColumns array.

Parameters:
column - the TableColumn to be added

removeColumn

void removeColumn(TableColumn column)
Deletes the TableColumn column from the tableColumns array. This method will do nothing if column is not in the tableColumns array.

Parameters:
column - the TableColumn to be removed

moveColumn

void moveColumn(int columnIndex,
                int newIndex)
Moves the column and its header 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.

Parameters:
columnIndex - the index of column to be moved
newIndex - index of the column's new location
Throws:
java.lang.IllegalArgumentException - if columnIndex or newIndex are not in the valid range

getColumnCount

int getColumnCount()
Returns the number of columns in the model.

Returns:
the number of columns in the model

getColumns

java.util.Enumeration getColumns()
Returns an Enumeration of all the columns in the tableColumns array in the order they are to be displayed.

Returns:
an Enumeration of all the columns in the tableColumns array in the order they are to be displayed

getColumnIndex

int getColumnIndex(java.lang.Object columnIdentifier)
Returns the index of the first column in the table whose identifier is equal to identifier, when compared using equals.

Parameters:
columnIdentifier - the identifier object
Returns:
the index of the first table column whose identifier is equal to identifier
Throws:
java.lang.IllegalArgumentException - if identifier is null, or no TableColumn has this identifier

getColumn

TableColumn getColumn(int columnIndex)
Returns the TableColumn object for the column at columnIndex.

Parameters:
columnIndex - the index of the desired column
Returns:
the TableColumn object for the column at columnIndex

setColumnOrder

void setColumnOrder(int[] columnIndexes)
Set the order to display the columns that are currently in the tableColumns array. If a column index is not included in the columnIndexes array then that column is removed from the tableColumns array.

Parameters:
columnIndexes - the indexes of the columns in the order they are to be displayed
Throws:
java.lang.IllegalArgumentException - if the columnIndexes array is larger than the tableColumns array or if an index in the columnIndexes array does not exist in the tableColumns array

addColumnModelListener

void addColumnModelListener(TableColumnModelListener listener)
Adds a listener for table column model events.

Parameters:
listener - a TableColumnModelListener object

removeColumnModelListener

void removeColumnModelListener(TableColumnModelListener listener)
Removes a listener for table column model events.

Parameters:
listener - a TableColumnModelListener object

setLocale

void setLocale(java.util.Locale loc)
Sets the locale.

Parameters:
loc - an instance of java.util.Locale

getLocale

java.util.Locale getLocale()
Gets the locale.

Returns:
an instance of java.util.Locale



Copyright © 2009 SAS Institute Inc. All Rights Reserved.