Class MultiValueCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- org.openstreetmap.josm.gui.conflict.tags.MultiValueCellEditor
-
- All Implemented Interfaces:
Serializable
,CellEditor
,TableCellEditor
public class MultiValueCellEditor extends AbstractCellEditor implements TableCellEditor
This is a table cell editor for selecting a possible tag value from a list of proposed tag values. The editor also allows to select all proposed valued or to remove the tag. The editor responds intercepts some keys and interprets them as navigation keys. It forwards navigation events toMultiValueCellEditor.NavigationListener
s registered with this editor. You should register the parent table using this editor asMultiValueCellEditor.NavigationListener
.KeyEvent.VK_ENTER
andKeyEvent.VK_TAB
trigger aMultiValueCellEditor.NavigationListener.gotoNextDecision()
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MultiValueCellEditor.EditorCellRenderer
The cell renderer used in the edit combo boxstatic interface
MultiValueCellEditor.NavigationListener
Defines the interface for an object implementing navigation between rows
-
Field Summary
Fields Modifier and Type Field Description private JosmComboBox<Object>
editor
the combo box used as editorprivate JosmComboBoxModel<Object>
editorModel
private CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener>
listeners
-
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
-
-
Constructor Summary
Constructors Constructor Description MultiValueCellEditor()
Construct a newMultiValueCellEditor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
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, stopCellEditing
-
-
-
-
Field Detail
-
editor
private final JosmComboBox<Object> editor
the combo box used as editor
-
editorModel
private final JosmComboBoxModel<Object> editorModel
-
listeners
private final CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener> listeners
-
-
Constructor Detail
-
MultiValueCellEditor
public MultiValueCellEditor()
Construct a newMultiValueCellEditor
-
-
Method Detail
-
addNavigationListener
public void addNavigationListener(MultiValueCellEditor.NavigationListener listener)
Adds a navigation listener.- Parameters:
listener
- navigation listener to add
-
removeNavigationListener
public void removeNavigationListener(MultiValueCellEditor.NavigationListener listener)
Removes a navigation listener.- Parameters:
listener
- navigation listener to remove
-
fireGotoNextDecision
protected void fireGotoNextDecision()
-
fireGotoPreviousDecision
protected void fireGotoPreviousDecision()
-
initEditor
protected void initEditor(MultiValueResolutionDecision decision)
Populate model with possible values for a decision, and select current choice.- Parameters:
decision
- TheMultiValueResolutionDecision
to proceed
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
- Specified by:
getTableCellEditorComponent
in interfaceTableCellEditor
-
getCellEditorValue
public Object getCellEditorValue()
- Specified by:
getCellEditorValue
in interfaceCellEditor
-
-