org.openstreetmap.josm.gui.tagging
Class TagCellEditor

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

public class TagCellEditor
extends javax.swing.AbstractCellEditor
implements javax.swing.table.TableCellEditor

This is the table cell editor for the tag editor dialog.

See Also:
Serialized Form

Field Summary
protected  AutoCompletionManager autocomplete
          the cache of auto completion items derived from the current JOSM data set
protected  AutoCompletionList autoCompletionList
          user input is matched against this list of auto completion items
protected  TagModel currentTag
           
protected  AutoCompletingTextField editor
           
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
TagCellEditor()
          constructor
 
Method Summary
 void autoCompletionItemSelected(java.lang.String item)
           
 AutoCompletionList getAutoCompletionList()
          replies the AutoCompletionList this table cell editor synchronizes with
 java.lang.Object getCellEditorValue()
           
 AutoCompletingTextField getEditor()
           
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          replies the table cell editor
protected  void initAutoCompletionListForKeys(TagEditorModel model, TagModel currentTag)
          initializes the auto completion list when the table cell editor starts to edit the key of a tag.
protected  void initAutoCompletionListForValues(java.lang.String forKey)
          initializes the auto completion list when the cell editor starts to edit a tag value.
 void setAutoCompletionList(AutoCompletionList autoCompletionList)
          sets the AutoCompletionList this table cell editor synchronizes with
 void setAutoCompletionManager(AutoCompletionManager autocomplete)
           
 
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

protected AutoCompletingTextField editor

currentTag

protected TagModel currentTag

autocomplete

protected AutoCompletionManager autocomplete
the cache of auto completion items derived from the current JOSM data set


autoCompletionList

protected AutoCompletionList autoCompletionList
user input is matched against this list of auto completion items

Constructor Detail

TagCellEditor

public TagCellEditor()
constructor

Method Detail

initAutoCompletionListForKeys

protected void initAutoCompletionListForKeys(TagEditorModel model,
                                             TagModel currentTag)
initializes the auto completion list when the table cell editor starts to edit the key of a tag. In this case the auto completion list is initialized with the set of standard key values and the set of current key values from the current JOSM data set. Keys already present in the current tag model are removed from the auto completion list.

Parameters:
model - the tag editor model
currentTag - the current tag

initAutoCompletionListForValues

protected void initAutoCompletionListForValues(java.lang.String forKey)
initializes the auto completion list when the cell editor starts to edit a tag value. In this case the auto completion list is initialized with the set of standard values for a given key and the set of values present in the current data set for the given key.

Parameters:
forKey - the key

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
replies the table cell editor

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

getCellEditorValue

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

getAutoCompletionList

public AutoCompletionList getAutoCompletionList()
replies the AutoCompletionList this table cell editor synchronizes with

Returns:
the auto completion list

setAutoCompletionList

public void setAutoCompletionList(AutoCompletionList autoCompletionList)
sets the AutoCompletionList this table cell editor synchronizes with

Parameters:
autoCompletionList - the auto completion list

setAutoCompletionManager

public void setAutoCompletionManager(AutoCompletionManager autocomplete)

autoCompletionItemSelected

public void autoCompletionItemSelected(java.lang.String item)

getEditor

public AutoCompletingTextField getEditor()


JOSM