Last change
on this file since 1023 was 1023, checked in by stoecker, 16 years ago |
close bug #1622. Keyboard shortcuts and specific OS handling
|
-
Property svn:eol-style
set to
native
|
File size:
820 bytes
|
Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 | import java.awt.event.KeyEvent;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.Main;
|
---|
10 | import 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 | */
|
---|
17 | public 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("Quit JOSM"), 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.