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.messages;
020:
021: import java.awt.event.ActionEvent;
022:
023: import javax.swing.Icon;
024:
025: import org.openharmonise.him.actions.*;
026: import org.openharmonise.him.window.messages.*;
027: import org.openharmonise.vfs.*;
028: import org.openharmonise.vfs.gui.*;
029:
030: /**
031: * Action to clear the console window.
032: *
033: * @author Matthew Large
034: * @version $Revision: 1.1 $
035: *
036: */
037: public class ActionClear extends AbstractHIMAction implements HIMAction {
038:
039: /**
040: * The console window.
041: */
042: private MessageWindow m_msgWindow = null;
043:
044: /**
045: *
046: */
047: public ActionClear(MessageWindow msgWindow) {
048: super ();
049: this .m_msgWindow = msgWindow;
050: }
051:
052: /**
053: * @param vfFile
054: */
055: private ActionClear(VirtualFile vfFile) {
056: super (vfFile);
057: }
058:
059: /* (non-Javadoc)
060: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
061: */
062: public void actionPerformed(ActionEvent arg0) {
063: this .m_msgWindow.clear();
064: }
065:
066: /* (non-Javadoc)
067: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
068: */
069: public String getText() {
070: return "Clear";
071: }
072:
073: /* (non-Javadoc)
074: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
075: */
076: public String getToolTip() {
077: return "Clears the previous messages";
078: }
079:
080: /* (non-Javadoc)
081: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
082: */
083: public Icon getIcon() {
084: return IconManager.getInstance().getIcon("16-command-exit.gif");
085: }
086:
087: /* (non-Javadoc)
088: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getMnemonic()
089: */
090: public String getMnemonic() {
091: return "C";
092: }
093:
094: /* (non-Javadoc)
095: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
096: */
097: public String getDescription() {
098: return "Clears the previous messages";
099: }
100:
101: /* (non-Javadoc)
102: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
103: */
104: public int getAcceleratorKeycode() {
105: return 0;
106: }
107:
108: /* (non-Javadoc)
109: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
110: */
111: public int getAcceleratorMask() {
112: return 0;
113: }
114:
115: }
|