| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.actions;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
|---|
| 5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 6 |
|
|---|
| 7 | import java.awt.event.ActionEvent;
|
|---|
| 8 | import java.awt.event.KeyEvent;
|
|---|
| 9 |
|
|---|
| 10 | import org.openstreetmap.josm.gui.MainApplication;
|
|---|
| 11 | import 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 | */
|
|---|
| 18 | public 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("File: {0}", tr("Exit")), KeyEvent.VK_Q, Shortcut.CTRL), true, false);
|
|---|
| 25 | setHelpId(ht("/Action/Exit"));
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | @Override
|
|---|
| 29 | public void actionPerformed(ActionEvent e) {
|
|---|
| 30 | MainApplication.exitJosm(true, 0, null);
|
|---|
| 31 | }
|
|---|
| 32 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.