Class TagCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- org.openstreetmap.josm.gui.tagging.TagCellEditor
-
- All Implemented Interfaces:
Serializable
,CellEditor
,TableCellEditor
public class TagCellEditor extends AbstractCellEditor implements TableCellEditor
This is the table cell editor for the tag editor dialog.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AutoCompletionManager
autocomplete
the cache of auto completion items derived from the current JOSM data setprotected AutoCompletionList
autoCompletionList
user input is matched against this list of auto completion itemsprotected TagModel
currentTag
protected AutoCompletingTextField
editor
-
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
-
-
Constructor Summary
Constructors Constructor Description TagCellEditor(int maxCharacters)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
autoCompletionItemSelected(String item)
Selects an item from the auto completion list and fills this cell with the valueAutoCompletionList
getAutoCompletionList()
replies theAutoCompletionList
this table cell editor synchronizes withObject
getCellEditorValue()
AutoCompletingTextField
getEditor()
Gets the editor for this cellComponent
getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
replies the table cell editorprotected 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(String forKey)
initializes the auto completion list when the cell editor starts to edit a tag value.void
setAutoCompletionList(AutoCompletionList autoCompletionList)
sets theAutoCompletionList
this table cell editor synchronizes withvoid
setAutoCompletionManager(AutoCompletionManager autocomplete)
Sets the manager that helps with auto completion-
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 transient TagModel currentTag
-
autocomplete
protected transient 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(int maxCharacters)
constructor- Parameters:
maxCharacters
- maximum number of characters allowed, 0 for unlimited
-
-
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 modelcurrentTag
- the current tag
-
initAutoCompletionListForValues
protected void initAutoCompletionListForValues(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 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
replies the table cell editor- Specified by:
getTableCellEditorComponent
in interfaceTableCellEditor
-
getCellEditorValue
public Object getCellEditorValue()
- Specified by:
getCellEditorValue
in interfaceCellEditor
-
getAutoCompletionList
public AutoCompletionList getAutoCompletionList()
replies theAutoCompletionList
this table cell editor synchronizes with- Returns:
- the auto completion list
-
setAutoCompletionList
public void setAutoCompletionList(AutoCompletionList autoCompletionList)
sets theAutoCompletionList
this table cell editor synchronizes with- Parameters:
autoCompletionList
- the auto completion list
-
setAutoCompletionManager
public void setAutoCompletionManager(AutoCompletionManager autocomplete)
Sets the manager that helps with auto completion- Parameters:
autocomplete
- TheAutoCompletionManager
-
autoCompletionItemSelected
public void autoCompletionItemSelected(String item)
Selects an item from the auto completion list and fills this cell with the value- Parameters:
item
- The text that was selected
-
getEditor
public AutoCompletingTextField getEditor()
Gets the editor for this cell- Returns:
- The editor text field
-
-