KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > core > gui > action > AbstractColumbaAction


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14
//
15
//All Rights Reserved.
16
package org.columba.core.gui.action;
17
18 import javax.swing.AbstractAction JavaDoc;
19
20 import org.columba.api.gui.IAbstractColumbaAction;
21 import org.columba.api.gui.frame.IFrameMediator;
22 import org.columba.api.plugin.IExtensionInterface;
23
24
25 /**
26  * AbstractColumbaAction extends the Swing Action API providing
27  * more action properties. It maintains a reference to the action's
28  * parent frame. Every action should subclass this class
29  * implementing the actionPerformed(ActionEvent) method. Action
30  * properties can be accessed using the getValue(String) and
31  * putValue(String, Object) methods, just as it is handled in
32  * Swing.
33  *
34  * @author fdietz
35  */

36
37 public abstract class AbstractColumbaAction extends AbstractAction JavaDoc
38     implements IExtensionInterface, IAbstractColumbaAction {
39     /**
40      * show button text in toolbar
41      */

42     protected boolean showToolbarText = true;
43     protected IFrameMediator frameMediator;
44
45     /**
46      *
47      * default constructor
48      *
49      * @param frameMediator frame controller
50      * @param name i18n name
51      *
52      */

53     public AbstractColumbaAction(IFrameMediator frameMediator, String JavaDoc name) {
54         super(name);
55         this.frameMediator = frameMediator;
56     }
57
58     /**
59      * {@inheritDoc}
60      */

61     public IFrameMediator getFrameMediator() {
62         return frameMediator;
63     }
64
65     /**
66      * {@inheritDoc}
67      */

68     public void setFrameMediator(IFrameMediator frameController) {
69         this.frameMediator = frameController;
70     }
71
72     /**
73      * {@inheritDoc}
74      */

75     public boolean isShowToolBarText() {
76         return showToolbarText;
77     }
78
79     /**
80      * {@inheritDoc}
81      */

82     public void setShowToolBarText(boolean showToolbarText) {
83         if (this.showToolbarText != showToolbarText) {
84             Boolean JavaDoc oldValue = this.showToolbarText ? Boolean.TRUE : Boolean.FALSE;
85             this.showToolbarText = showToolbarText;
86             firePropertyChange("showToolBarText", oldValue,
87                 showToolbarText ? Boolean.TRUE : Boolean.FALSE);
88         }
89     }
90 }
91
Popular Tags