com.quadrique.jbuildingblocks.gui
Class ActionBaseToggle
java.lang.Object
javax.swing.AbstractAction
com.quadrique.jbuildingblocks.gui.ActionBase
com.quadrique.jbuildingblocks.gui.ActionBaseToggle
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
public abstract class ActionBaseToggle
- extends ActionBase
This is the base class for an action that can be toggled on and off
The main additional functionality compared to ActionBase is that the action icon
is either a checked rectangle when the action is "on" (e.g. a window is displayed,
debug mode is active...) or an empty rectangle when it is "off".
- Author:
- Hervé Rivere
- See Also:
AbstractAction,
Action,
Serialized Form
| Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
|
Method Summary |
boolean |
isChecked()
|
void |
setIsChecked(boolean zIsChecked)
Set the current status and update accordingly the icon |
void |
toggleStatus()
to switch from "checked" to "unchecked" and vice -versa |
ActionBaseToggle
public ActionBaseToggle(String zActionName,
String zTooltipText,
boolean zIsChecked)
throws Exception
- constructor
- Parameters:
zActionName - the name of the actionzTooltipText - the tooltip text to use for this actionzIsChecked - true if the intial state of the action is "checked", false otherwise
- Throws:
Exception - if an error occurs- See Also:
Resources
isChecked
public boolean isChecked()
- Returns:
- true if the current status is "checked", false otherwise
setIsChecked
public void setIsChecked(boolean zIsChecked)
- Set the current status and update accordingly the icon
- Parameters:
zIsChecked - true if the checked icon is to be used, false otherwise
toggleStatus
public void toggleStatus()
- to switch from "checked" to "unchecked" and vice -versa
Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.