public class XTableColumnModel extends DefaultTableColumnModel
DefaultTableColumnModel,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Vector<TableColumn> |
allTableColumns
Array of TableColumn objects in this model.
|
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth| Constructor and Description |
|---|
XTableColumnModel()
Creates an extended table column model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(TableColumn column)
Append column to the right of existing columns.
|
TableColumn |
getColumn(int columnIndex,
boolean onlyVisible)
Returns the TableColumn object for the column at columnIndex.
|
TableColumn |
getColumnByModelIndex(int modelColumnIndex)
Maps the index of the column in the table model at
modelColumnIndex to the TableColumn object.
|
int |
getColumnCount(boolean onlyVisible)
Returns the total number of columns in this model.
|
int |
getColumnIndex(Object identifier,
boolean onlyVisible)
Returns the position of the first column whose identifier equals identifier.
|
Enumeration<TableColumn> |
getColumns(boolean onlyVisible)
Returns an Enumeration of all the columns in the model.
|
boolean |
isColumnVisible(TableColumn aColumn)
Checks whether the specified column is currently visible.
|
void |
moveColumn(int oldIndex,
int newIndex)
Moves the column from oldIndex to newIndex.
|
void |
removeColumn(TableColumn column)
Removes column from this column model.
|
void |
setAllColumnsVisible()
Makes all columns in this model visible
|
void |
setColumnVisible(TableColumn column,
boolean visible)
Sets the visibility of the specified TableColumn.
|
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, valueChangedprotected Vector<TableColumn> allTableColumns
public XTableColumnModel()
public void setColumnVisible(TableColumn column, boolean visible)
column - the column to show/hidevisible - its new visibility statuspublic void setAllColumnsVisible()
public TableColumn getColumnByModelIndex(int modelColumnIndex)
modelColumnIndex - index of column in table modelpublic boolean isColumnVisible(TableColumn aColumn)
aColumn - column to checkpublic void addColumn(TableColumn column)
addColumn in interface TableColumnModeladdColumn in class DefaultTableColumnModelcolumn - The column to be addedIllegalArgumentException - if column is nullremoveColumn(javax.swing.table.TableColumn)public void removeColumn(TableColumn column)
removeColumn in interface TableColumnModelremoveColumn in class DefaultTableColumnModelcolumn - the column to be addedaddColumn(javax.swing.table.TableColumn)public void moveColumn(int oldIndex,
int newIndex)
moveColumn in interface TableColumnModelmoveColumn in class DefaultTableColumnModeloldIndex - index of column to be movednewIndex - new index of the columnIllegalArgumentException - if either oldIndex or
newIndex
are not in [0, getColumnCount() - 1]public int getColumnCount(boolean onlyVisible)
onlyVisible - if set only visible columns will be countedgetColumns(boolean)public Enumeration<TableColumn> getColumns(boolean onlyVisible)
onlyVisible - if set all invisible columns will be missing from the enumeration.public int getColumnIndex(Object identifier, boolean onlyVisible)
identifier - the identifier object to search foronlyVisible - if set searches only visible columnsIllegalArgumentException - if identifier
is null, or if no
TableColumn has this
identifiergetColumn(int, boolean)public TableColumn getColumn(int columnIndex, boolean onlyVisible)
columnIndex - the index of the column desiredonlyVisible - if set columnIndex is meant to be relative to all visible columns only else it is the index in all columnsCopyright © 2013. All Rights Reserved.