Changeset 8267 in josm
- Timestamp:
- 2015-04-25T19:33:39+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r8005 r8267 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.EventObject; 10 import java.util.Objects; 10 11 11 12 import javax.swing.ComboBoxEditor; … … 95 96 String prefix = currentText.substring(0, offs); 96 97 autoCompletionList.applyFilter(prefix+str); 97 if (autoCompletionList.getFilteredSize() >0) {98 if (autoCompletionList.getFilteredSize() > 0 && !Objects.equals(str, noAutoCompletionString)) { 98 99 // there are matches. Insert the new text and highlight the 99 100 // auto completed suffix … … 120 121 /** the auto completion list user input is matched against */ 121 122 protected AutoCompletionList autoCompletionList = null; 123 /** a string which should not be auto completed */ 124 protected String noAutoCompletionString = null; 122 125 123 126 @Override … … 219 222 } 220 223 224 @Override 225 public void setText(String t) { 226 // disallow auto completion for this explicitly set string 227 this.noAutoCompletionString = t; 228 super.setText(t); 229 } 230 221 231 /** 222 232 * Sets the maximum number of characters allowed.
Note:
See TracChangeset
for help on using the changeset viewer.