Class EditableComboBoxCellEditor<T extends java.lang.Comparable<? super T>>
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- javax.swing.DefaultCellEditor
-
- io.github.jonestimd.swing.component.ComboBoxCellEditor
-
- io.github.jonestimd.swing.component.BeanListComboBoxCellEditor<T>
-
- io.github.jonestimd.swing.component.EditableComboBoxCellEditor<T>
-
- Type Parameters:
T
- the list item class
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.CellEditor
,javax.swing.table.TableCellEditor
,javax.swing.tree.TreeCellEditor
public abstract class EditableComboBoxCellEditor<T extends java.lang.Comparable<? super T>> extends BeanListComboBoxCellEditor<T>
Provides a cell editor (BeanListComboBox
) for selecting from a list of beans or creating a new item.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EditableComboBoxCellEditor(java.text.Format format, Validator<java.lang.String> validator, PrefixSelector prefixSelector, java.lang.String loadingMessage)
protected
EditableComboBoxCellEditor(java.text.Format format, Validator<java.lang.String> validator, java.lang.String loadingMessage)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getCellEditorValue()
protected abstract T
saveItem(T item)
Populateitem
and maybe persist it.boolean
stopCellEditing()
-
Methods inherited from class io.github.jonestimd.swing.component.BeanListComboBoxCellEditor
addListItems, getComboBox, getComboBoxModel, getComboBoxValues, getTableCellEditorComponent, getTreeCellEditorComponent, setListItems
-
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getClickCountToStart, getComponent, isCellEditable, setClickCountToStart, shouldSelectCell
-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
-
-
-
-
Constructor Detail
-
EditableComboBoxCellEditor
protected EditableComboBoxCellEditor(java.text.Format format, Validator<java.lang.String> validator, java.lang.String loadingMessage)
-
EditableComboBoxCellEditor
protected EditableComboBoxCellEditor(java.text.Format format, Validator<java.lang.String> validator, PrefixSelector prefixSelector, java.lang.String loadingMessage)
-
-
Method Detail
-
stopCellEditing
public boolean stopCellEditing()
- Specified by:
stopCellEditing
in interfacejavax.swing.CellEditor
- Overrides:
stopCellEditing
in classjavax.swing.DefaultCellEditor
-
saveItem
protected abstract T saveItem(T item)
Populateitem
and maybe persist it. Ifitem
is persisted then it should also be added to the combo box list.- Parameters:
item
- the new item from the combo box editor- Returns:
- the updated item.
-
getCellEditorValue
public java.lang.Object getCellEditorValue()
- Specified by:
getCellEditorValue
in interfacejavax.swing.CellEditor
- Overrides:
getCellEditorValue
in classjavax.swing.DefaultCellEditor
-
-