Changeset 5479 in josm


Ignore:
Timestamp:
2012-08-26T19:34:36+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #8003 - Recently used tag button does not fill in last used single-digit value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r5450 r5479  
    222222    public void setPossibleItems(Collection<String> elems) {
    223223        DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel();
    224         Object oldValue = this.getEditor().getItem();
     224        Object oldValue = getSelectedItem();
    225225        model.removeAllElements();
    226226        for (String elem : elems) {
     
    230230        // AutoCompletingComboBoxDocument#insertString
    231231        autocompleteEnabled = false;
    232         this.getEditor().setItem(oldValue);
     232        setSelectedItem(oldValue);
    233233        autocompleteEnabled = true;
    234234    }
     
    239239    public void setPossibleACItems(Collection<AutoCompletionListItem> elems) {
    240240        DefaultComboBoxModel model = (DefaultComboBoxModel)this.getModel();
    241         Object oldValue = this.getEditor().getItem();
     241        Object oldValue = getSelectedItem();
    242242        model.removeAllElements();
    243243        for (AutoCompletionListItem elem : elems) {
    244244            model.addElement(elem);
    245245        }
    246         this.getEditor().setItem(oldValue);
     246        setSelectedItem(oldValue);
    247247    }
    248248
Note: See TracChangeset for help on using the changeset viewer.