| 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 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.