Class EnumSetTableCellEditor<E extends Enum<E>>
java.lang.Object
javax.swing.AbstractCellEditor
uno.anahata.asi.swing.components.EnumSetTableCellEditor<E>
- Type Parameters:
E- The specific enum type.
- All Implemented Interfaces:
Serializable, CellEditor, TableCellEditor
public class EnumSetTableCellEditor<E extends Enum<E>>
extends AbstractCellEditor
implements TableCellEditor
A generic, reusable
TableCellEditor for editing sets or lists of Enum constants.
Employs EnumSetComboBox as the interactive editing component, providing a sleek dropdown
with real-time multi-checkbox toggling and automatic commit upon popup closure.
- Author:
- anahata
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EnumSetComboBox<E> The embedded multi-selection combo component.Fields inherited from class AbstractCellEditor
changeEvent, listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) Methods inherited from class AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CellEditor
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
Field Details
-
comboBox
The embedded multi-selection combo component.
-
-
Constructor Details
-
EnumSetTableCellEditor
public EnumSetTableCellEditor(@NonNull @NonNull Class<E> enumClass, Function<E, Icon> iconProvider, Function<E, String> labelProvider) Constructs a new EnumSetTableCellEditor.- Parameters:
enumClass- The target enum class.iconProvider- Optional function mapping enum constants to icons.labelProvider- Optional function mapping enum constants to labels.
-
-
Method Details
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) Populates the combo component with the cell's current enum collection and returns the combo editor.
- Specified by:
getTableCellEditorComponentin interfaceTableCellEditor
-
getCellEditorValue
Returns the selected enum constants as an ordered
List.- Specified by:
getCellEditorValuein interfaceCellEditor
-

