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 protectedEditableComboBoxCellEditor(java.text.Format format, Validator<java.lang.String> validator, PrefixSelector prefixSelector, java.lang.String loadingMessage)protectedEditableComboBoxCellEditor(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.ObjectgetCellEditorValue()protected abstract TsaveItem(T item)Populateitemand maybe persist it.booleanstopCellEditing()-
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:
stopCellEditingin interfacejavax.swing.CellEditor- Overrides:
stopCellEditingin classjavax.swing.DefaultCellEditor
-
saveItem
protected abstract T saveItem(T item)
Populateitemand maybe persist it. Ifitemis 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:
getCellEditorValuein interfacejavax.swing.CellEditor- Overrides:
getCellEditorValuein classjavax.swing.DefaultCellEditor
-
-