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

Last change on this file since 2683 was 2323, checked in by Gubaer, 14 years ago

Added explicit help topics
See also current list of help topics with links to source files and to help pages

  • Property svn:eol-style set to native
File size: 1.0 KB
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;
5import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.tools.Shortcut;
12
13/**
14 * Exit the application. May ask for permission first (if something has changed).
15 *
16 * @author imi
17 */
18public class ExitAction extends JosmAction {
19 /**
20 * Construct the action with "Exit" as label
21 */
22 public ExitAction() {
23 super(tr("Exit"), "exit", tr("Exit the application."),
24 Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.GROUP_MENU), true);
25 putValue("help", ht("/Action/Exit"));
26 }
27
28 public void actionPerformed(ActionEvent e) {
29 if (Main.saveUnsavedModifications()) {
30 Main.saveGuiGeometry();
31 Main.cleanupBeforeExit();
32 System.exit(0);
33 }
34 }
35}
Note: See TracBrowser for help on using the repository browser.