public class MultiValueCellEditor extends AbstractCellEditor implements TableCellEditor
MultiValueCellEditor.NavigationListener
s registred with this editor.
You should register the parent table using this editor as MultiValueCellEditor.NavigationListener
.
KeyEvent.VK_ENTER
and KeyEvent.VK_TAB
trigger a MultiValueCellEditor.NavigationListener.gotoNextDecision()
.Modifier and Type | Class and Description |
---|---|
private static class |
MultiValueCellEditor.EditorCellRenderer
The cell renderer used in the edit combo box
|
static interface |
MultiValueCellEditor.NavigationListener
Defines the interface for an object implementing navigation between rows
|
Modifier and Type | Field and Description |
---|---|
private JosmComboBox<Object> |
editor
the combo box used as editor
|
private DefaultComboBoxModel<Object> |
editorModel |
private CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener> |
listeners |
changeEvent, listenerList
Constructor and Description |
---|
MultiValueCellEditor()
Construct a new
MultiValueCellEditor |
Modifier and Type | Method and Description |
---|---|
void |
addNavigationListener(MultiValueCellEditor.NavigationListener listener)
Adds a navigation listener.
|
protected void |
fireGotoNextDecision() |
protected void |
fireGotoPreviousDecision() |
Object |
getCellEditorValue() |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column) |
protected void |
initEditor(MultiValueResolutionDecision decision)
Populate model with possible values for a decision, and select current choice.
|
void |
removeNavigationListener(MultiValueCellEditor.NavigationListener listener)
Removes a navigation listener.
|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
private JosmComboBox<Object> editor
private DefaultComboBoxModel<Object> editorModel
private CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener> listeners
public MultiValueCellEditor()
MultiValueCellEditor
public void addNavigationListener(MultiValueCellEditor.NavigationListener listener)
listener
- navigation listener to addpublic void removeNavigationListener(MultiValueCellEditor.NavigationListener listener)
listener
- navigation listener to removeprotected void fireGotoNextDecision()
protected void fireGotoPreviousDecision()
protected void initEditor(MultiValueResolutionDecision decision)
decision
- The MultiValueResolutionDecision
to proceedpublic Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor