Changeset 5424 in josm for trunk/src/org


Ignore:
Timestamp:
2012-08-11T18:49:02+02:00 (12 years ago)
Author:
Don-vip
Message:

see #7671, see #7951 - incorrect contents of value combobox when clicking on a "Recently added tags"

File:
1 edited

Legend:

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

    r5385 r5424  
    532532            }
    533533        }
    534        
     534
     535        FocusAdapter focus = addFocusAdapter(-1, keys, values, autocomplete, defaultACItemComparator);
     536        // fire focus event in advance or otherwise the popup list will be too small at first
     537        focus.focusGained(null);
     538
    535539        int recentTagsToShow = Main.pref.getInteger("properties.recently-added-tags", DEFAULT_LRU_TAGS_NUMBER);
    536540        if (recentTagsToShow > MAX_LRU_TAGS_NUMBER) {
     
    538542        }
    539543        List<JosmAction> recentTagsActions = new ArrayList<JosmAction>();
    540         suggestRecentlyAddedTags(p, keys, values, recentTagsActions, recentTagsToShow);
    541 
    542         FocusAdapter focus = addFocusAdapter(-1, keys, values, autocomplete, defaultACItemComparator);
    543         // fire focus event in advance or otherwise the popup list will be too small at first
    544         focus.focusGained(null);
     544        suggestRecentlyAddedTags(p, keys, values, recentTagsActions, recentTagsToShow, focus);
    545545
    546546        JOptionPane pane = new JOptionPane(p, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
     
    580580    }
    581581   
    582     private void suggestRecentlyAddedTags(JPanel p, final AutoCompletingComboBox keys, final AutoCompletingComboBox values, List<JosmAction> tagsActions, int tagsToShow) {
     582    private void suggestRecentlyAddedTags(JPanel p, final AutoCompletingComboBox keys, final AutoCompletingComboBox values, List<JosmAction> tagsActions, int tagsToShow, final FocusAdapter focus) {
    583583        if (tagsToShow > 0 && !recentTags.isEmpty()) {
    584584            p.add(new JLabel(tr("Recently added tags")), GBC.eol());
     
    607607                        keys.getEditor().setItem(t.getKey());
    608608                        values.getEditor().setItem(t.getValue());
     609                        // Update list of values (fix #7951)
     610                        focus.focusGained(null);
    609611                    }
    610612                };
Note: See TracChangeset for help on using the changeset viewer.