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 submit all changes.
032: *
033: * @author Matthew Large
034: * @version $Revision: 1.1 $
035: *
036: */
037: public class ActionExitCommit extends AbstractHIMAction implements
038: HIMAction {
039:
040: /**
041: *
042: */
043: public ActionExitCommit() {
044: super ();
045: }
046:
047: /**
048: * @param vfFile
049: */
050: public ActionExitCommit(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(
059: ContextType.CONTEXT_SYNC_ALL_FILES_AND_SHUTDOWN,
060: "FORCE_SYNC");
061: ContextHandler.getInstance().fireContextEvent(ce);
062: }
063:
064: /* (non-Javadoc)
065: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
066: */
067: public String getDescription() {
068: return "Closes the application and synchronises, all uncommited, changes to the server";
069: }
070:
071: /* (non-Javadoc)
072: * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
073: */
074: public String getText() {
075: return "Exit & commit changes";
076: }
077:
078: /* (non-Javadoc)
079: * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
080: */
081: public String getToolTip() {
082: return this .getDescription();
083: }
084:
085: /* (non-Javadoc)
086: * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
087: */
088: public Icon getIcon() {
089: return IconManager.getInstance().getIcon("16-blank.gif");
090: }
091:
092: /* (non-Javadoc)
093: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
094: */
095: public int getAcceleratorKeycode() {
096: return 0;
097: }
098:
099: /* (non-Javadoc)
100: * @see com.simulacramedia.contentmanager.actions.CMAction#getMnemonic()
101: */
102: public String getMnemonic() {
103: return "x";
104: }
105:
106: /* (non-Javadoc)
107: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
108: */
109: public int getAcceleratorMask() {
110: return 0;
111: }
112:
113: }
|