KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > system > ActionExitReject


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.him.actions.system;
20
21 import java.awt.event.*;
22
23 import javax.swing.*;
24
25 import org.openharmonise.him.actions.*;
26 import org.openharmonise.vfs.*;
27 import org.openharmonise.vfs.context.*;
28 import org.openharmonise.vfs.gui.*;
29
30
31 /**
32  * Action to exit and discard all changes.
33  *
34  * @author Matthew Large
35  * @version $Revision: 1.1 $
36  *
37  */

38 public class ActionExitReject extends AbstractHIMAction implements HIMAction {
39
40     /**
41      *
42      */

43     public ActionExitReject() {
44         super();
45     }
46
47     /**
48      * @param vfFile
49      */

50     public ActionExitReject(VirtualFile vfFile) {
51         super(vfFile);
52     }
53
54     /* (non-Javadoc)
55      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
56      */

57     public void actionPerformed(ActionEvent arg0) {
58         ContextEvent ce = new ContextEvent(ContextType.CONTEXT_SHUTDOWN);
59         ContextHandler.getInstance().fireContextEvent(ce);
60     }
61
62     /* (non-Javadoc)
63      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
64      */

65     public String JavaDoc getDescription() {
66         return "Closes the application and rejects, all uncommited, changes";
67     }
68
69     /* (non-Javadoc)
70      * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
71      */

72     public String JavaDoc getText() {
73         return "Exit & reject changes";
74     }
75
76     /* (non-Javadoc)
77      * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
78      */

79     public String JavaDoc getToolTip() {
80         return this.getDescription();
81     }
82
83     /* (non-Javadoc)
84      * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
85      */

86     public Icon getIcon() {
87         return IconManager.getInstance().getIcon("16-blank.gif");
88     }
89
90     /* (non-Javadoc)
91      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
92      */

93     public int getAcceleratorKeycode() {
94         return 0;
95     }
96
97     /* (non-Javadoc)
98      * @see com.simulacramedia.contentmanager.actions.CMAction#getMnemonic()
99      */

100     public String JavaDoc getMnemonic() {
101         return "E";
102     }
103
104     /* (non-Javadoc)
105      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
106      */

107     public int getAcceleratorMask() {
108         return 0;
109     }
110
111 }
112
Popular Tags