Changeset 18126 in josm for trunk/src/org
- Timestamp:
- 2021-08-06T01:22:18+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java
r12846 r18126 6 6 import javax.swing.text.JTextComponent; 7 7 8 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 8 9 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 9 10 import org.openstreetmap.josm.spi.preferences.Config; … … 55 56 */ 56 57 public void addCurrentItemToHistory() { 57 model.addElement((String) getEditor().getItem()); 58 Object item = getEditor().getItem(); 59 if (item instanceof String) { 60 model.addElement((String) item); 61 } else if (item instanceof AutoCompletionItem) { 62 model.addElement((AutoCompletionItem) item); 63 } else { 64 throw new IllegalArgumentException(item.getClass().getSimpleName() + " is not supported in addCurrentItemToHistory"); 65 } 58 66 } 59 67
Note:
See TracChangeset
for help on using the changeset viewer.