001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.him.actions.system;
020:
021: import java.awt.event.*;
022:
023: import javax.swing.*;
024:
025: import org.openharmonise.him.actions.*;
026: import org.openharmonise.vfs.*;
027: import org.openharmonise.vfs.context.*;
028: import org.openharmonise.vfs.gui.*;
029:
030: /**
031: * Action to exit and discard all changes.
032: *
033: * @author Matthew Large
034: * @version $Revision: 1.1 $
035: *
036: */
037: public class ActionExitReject extends AbstractHIMAction implements
038: HIMAction {
039:
040: /**
041: *
042: */
043: public ActionExitReject() {
044: super ();
045: }
046:
047: /**
048: * @param vfFile
049: */
050: public ActionExitReject(VirtualFile vfFile) {
051: super (vfFile);
052: }
053:
054: /* (non-Javadoc)
055: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
056: */
057: public void actionPerformed(ActionEvent arg0) {
058: ContextEvent ce = new ContextEvent(ContextType.CONTEXT_SHUTDOWN);
059: ContextHandler.getInstance().fireContextEvent(ce);
060: }
061:
062: /* (non-Javadoc)
063: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
064: */
065: public String getDescription() {
066: return "Closes the application and rejects, all uncommited, changes";
067: }
068:
069: /* (non-Javadoc)
070: * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
071: */
072: public String getText() {
073: return "Exit & reject changes";
074: }
075:
076: /* (non-Javadoc)
077: * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
078: */
079: public String getToolTip() {
080: return this .getDescription();
081: }
082:
083: /* (non-Javadoc)
084: * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
085: */
086: public Icon getIcon() {
087: return IconManager.getInstance().getIcon("16-blank.gif");
088: }
089:
090: /* (non-Javadoc)
091: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
092: */
093: public int getAcceleratorKeycode() {
094: return 0;
095: }
096:
097: /* (non-Javadoc)
098: * @see com.simulacramedia.contentmanager.actions.CMAction#getMnemonic()
099: */
100: public String 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: }
|