Package org.eclipse.jface.commands
Class ToggleState
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.State
org.eclipse.jface.commands.PersistentState
org.eclipse.jface.commands.ToggleState
- Direct Known Subclasses:
RadioState,RegistryToggleState
A piece of state storing a Boolean.
If this state is registered using IMenuStateIds.STYLE, then it will
control the presentation of the command if displayed in the menus, tool bars
or status line.
Clients may instantiate this class, but must not extend.
- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidload(IPreferenceStore store, String preferenceKey) Loads this state from the preference store, given the location at which to look.final voidsave(IPreferenceStore store, String preferenceKey) Saves this state to the preference store, given the location at which to write.voidSets the value for this state object.Methods inherited from class org.eclipse.jface.commands.PersistentState
setShouldPersist, shouldPersistMethods inherited from class org.eclipse.core.commands.State
addListener, dispose, fireStateChanged, getId, getValue, removeListener, setIdMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
ToggleState
public ToggleState()Constructs a newToggleState. By default, the toggle is off (e.g.,false).
-
-
Method Details
-
load
Description copied from class:PersistentStateLoads this state from the preference store, given the location at which to look. This method must be symmetric with a call toPersistentState.save(IPreferenceStore, String).- Specified by:
loadin classPersistentState- Parameters:
store- The store from which to read; must not benull.preferenceKey- The key at which the state is stored; must not benull.
-
save
Description copied from class:PersistentStateSaves this state to the preference store, given the location at which to write. This method must be symmetric with a call toPersistentState.load(IPreferenceStore, String).- Specified by:
savein classPersistentState- Parameters:
store- The store to which the state should be written; must not benull.preferenceKey- The key at which the state should be stored; must not benull.
-
setValue
Description copied from class:StateSets the value for this state object.
-