|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractCellEditor
org.jdesktop.swingx.autocomplete.ComboBoxCellEditor
public class ComboBoxCellEditor
This is a cell editor that can be used when a combo box (that has been set
up for automatic completion) is to be used in a JTable. The
DefaultCellEditor
won't work in this
case, because each time an item gets selected it stops cell editing and hides
the combo box.
Usage example:
JTable table = ...;
JComboBox comboBox = ...;
...
TableColumn column = table.getColumnModel().getColumn(0);
column.setCellEditor(new ComboBoxCellEditor(comboBox));
Field Summary |
---|
Fields inherited from class javax.swing.AbstractCellEditor |
---|
changeEvent, listenerList |
Constructor Summary | |
---|---|
ComboBoxCellEditor(JComboBox comboBox)
Creates a new ComboBoxCellEditor. |
Method Summary | |
---|---|
Object |
getCellEditorValue()
Returns the value contained in the combo box |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Sets an initial value for the combo box. |
boolean |
stopCellEditing()
Tells the combo box to stop editing and accept any partially edited value as the value of the combo box. |
Methods inherited from class javax.swing.AbstractCellEditor |
---|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.CellEditor |
---|
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell |
Constructor Detail |
---|
public ComboBoxCellEditor(JComboBox comboBox)
comboBox
- the comboBox that should be used as the cell editor.Method Detail |
---|
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor
public boolean stopCellEditing()
stopCellEditing
in interface CellEditor
stopCellEditing
in class AbstractCellEditor
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
table
- the JTable that is asking the editor to edit; can be nullvalue
- the value of the cell to be edited; null is a valid valueisSelected
- will be ignoredrow
- the row of the cell being editedcolumn
- the column of the cell being edited
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |