public class ColumnComboBoxModel extends AbstractListModel<TableColumn> implements TableColumnModelListener, ComboBoxModel<TableColumn>
TableColumnModel
into a ComboBoxModel. This model is designed
to reflect the contents of a column model rather than the other
way around, so in general you wouldn't want to add a ListDataListener
to this model, you'd add it to the underlying column model.
Selections in the column model are not reflected by selections in this model, but columns added/moved/removed are.
| Modifier and Type | Field and Description |
|---|---|
static uk.ac.starlink.table.gui.StarTableColumn |
NO_COLUMN |
listenerList| Constructor and Description |
|---|
ColumnComboBoxModel(TableColumnModel colModel,
boolean hasNone)
Constructs a new ComboBoxModel based on a given column model,
optionally with a null entry at the head of the list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
columnAdded(TableColumnModelEvent evt) |
void |
columnMarginChanged(ChangeEvent evt) |
void |
columnMoved(TableColumnModelEvent evt) |
void |
columnRemoved(TableColumnModelEvent evt) |
void |
columnSelectionChanged(ListSelectionEvent evt) |
TableColumnModel |
getColumnModel() |
TableColumn |
getElementAt(int index) |
Object |
getSelectedItem() |
int |
getSize() |
JComboBox<TableColumn> |
makeComboBox()
Returns a new JComboBox based on this model.
|
void |
setHasNone(boolean hasNone)
Sets whether there should be a null entry at the head of the list.
|
void |
setSelectedItem(Object item)
The selected
item must be a
TableColumn object. |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListDataListener, removeListDataListenerpublic ColumnComboBoxModel(TableColumnModel colModel, boolean hasNone)
colModel - the column modelhasNone - true iff an additional null entry at the head of
the list is requiredpublic void setHasNone(boolean hasNone)
hasNone - true iff an additional null entry at the head of
the list is requiredpublic TableColumnModel getColumnModel()
public TableColumn getElementAt(int index)
getElementAt in interface ListModel<TableColumn>public int getSize()
getSize in interface ListModel<TableColumn>public Object getSelectedItem()
getSelectedItem in interface ComboBoxModel<TableColumn>public void setSelectedItem(Object item)
item must be a
TableColumn object.setSelectedItem in interface ComboBoxModel<TableColumn>item - a table column to selectpublic JComboBox<TableColumn> makeComboBox()
ColumnCellRendererpublic void columnAdded(TableColumnModelEvent evt)
columnAdded in interface TableColumnModelListenerpublic void columnRemoved(TableColumnModelEvent evt)
columnRemoved in interface TableColumnModelListenerpublic void columnMoved(TableColumnModelEvent evt)
columnMoved in interface TableColumnModelListenerpublic void columnMarginChanged(ChangeEvent evt)
columnMarginChanged in interface TableColumnModelListenerpublic void columnSelectionChanged(ListSelectionEvent evt)
columnSelectionChanged in interface TableColumnModelListenerCopyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.