Ticket #5876: josm_5876.patch
File josm_5876.patch, 1.3 KB (added by , 13 years ago) |
---|
-
tagging/ac/AutoCompletingComboBox.java
84 84 } 85 85 } 86 86 87 // the string being inserted might be a "full" string from the list 88 // of valid completions (instanceof AutoCompletionListItem), or a 89 // "partial" string being typed (instanceof String). 90 Object item = comboBox.getSelectedItem(); 91 if (item != null && (item instanceof String || !curText.equals(((AutoCompletionListItem) item).getValue()))) { 92 // only in the latter case do we have to 87 93 // lookup and select a matching item 88 Objectitem = lookupItem(curText);94 item = lookupItem(curText); 89 95 setSelectedItem(item); 96 } 90 97 if (initial) { 91 98 start = 0; 92 99 } … … 113 120 selecting = false; 114 121 } 115 122 116 private ObjectlookupItem(String pattern) {123 private AutoCompletionListItem lookupItem(String pattern) { 117 124 ComboBoxModel model = comboBox.getModel(); 118 125 AutoCompletionListItem bestItem = null; 119 126 for (int i = 0, n = model.getSize(); i < n; i++) {