001    // License: GPL. Copyright 2007 by Immanuel Scholz and others
002    package org.openstreetmap.josm.actions;
003    
004    import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
005    import static org.openstreetmap.josm.tools.I18n.tr;
006    
007    import java.awt.event.ActionEvent;
008    import java.awt.event.KeyEvent;
009    
010    import org.openstreetmap.josm.Main;
011    import 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     */
018    public 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        public void actionPerformed(ActionEvent e) {
029            Main.exitJosm(true);
030        }
031    }