|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.DefaultTableColumnModel
uk.ac.starlink.vo.MetaColumnModel
public class MetaColumnModel
This ColumnModel provides enhanced functionality over a normal ColumnModel, aimed at making it easy to select which columns in a related TableModel are shown (appear in this ColumnModel) or not shown (don't appear in this ColumnModel). It does this by using an associated ListModel and ListSelectionModel.
Field Summary |
---|
Fields inherited from class javax.swing.table.DefaultTableColumnModel |
---|
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth |
Constructor Summary | |
---|---|
MetaColumnModel(TableColumnModel baseColumnModel,
TableModel tableModel)
Constructs a new MetaColumnModel from a base ColumnModel and a TableModel. |
Method Summary | |
---|---|
void |
addColumn(TableColumn tcol)
When a column is added to this TableColumnModel, add it to the listModel and set it visible in the visibleModel |
ListModel |
getListModel()
Returns the ListModel representing all the columns in the original TableColumnModel. |
ListSelectionModel |
getVisibleModel()
Returns the ListSelectionModel representing which columns in the original TableColumnModel are currently visible (are represented in this ColumnModel) and which are invisible (are not represented in this ColumnModel). |
JMenu |
makeCheckBoxMenu(String name)
Returns a menu component which can be used to control the visibility of columns in the model. |
void |
purgeEmptyColumns()
Purges this column model of any column which contains nothing but blank entries. |
void |
removeColumn(int ipos)
Sets a column invisible. |
void |
removeColumn(TableColumn tcol)
When a column is removed from this TableColumnModel, set it invisible in the visibleModel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaColumnModel(TableColumnModel baseColumnModel, TableModel tableModel)
baseColumnModel
- the base ColumnModeltableModel
- the TableModel which supplies the data
for the columns this object describes; must refer to the
same data as baseColumnModelMethod Detail |
---|
public ListModel getListModel()
TableColumn
.
public ListSelectionModel getVisibleModel()
public void addColumn(TableColumn tcol)
addColumn
in interface TableColumnModel
addColumn
in class DefaultTableColumnModel
public void removeColumn(TableColumn tcol)
removeColumn
in interface TableColumnModel
removeColumn
in class DefaultTableColumnModel
public void removeColumn(int ipos)
ipos
- position of the column to removepublic void purgeEmptyColumns()
public JMenu makeCheckBoxMenu(String name)
name
- the name of the menu
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |