001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.actions;
003
004import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
005import static org.openstreetmap.josm.tools.I18n.tr;
006
007import java.awt.event.ActionEvent;
008import java.awt.event.KeyEvent;
009
010import org.openstreetmap.josm.Main;
011import org.openstreetmap.josm.tools.Shortcut;
012
013/**
014 * Exit the application. May ask for permission first (if something has changed).
015 *
016 * @author imi
017 */
018public class ExitAction extends JosmAction {
019    /**
020     * Construct the action with "Exit" as label
021     */
022    public ExitAction() {
023        super(tr("Exit"), "exit", tr("Exit the application."),
024                Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.CTRL), true);
025        putValue("help", ht("/Action/Exit"));
026    }
027
028    @Override
029    public void actionPerformed(ActionEvent e) {
030        Main.exitJosm(true, 0, null);
031    }
032}