KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > HIMAction


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;
20
21 import javax.swing.Icon JavaDoc;
22 import javax.swing.JButton JavaDoc;
23 import javax.swing.JMenuItem JavaDoc;
24
25 import org.openharmonise.vfs.context.*;
26
27
28 /**
29  * Interface for all actions within Harmonise Information Manager.
30  *
31  * @author Matthew Large
32  * @version $Revision: 1.1 $
33  *
34  */

35 public interface HIMAction {
36     
37     /**
38      * Returns a button which will trigger this action.
39      *
40      * @return Button
41      */

42     public JButton JavaDoc getButton();
43     
44     /**
45      * Returns a menu item which will trigger this action.
46      *
47      * @return Menu item
48      */

49     public JMenuItem JavaDoc getMenuItem();
50     
51     /**
52      * Returns a description of the action.
53      *
54      * @return Description
55      */

56     public String JavaDoc getDescription();
57     
58     /**
59      * Returns a name of the action.
60      *
61      * @return Name
62      */

63     public String JavaDoc getText();
64     
65     /**
66      * Returns some tooltip text for the action.
67      *
68      * @return Tooltip text
69      */

70     public String JavaDoc getToolTip();
71     
72     /**
73      * Returns an icon for the action.
74      *
75      * @return Icon
76      */

77     public Icon JavaDoc getIcon();
78     
79     /**
80      * Returns the accelerator key code for the action.
81      *
82      * @return Accelerator key code
83      */

84     public int getAcceleratorKeycode();
85     
86     /**
87      * Returns the accelerator mask for the action.
88      *
89      * @return Accelerator mask
90      */

91     public int getAcceleratorMask();
92     
93     /**
94      * Returns the mnemonic for the action.
95      *
96      * @return Mnemonic
97      */

98     public String JavaDoc getMnemonic();
99     
100     /**
101      * Checks if an action, and therefore its buttons and menu items,
102      * is enabled. This is based on the file that the action is
103      * focuesed on, the context and the enable rules.
104      *
105      * @param ce Context event to check against
106      * @return true if the action is enabled
107      */

108     public boolean isEnabled(ContextEvent ce);
109     
110     /**
111      * Sets whether the action is enabled or not.
112      *
113      * @param bEnabled true to set the action to be enabled
114      */

115     public void setEnabled(boolean bEnabled);
116     
117 }
118
Popular Tags