Ignore:
Timestamp:
2016-08-12T21:08:00+02:00 (3 years ago)
Author:
simon04
Message:

see #13319 - Use InputMapUtils where applicable (VK_ESCAPE)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java

    r10481 r10791  
    99import java.awt.FlowLayout;
    1010import java.awt.event.ActionEvent;
    11 import java.awt.event.KeyEvent;
    1211import java.awt.event.WindowAdapter;
    1312import java.awt.event.WindowEvent;
     
    1514import javax.swing.AbstractAction;
    1615import javax.swing.JButton;
    17 import javax.swing.JComponent;
    1816import javax.swing.JDialog;
    1917import javax.swing.JLabel;
    2018import javax.swing.JPanel;
    21 import javax.swing.KeyStroke;
    2219
    2320import org.openstreetmap.josm.Main;
     
    3027import org.openstreetmap.josm.gui.util.GuiHelper;
    3128import org.openstreetmap.josm.tools.ImageProvider;
     29import org.openstreetmap.josm.tools.InputMapUtils;
    3230
    3331/**
     
    107105        btn = new JButton(closeAction);
    108106        final String closeHistoryBrowserDialogKey = "CloseHistoryBrowserDialog";
    109         KeyStroke escapeKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
    110         getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(escapeKey, closeHistoryBrowserDialogKey);
    111         getRootPane().getActionMap().put(closeHistoryBrowserDialogKey, closeAction);
    112107        btn.setName("btn.close");
    113108        pnl.add(btn);
     109        InputMapUtils.addEscapeAction(getRootPane(), closeAction);
    114110
    115111        btn = new JButton(new ContextSensitiveHelpAction(ht("/Action/ObjectHistory")));
Note: See TracChangeset for help on using the changeset viewer.