package ie.dcu.apps.ist.actions;
import org.eclipse.jface.action.*;
import org.eclipse.jface.resource.*;
/**
* Default implementation of {@link IHoverAction}.
*
* @author Kevin McGuinness
*/
public class HoverAction extends Action implements IHoverAction {
private boolean armed = false;
/**
* Creates a new action with no text and no image. Configure the action later
* using the set methods.
*/
public HoverAction() {
super();
}
/**
* Creates a new action with the given text and no image.
*
* @param text
* the string used as the text for the action, or null
* if there is no text
*/
public HoverAction(String text) {
super(text);
}
/**
* Creates a new action with the given text and image.
*
* @param text
* the action's text, or null if there is no text
* @param image
* the action's image, or null if there is no image
*/
public HoverAction(String text, ImageDescriptor image) {
super(text, image);
}
/**
* Creates a new action with the given text and style.
*
* @param text
* the action's text, or null if there is no text.
* @param style
* one of
* AS_PUSH_BUTTON,
* AS_CHECK_BOX,
* AS_DROP_DOWN_MENU,
* AS_RADIO_BUTTON, and
* AS_UNSPECIFIED.
*/
public HoverAction(String text, int style) {
super(text, style);
}
/**
* Sets the armed property to true.
*/
public void arm() {
armed = true;
}
/**
* Sets the armed property to false.
*/
public void disarm() {
armed = false;
}
/**
* Returns true if armed.
*/
public boolean isArmed() {
return armed;
}
}