Changeset 10720 in josm


Ignore:
Timestamp:
2016-08-03T17:52:18+02:00 (4 years ago)
Author:
simon04
Message:

Close bug report dialog with escape

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportDialog.java

    r10649 r10720  
    88import java.awt.GridBagConstraints;
    99import java.awt.GridBagLayout;
    10 
     10import java.awt.event.ActionEvent;
     11import java.awt.event.KeyEvent;
     12
     13import javax.swing.AbstractAction;
    1114import javax.swing.BorderFactory;
    1215import javax.swing.Icon;
    1316import javax.swing.JButton;
    1417import javax.swing.JCheckBox;
     18import javax.swing.JComponent;
    1519import javax.swing.JDialog;
    1620import javax.swing.JLabel;
    1721import javax.swing.JPanel;
     22import javax.swing.KeyStroke;
    1823import javax.swing.UIManager;
    1924
     
    6671        setModal(true);
    6772        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
     73
     74        getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "escape");
     75        getRootPane().getActionMap().put("escape", new AbstractAction() {
     76            @Override
     77            public void actionPerformed(ActionEvent e) {
     78                closeDialog();
     79            }
     80        });
    6881    }
    6982
Note: See TracChangeset for help on using the changeset viewer.