Changeset 5479 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2012-08-26T19:34:36+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r5450 r5479 222 222 public void setPossibleItems(Collection<String> elems) { 223 223 DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel(); 224 Object oldValue = this.getEditor().getItem();224 Object oldValue = getSelectedItem(); 225 225 model.removeAllElements(); 226 226 for (String elem : elems) { … … 230 230 // AutoCompletingComboBoxDocument#insertString 231 231 autocompleteEnabled = false; 232 this.getEditor().setItem(oldValue);232 setSelectedItem(oldValue); 233 233 autocompleteEnabled = true; 234 234 } … … 239 239 public void setPossibleACItems(Collection<AutoCompletionListItem> elems) { 240 240 DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel(); 241 Object oldValue = this.getEditor().getItem();241 Object oldValue = getSelectedItem(); 242 242 model.removeAllElements(); 243 243 for (AutoCompletionListItem elem : elems) { 244 244 model.addElement(elem); 245 245 } 246 this.getEditor().setItem(oldValue);246 setSelectedItem(oldValue); 247 247 } 248 248
Note:
See TracChangeset
for help on using the changeset viewer.