source: josm/trunk/src/org/openstreetmap/josm/actions/ExitAction.java@ 1084

Last change on this file since 1084 was 1084, checked in by framm, 15 years ago
  • cosmetics: rename ShortCut to Shortcut, and shortCut to shortcut
  • Property svn:eol-style set to native
File size: 815 bytes
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.KeyEvent;
8
9import org.openstreetmap.josm.Main;
10import org.openstreetmap.josm.tools.Shortcut;
11
12/**
13 * Exit the application. May ask for permission first (if something has changed).
14 *
15 * @author imi
16 */
17public class ExitAction extends JosmAction {
18 /**
19 * Construct the action with "Exit" as label
20 */
21 public ExitAction() {
22 super(tr("Exit"), "exit", tr("Exit the application."),
23 Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.GROUP_MENU), true);
24 }
25
26 public void actionPerformed(ActionEvent e) {
27 if (!Main.breakBecauseUnsavedChanges())
28 System.exit(0);
29 }
30}
Note: See TracBrowser for help on using the repository browser.