Package org.moeaframework.util.mvc
Class ToggleAction
java.lang.Object
javax.swing.AbstractAction
org.moeaframework.util.mvc.LocalizedAction
org.moeaframework.util.mvc.ToggleAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,SettingChangedListener
Action backed by a
Toggle setting. GUI components based on this action are typically represented by a
check box.- 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
ConstructorsConstructorDescriptionToggleAction(String id, Localization localization, Toggle toggle) Constructs a new 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
-
ToggleAction
Constructs a new 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
-