Ignore:
Timestamp:
2014-12-20T22:08:29+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #10470 - fix invalid recognition of items in AutoCompletionComboBox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java

    r7015 r7863  
    160160            JList<E> list = getList();
    161161            if (list != null) {
    162                 if (list.getPrototypeCellValue() != prototype) {
     162                if (!prototype.equals(list.getPrototypeCellValue())) {
    163163                    list.setPrototypeCellValue(prototype);
    164164                }
     
    197197
    198198        private void enableMenu() {
    199             if (launcher == null) {
    200                 if (editor != null) {
    201                     Component editorComponent = editor.getEditorComponent();
    202                     if (editorComponent instanceof JTextComponent) {
    203                         component = (JTextComponent) editorComponent;
    204                         component.addMouseListener(this);
    205                         launcher = TextContextualPopupMenu.enableMenuFor(component);
    206                     }
     199            if (launcher == null && editor != null) {
     200                Component editorComponent = editor.getEditorComponent();
     201                if (editorComponent instanceof JTextComponent) {
     202                    component = (JTextComponent) editorComponent;
     203                    component.addMouseListener(this);
     204                    launcher = TextContextualPopupMenu.enableMenuFor(component);
    207205                }
    208206            }
     
    229227
    230228        private void processEvent(MouseEvent e) {
    231             if (launcher != null && !e.isPopupTrigger()) {
    232                 if (launcher.getMenu().isShowing()) {
    233                     launcher.getMenu().setVisible(false);
    234                 }
     229            if (launcher != null && !e.isPopupTrigger() && launcher.getMenu().isShowing()) {
     230                launcher.getMenu().setVisible(false);
    235231            }
    236232        }
Note: See TracChangeset for help on using the changeset viewer.