|
Revision 1, 0.6 KB
(checked in by imi, 5 years ago)
|
|
wiki 19:37, 27. Sep 2005
|
| Line | |
|---|
| 1 | package org.openstreetmap.josm.actions; |
|---|
| 2 | |
|---|
| 3 | import java.awt.event.ActionEvent; |
|---|
| 4 | import java.awt.event.KeyEvent; |
|---|
| 5 | |
|---|
| 6 | import javax.swing.AbstractAction; |
|---|
| 7 | import javax.swing.ImageIcon; |
|---|
| 8 | |
|---|
| 9 | /** |
|---|
| 10 | * Exit the application. May ask for permition first (if something has changed). |
|---|
| 11 | * |
|---|
| 12 | * @author imi |
|---|
| 13 | */ |
|---|
| 14 | public class ExitAction extends AbstractAction { |
|---|
| 15 | |
|---|
| 16 | /** |
|---|
| 17 | * Construct the action with "Exit" as label |
|---|
| 18 | */ |
|---|
| 19 | public ExitAction() { |
|---|
| 20 | super("Exit", new ImageIcon("images/exit.png")); |
|---|
| 21 | putValue(MNEMONIC_KEY, KeyEvent.VK_X); |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | public void actionPerformed(ActionEvent e) { |
|---|
| 25 | // todo: check for modified windows before exiting |
|---|
| 26 | System.exit(0); |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | } |
|---|