Ignore:
Timestamp:
2016-12-08T00:54:43+01:00 (7 years ago)
Author:
Don-vip
Message:

findbugs - SIC_INNER_SHOULD_BE_STATIC_ANON

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

    r11288 r11366  
    131131    public void setHistoryComboBoxDownFocusTraversalHandler(final Action handler, final HistoryComboBox hcb) {
    132132        hcb.getEditor().addActionListener(handler);
    133         hcb.getEditorComponent().addKeyListener(
    134                 new KeyAdapter() {
    135                     @Override
    136                     public void keyTyped(KeyEvent e) {
    137                         if (e.getKeyCode() == KeyEvent.VK_TAB) {
    138                             handler.actionPerformed(new ActionEvent(hcb, 0, "focusDown"));
    139                         }
    140                     }
    141                 }
    142         );
     133        hcb.getEditorComponent().addKeyListener(new HistoryComboBoxKeyAdapter(hcb, handler));
    143134    }
    144135
     
    184175    }
    185176
     177    static final class HistoryComboBoxKeyAdapter extends KeyAdapter {
     178        private final HistoryComboBox hcb;
     179        private final Action handler;
     180
     181        HistoryComboBoxKeyAdapter(HistoryComboBox hcb, Action handler) {
     182            this.hcb = hcb;
     183            this.handler = handler;
     184        }
     185
     186        @Override
     187        public void keyTyped(KeyEvent e) {
     188            if (e.getKeyCode() == KeyEvent.VK_TAB) {
     189                handler.actionPerformed(new ActionEvent(hcb, 0, "focusDown"));
     190            }
     191        }
     192    }
     193
    186194    /**
    187195     * Updates the changeset comment model upon changes in the input field.
Note: See TracChangeset for help on using the changeset viewer.