- Timestamp:
- 2020-02-10T22:58:07+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r15835 r15837 92 92 */ 93 93 class AutoCompletingComboBoxDocument extends PlainDocument { 94 private final JosmComboBox<AutoCompletionItem> comboBox;95 94 private boolean selecting; 96 97 /**98 * Constructs a new {@code AutoCompletingComboBoxDocument}.99 * @param comboBox the combobox100 */101 AutoCompletingComboBoxDocument(final JosmComboBox<AutoCompletionItem> comboBox) {102 this.comboBox = comboBox;103 }104 95 105 96 @Override … … 181 172 } 182 173 } 183 final JTextComponent editorComponent = comboBox.getEditorComponent();174 final JTextComponent editorComponent = getEditorComponent(); 184 175 // save unix system selection (middle mouse paste) 185 176 Clipboard sysSel = ClipboardUtils.getSystemSelection(); … … 197 188 private void setSelectedItem(Object item) { 198 189 selecting = true; 199 comboBox.setSelectedItem(item);190 AutoCompletingComboBox.this.setSelectedItem(item); 200 191 selecting = false; 201 192 } 202 193 203 194 private Object lookupItem(String pattern, boolean match) { 204 ComboBoxModel<AutoCompletionItem> model = comboBox.getModel();195 ComboBoxModel<AutoCompletionItem> model = getModel(); 205 196 AutoCompletionItem bestItem = null; 206 197 for (int i = 0, n = model.getSize(); i < n; i++) { … … 234 225 setRenderer(new AutoCompleteListCellRenderer()); 235 226 final JTextComponent editorComponent = this.getEditorComponent(); 236 editorComponent.setDocument(new AutoCompletingComboBoxDocument( this));227 editorComponent.setDocument(new AutoCompletingComboBoxDocument()); 237 228 editorComponent.addFocusListener(new InnerFocusListener(editorComponent)); 238 229 }
Note:
See TracChangeset
for help on using the changeset viewer.