Package org.moeaframework.util.mvc
Class InvertedToggleAction
java.lang.Object
javax.swing.AbstractAction
org.moeaframework.util.mvc.LocalizedAction
org.moeaframework.util.mvc.InvertedToggleAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,SettingChangedListener
The inverse of a
ToggleAction
. If the original toggle would be checked, the inverted toggle is unchecked
(and vice versa).- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
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
ConstructorDescriptionInvertedToggleAction
(String id, Localization localization, Toggle toggle) Constructs a new inverted toggle action. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Called when the value of a setting changed.Convenience method to create aJMenuItem
based on this action.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
InvertedToggleAction
Constructs a new inverted toggle action.- Parameters:
id
- the id for localizationlocalization
- the source for localization stringstoggle
- the underlying toggle setting
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
settingChanged
Description copied from interface:SettingChangedListener
Called when the value of a setting changed.- Specified by:
settingChanged
in interfaceSettingChangedListener
- Parameters:
event
- details of the change
-
toMenuItem
Convenience method to create aJMenuItem
based on this action.- Returns:
- the menu item
-