org.openstreetmap.josm.gui.conflict.tags
Class MultiValueCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by org.openstreetmap.josm.gui.conflict.tags.MultiValueCellEditor
All Implemented Interfaces:
java.io.Serializable, javax.swing.CellEditor, javax.swing.table.TableCellEditor

public class MultiValueCellEditor
extends javax.swing.AbstractCellEditor
implements javax.swing.table.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 to MultiValueCellEditor.NavigationListeners 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().

See Also:
Serialized Form

Nested Class Summary
private static class MultiValueCellEditor.EditorCellRenderer
          The cell renderer used in the combo box
static interface MultiValueCellEditor.NavigationListener
           
 
Field Summary
private  JosmComboBox editor
          the combo box used as editor
private  javax.swing.DefaultComboBoxModel editorModel
           
private  java.util.concurrent.CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener> listeners
           
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
MultiValueCellEditor()
           
 
Method Summary
 void addNavigationListeners(MultiValueCellEditor.NavigationListener listener)
           
protected  void fireGotoNextDecision()
           
protected  void fireGotoPreviousDecision()
           
 java.lang.Object getCellEditorValue()
           
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
           
protected  void initEditor(MultiValueResolutionDecision decision)
           
 void removeavigationListeners(MultiValueCellEditor.NavigationListener 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 JosmComboBox editor
the combo box used as editor


editorModel

private javax.swing.DefaultComboBoxModel editorModel

listeners

private java.util.concurrent.CopyOnWriteArrayList<MultiValueCellEditor.NavigationListener> listeners
Constructor Detail

MultiValueCellEditor

public MultiValueCellEditor()
Method Detail

addNavigationListeners

public void addNavigationListeners(MultiValueCellEditor.NavigationListener listener)

removeavigationListeners

public void removeavigationListeners(MultiValueCellEditor.NavigationListener listener)

fireGotoNextDecision

protected void fireGotoNextDecision()

fireGotoPreviousDecision

protected void fireGotoPreviousDecision()

initEditor

protected void initEditor(MultiValueResolutionDecision decision)

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

getCellEditorValue

public java.lang.Object getCellEditorValue()
Specified by:
getCellEditorValue in interface javax.swing.CellEditor


JOSM