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, enabledFields 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
ConstructorsConstructorDescriptionInvertedToggleAction(String id, Localization localization, Toggle toggle) Constructs a new inverted toggle action. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCalled when the value of a setting changed.Convenience method to create aJMenuItembased 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:
actionPerformedin interfaceActionListener
-
settingChanged
Description copied from interface:SettingChangedListenerCalled when the value of a setting changed.- Specified by:
settingChangedin interfaceSettingChangedListener- Parameters:
event- details of the change
-
toMenuItem
Convenience method to create aJMenuItembased on this action.- Returns:
- the menu item
-