1 | |
package org.jtheque.core.managers.view.impl.actions.core; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
import org.jtheque.core.managers.Managers; |
20 | |
import org.jtheque.core.managers.core.Core; |
21 | |
import org.jtheque.core.managers.resource.IResourceManager; |
22 | |
import org.jtheque.core.managers.resource.ImageType; |
23 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
24 | |
|
25 | |
import javax.swing.Action; |
26 | |
import javax.swing.KeyStroke; |
27 | |
import java.awt.Toolkit; |
28 | |
import java.awt.event.ActionEvent; |
29 | |
import java.awt.event.KeyEvent; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
public final class ExitAction extends JThequeAction { |
37 | |
|
38 | |
|
39 | |
|
40 | |
public ExitAction() { |
41 | 0 | super("menu.exit", Managers.getCore().getApplication().getName()); |
42 | |
|
43 | 0 | putValue(Action.ACCELERATOR_KEY, |
44 | |
KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); |
45 | |
|
46 | 0 | setIcon(Managers.getManager(IResourceManager.class).getIcon(Core.IMAGES_BASE_NAME, "exit", ImageType.PNG)); |
47 | 0 | } |
48 | |
|
49 | |
@Override |
50 | |
public void actionPerformed(ActionEvent arg0) { |
51 | 0 | Managers.getCore().getLifeCycleManager().exit(); |
52 | 0 | } |
53 | |
} |