Changeset 4176 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-06-26T17:05:06+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r4132 r4176 78 78 if (curText.length() != 0) 79 79 Long.parseLong(curText); 80 item = lookupItem(curText, true); 80 81 } catch (NumberFormatException e) { 81 82 // either the new text or the current text isn't a number. We continue with 82 83 // autocompletion 83 item = lookupItem(curText );84 item = lookupItem(curText, false); 84 85 } 85 86 } else { 86 item = lookupItem(curText );87 item = lookupItem(curText, false); 87 88 } 88 89 … … 114 115 } 115 116 116 private Object lookupItem(String pattern ) {117 private Object lookupItem(String pattern, boolean match) { 117 118 ComboBoxModel model = comboBox.getModel(); 118 119 AutoCompletionListItem bestItem = null; … … 122 123 return currentItem; 123 124 } 124 if ( currentItem.getValue().startsWith(pattern)) {125 if (!match && currentItem.getValue().startsWith(pattern)) { 125 126 if (bestItem == null || currentItem.getPriority().compareTo(bestItem.getPriority()) > 0) { 126 127 bestItem = currentItem;
Note:
See TracChangeset
for help on using the changeset viewer.