/*
* The contents of this file are subject to the
* Mozilla Public License Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights and
* limitations under the License.
*
* The Initial Developer of the Original Code is Simulacra Media Ltd.
* Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
*
* All Rights Reserved.
*
* Contributor(s):
*/
package org.openharmonise.him.actions;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JMenuItem;
import org.openharmonise.vfs.context.*;
/**
* Interface for all actions within Harmonise Information Manager.
*
* @author Matthew Large
* @version $Revision: 1.1 $
*
*/
public interface HIMAction {
/**
* Returns a button which will trigger this action.
*
* @return Button
*/
public JButton getButton();
/**
* Returns a menu item which will trigger this action.
*
* @return Menu item
*/
public JMenuItem getMenuItem();
/**
* Returns a description of the action.
*
* @return Description
*/
public String getDescription();
/**
* Returns a name of the action.
*
* @return Name
*/
public String getText();
/**
* Returns some tooltip text for the action.
*
* @return Tooltip text
*/
public String getToolTip();
/**
* Returns an icon for the action.
*
* @return Icon
*/
public Icon getIcon();
/**
* Returns the accelerator key code for the action.
*
* @return Accelerator key code
*/
public int getAcceleratorKeycode();
/**
* Returns the accelerator mask for the action.
*
* @return Accelerator mask
*/
public int getAcceleratorMask();
/**
* Returns the mnemonic for the action.
*
* @return Mnemonic
*/
public String getMnemonic();
/**
* Checks if an action, and therefore its buttons and menu items,
* is enabled. This is based on the file that the action is
* focuesed on, the context and the enable rules.
*
* @param ce Context event to check against
* @return true if the action is enabled
*/
public boolean isEnabled(ContextEvent ce);
/**
* Sets whether the action is enabled or not.
*
* @param bEnabled true to set the action to be enabled
*/
public void setEnabled(boolean bEnabled);
}
|