KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > messages > ActionClear


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.messages;
20
21 import java.awt.event.ActionEvent JavaDoc;
22
23 import javax.swing.Icon JavaDoc;
24
25 import org.openharmonise.him.actions.*;
26 import org.openharmonise.him.window.messages.*;
27 import org.openharmonise.vfs.*;
28 import org.openharmonise.vfs.gui.*;
29
30
31 /**
32  * Action to clear the console window.
33  *
34  * @author Matthew Large
35  * @version $Revision: 1.1 $
36  *
37  */

38 public class ActionClear extends AbstractHIMAction implements HIMAction {
39
40     /**
41      * The console window.
42      */

43     private MessageWindow m_msgWindow = null;
44
45     /**
46      *
47      */

48     public ActionClear(MessageWindow msgWindow) {
49         super();
50         this.m_msgWindow = msgWindow;
51     }
52
53     /**
54      * @param vfFile
55      */

56     private ActionClear(VirtualFile vfFile) {
57         super(vfFile);
58     }
59
60     /* (non-Javadoc)
61      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
62      */

63     public void actionPerformed(ActionEvent JavaDoc arg0) {
64         this.m_msgWindow.clear();
65     }
66
67     /* (non-Javadoc)
68      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
69      */

70     public String JavaDoc getText() {
71         return "Clear";
72     }
73
74     /* (non-Javadoc)
75      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
76      */

77     public String JavaDoc getToolTip() {
78         return "Clears the previous messages";
79     }
80
81     /* (non-Javadoc)
82      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
83      */

84     public Icon JavaDoc getIcon() {
85         return IconManager.getInstance().getIcon("16-command-exit.gif");
86     }
87
88     /* (non-Javadoc)
89      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getMnemonic()
90      */

91     public String JavaDoc getMnemonic() {
92         return "C";
93     }
94
95     /* (non-Javadoc)
96      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
97      */

98     public String JavaDoc getDescription() {
99         return "Clears the previous messages";
100     }
101
102     /* (non-Javadoc)
103      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
104      */

105     public int getAcceleratorKeycode() {
106         return 0;
107     }
108
109     /* (non-Javadoc)
110      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
111      */

112     public int getAcceleratorMask() {
113         return 0;
114     }
115
116 }
117
Popular Tags