Package org.jjazz.utilities.api
Class ToggleAction
java.lang.Object
javax.swing.AbstractAction
org.jjazz.utilities.api.ToggleAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
An Action which can be selected or not.
The Action.SELECTED_KEY property value represents the selected state.
The selected icon is stored in the Action.LARGE_ICON_KEY property.
- See Also:
-
Field Summary
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 -
Constructor Summary
ConstructorsConstructorDescriptionCreate a non selected action.ToggleAction(boolean selected) Create a selected or non-selected action. -
Method Summary
Modifier and TypeMethodDescriptionvoidDefault implementation just toggles the selected state.booleanvoidsetSelected(boolean b) voidsetSelectedIcon(Icon icon) Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
ToggleAction
public ToggleAction()Create a non selected action. -
ToggleAction
public ToggleAction(boolean selected) Create a selected or non-selected action.- Parameters:
selected-
-
-
Method Details
-
actionPerformed
Default implementation just toggles the selected state.- Parameters:
ae-
-
setSelected
public void setSelected(boolean b) -
isSelected
public boolean isSelected() -
setSelectedIcon
-
getSelectedIcon
-