|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractListModel
uk.ac.starlink.topcat.ColumnComboBoxModel
public class ColumnComboBoxModel
Adaptor class which turns a 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.
| Field Summary | |
|---|---|
static uk.ac.starlink.table.gui.StarTableColumn |
NO_COLUMN
|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
columnAdded(TableColumnModelEvent evt)
|
void |
columnMarginChanged(ChangeEvent evt)
|
void |
columnMoved(TableColumnModelEvent evt)
|
void |
columnRemoved(TableColumnModelEvent evt)
|
void |
columnSelectionChanged(ListSelectionEvent evt)
|
TableColumnModel |
getColumnModel()
|
Object |
getElementAt(int index)
|
Object |
getSelectedItem()
The returned object is guaranteed to be a TableColumn or null. |
int |
getSize()
|
JComboBox |
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. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.ListModel |
|---|
addListDataListener, removeListDataListener |
| Field Detail |
|---|
public static final uk.ac.starlink.table.gui.StarTableColumn NO_COLUMN
| Constructor Detail |
|---|
public ColumnComboBoxModel(TableColumnModel colModel,
boolean hasNone)
colModel - the column modelhasNone - true iff an additional null entry at the head of
the list is required| Method Detail |
|---|
public void setHasNone(boolean hasNone)
hasNone - true iff an additional null entry at the head of
the list is requiredpublic TableColumnModel getColumnModel()
public Object getElementAt(int index)
getElementAt in interface ListModelpublic int getSize()
getSize in interface ListModelpublic Object getSelectedItem()
TableColumn or null.
getSelectedItem in interface ComboBoxModelpublic void setSelectedItem(Object item)
TableColumn object.
setSelectedItem in interface ComboBoxModelitem - a table column to select
ClassCastException - if item is not null or a
TableColumnpublic JComboBox 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 TableColumnModelListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||