javax.swing.table
public interface TableColumnModel
Method Summary | |
---|---|
void | addColumn(TableColumn column)
Adds a column to the model.
|
void | addColumnModelListener(TableColumnModelListener listener)
Registers a listener with the model, so that it will receive
{@link TableColumnModelEvent} notifications.
|
TableColumn | getColumn(int columnIndex)
Returns the TableColumn at the specified index.
|
int | getColumnCount()
Returns the number of columns in the model.
|
int | getColumnIndex(Object identifier)
Returns the index of the {@link TableColumn} with the given identifier.
|
int | getColumnIndexAtX(int xPosition)
Returns the index of the column that contains the specified x-coordinate,
assuming that:
-1 .
|
int | getColumnMargin()
Returns the column margin.
|
Enumeration<TableColumn> | getColumns()
Returns an enumeration of the columns in the model.
|
boolean | getColumnSelectionAllowed()
Returns true if column selection is allowed, and
false if column selection is not allowed.
|
int | getSelectedColumnCount()
Returns the number of selected columns in the model.
|
int[] | getSelectedColumns()
getSelectedColumns |
ListSelectionModel | getSelectionModel()
Returns the selection model used to track table column selections.
|
int | getTotalColumnWidth()
Returns total width of all the columns in the model, ignoring the
column margin (see {@link #getColumnMargin()}).
|
void | moveColumn(int columnIndex, int newIndex)
Moves a column.
|
void | removeColumn(TableColumn column)
Removes a column from the model. |
void | removeColumnModelListener(TableColumnModelListener listener)
Deregisters a listener, so that it will no longer receive
{@link TableColumnModelEvent} notifications.
|
void | setColumnMargin(int margin)
Sets the column margin and sends a {@link ChangeEvent} to all registered
{@link TableColumnModelListener}s registered with the model.
|
void | setColumnSelectionAllowed(boolean allowed)
Sets the flag that indicates whether or not column selection is allowed.
|
void | setSelectionModel(ListSelectionModel model)
Sets the selection model that will be used to keep track of the selected
columns.
|
Parameters: column the new column (null
not permitted).
Throws: IllegalArgumentException if column
is
null
.
Parameters: listener the listener (null
ignored).
TableColumn
at the specified index.
Parameters: columnIndex the column index.
Returns: The table column.
Returns: The column count.
Parameters: identifier the identifier (null
not permitted).
Returns: The index of the {@link TableColumn} with the given identifier.
Throws: IllegalArgumentException if identifier
is
null
or there is no column with that identifier.
-1
.
Parameters: xPosition the x-position.
Returns: The column index, or -1
.
Returns: The column margin.
See Also: TableColumnModel
Returns: An enumeration of the columns in the model.
true
if column selection is allowed, and
false
if column selection is not allowed.
Returns: A boolean.
See Also: TableColumnModel
Returns: The selected column count.
See Also: getSelectionModel
Returns: Selected columns
Returns: The selection model.
See Also: setSelectionModel
Returns: The total width of all the columns.
Parameters: columnIndex Index of column to move newIndex New index of column
column
is not defined
in the model, this method does nothing.
Parameters: column TableColumn
Parameters: listener the listener.
Parameters: margin the column margin.
See Also: getColumnMargin
Parameters: allowed the new flag value.
See Also: getColumnSelectionAllowed
Parameters: model the selection model (null
not permitted).
Throws: IllegalArgumentException if model
is
null
.