Changeset 13139 in josm


Ignore:
Timestamp:
2017-11-20T23:50:18+01:00 (4 weeks ago)
Author:
Don-vip
Message:

fix #13747 - do not select all characters from a combobox when switching between JOSM and another application

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r12859 r13139  
    635635               @Override
    636636               public void focusGained(FocusEvent e) {
     637                   Logging.trace("Focus gained by {0}, e={1}", values, e);
    637638                   String key = keys.getEditor().getItem().toString();
    638 
    639                    List<AutoCompletionItem> valueList = autocomplete.getTagValues(getAutocompletionKeys(key), comparator);
    640                    Logging.trace("Focus gained by {0}, e={1}", values, e);
    641                    values.setPossibleAcItems(valueList);
    642                    values.getEditor().selectAll();
    643                    objKey = key;
     639                   if (!Objects.equals(key, objKey)) {
     640                       values.setPossibleAcItems(autocomplete.getTagValues(getAutocompletionKeys(key), comparator));
     641                       values.getEditor().selectAll();
     642                       objKey = key;
     643                   }
    644644               }
    645645           };
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r12859 r13139  
    7676                    sysSel.setContents(old, null);
    7777                }
    78             } else {
     78            } else if (e != null && e.getOppositeComponent() != null) {
     79                // Select all characters when the change of focus occurs inside JOSM only.
     80                // When switching from another application, it is annoying, see #13747
    7981                editorComponent.selectAll();
    8082            }
Note: See TracChangeset for help on using the changeset viewer.