KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > actions > ActionBase


1 package org.enhydra.jawe.actions;
2
3 import javax.swing.AbstractAction JavaDoc;
4 import javax.swing.Action JavaDoc;
5 import javax.swing.Icon JavaDoc;
6
7 import org.enhydra.jawe.*;
8
9 /**
10 * The base class for JaWE actions.
11 */

12 public abstract class ActionBase
13    extends AbstractAction JavaDoc {
14
15    /**
16     * A reference to the editor class.
17     */

18    protected AbstractEditor editor;
19
20    /**
21     * The Abstract action uses unqualified class name as action name.
22     *
23     * @param editor The reference to the editor for this action
24     */

25    public ActionBase(AbstractEditor editor) {
26       this.editor = editor;
27       putValue(Action.NAME,Utils.getUnqualifiedClassName(getClass()));
28    }
29
30    /**
31     * Constructor which accepts the action name.
32     *
33     * @param editor The reference to the editor for this action
34     * @param name Name of this action
35     */

36
37    public ActionBase(AbstractEditor editor, String JavaDoc name) {
38       super(name);
39       this.editor = editor;
40    }
41
42 }
43
Popular Tags