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;
020:
021: import javax.swing.Icon;
022: import javax.swing.JButton;
023: import javax.swing.JMenuItem;
024:
025: import org.openharmonise.vfs.context.*;
026:
027: /**
028: * Interface for all actions within Harmonise Information Manager.
029: *
030: * @author Matthew Large
031: * @version $Revision: 1.1 $
032: *
033: */
034: public interface HIMAction {
035:
036: /**
037: * Returns a button which will trigger this action.
038: *
039: * @return Button
040: */
041: public JButton getButton();
042:
043: /**
044: * Returns a menu item which will trigger this action.
045: *
046: * @return Menu item
047: */
048: public JMenuItem getMenuItem();
049:
050: /**
051: * Returns a description of the action.
052: *
053: * @return Description
054: */
055: public String getDescription();
056:
057: /**
058: * Returns a name of the action.
059: *
060: * @return Name
061: */
062: public String getText();
063:
064: /**
065: * Returns some tooltip text for the action.
066: *
067: * @return Tooltip text
068: */
069: public String getToolTip();
070:
071: /**
072: * Returns an icon for the action.
073: *
074: * @return Icon
075: */
076: public Icon getIcon();
077:
078: /**
079: * Returns the accelerator key code for the action.
080: *
081: * @return Accelerator key code
082: */
083: public int getAcceleratorKeycode();
084:
085: /**
086: * Returns the accelerator mask for the action.
087: *
088: * @return Accelerator mask
089: */
090: public int getAcceleratorMask();
091:
092: /**
093: * Returns the mnemonic for the action.
094: *
095: * @return Mnemonic
096: */
097: public String getMnemonic();
098:
099: /**
100: * Checks if an action, and therefore its buttons and menu items,
101: * is enabled. This is based on the file that the action is
102: * focuesed on, the context and the enable rules.
103: *
104: * @param ce Context event to check against
105: * @return true if the action is enabled
106: */
107: public boolean isEnabled(ContextEvent ce);
108:
109: /**
110: * Sets whether the action is enabled or not.
111: *
112: * @param bEnabled true to set the action to be enabled
113: */
114: public void setEnabled(boolean bEnabled);
115:
116: }
|