Changeset 4176 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2011-06-26T17:05:06+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6456 - selecting number in dropdown does not work

File:
1 edited

Legend:

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

    r4132 r4176  
    7878                    if (curText.length() != 0)
    7979                        Long.parseLong(curText);
     80                    item = lookupItem(curText, true);
    8081                } catch (NumberFormatException e) {
    8182                    // either the new text or the current text isn't a number. We continue with
    8283                    // autocompletion
    83                     item = lookupItem(curText);
     84                    item = lookupItem(curText, false);
    8485                }
    8586            } else {
    86                 item = lookupItem(curText);
     87                item = lookupItem(curText, false);
    8788            }
    8889
     
    114115        }
    115116
    116         private Object lookupItem(String pattern) {
     117        private Object lookupItem(String pattern, boolean match) {
    117118            ComboBoxModel model = comboBox.getModel();
    118119            AutoCompletionListItem bestItem = null;
     
    122123                    return currentItem;
    123124                }
    124                 if (currentItem.getValue().startsWith(pattern)) {
     125                if (!match && currentItem.getValue().startsWith(pattern)) {
    125126                    if (bestItem == null || currentItem.getPriority().compareTo(bestItem.getPriority()) > 0) {
    126127                        bestItem = currentItem;
Note: See TracChangeset for help on using the changeset viewer.