Package org.eclipse.jface.commands
Class PersistentState
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.State
org.eclipse.jface.commands.PersistentState
- Direct Known Subclasses:
- RadioState,- TextState,- ToggleState
This is a state that can be made persistent. A state is persisted to a preference store.
Clients may extend this class.
- Since:
- 3.2
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidload(IPreferenceStore store, String preferenceKey) Loads this state from the preference store, given the location at which to look.abstract voidsave(IPreferenceStore store, String preferenceKey) Saves this state to the preference store, given the location at which to write.voidsetShouldPersist(boolean persisted) Sets whether this state should be persisted.booleanWhether this state should be persisted.Methods inherited from class org.eclipse.core.commands.StateaddListener, dispose, fireStateChanged, getId, getValue, removeListener, setId, setValueMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
- 
Constructor Details- 
PersistentStatepublic PersistentState()
 
- 
- 
Method Details- 
loadLoads this state from the preference store, given the location at which to look. This method must be symmetric with a call tosave(IPreferenceStore, String).- Parameters:
- store- The store from which to read; must not be- null.
- preferenceKey- The key at which the state is stored; must not be- null.
 
- 
saveSaves this state to the preference store, given the location at which to write. This method must be symmetric with a call toload(IPreferenceStore, String).- Parameters:
- store- The store to which the state should be written; must not be- null.
- preferenceKey- The key at which the state should be stored; must not be- null.
 
- 
setShouldPersistpublic void setShouldPersist(boolean persisted) Sets whether this state should be persisted.- Parameters:
- persisted- Whether this state should be persisted.
 
- 
shouldPersistpublic boolean shouldPersist()Whether this state should be persisted. Subclasses should check this method before loading or saving.- Returns:
- trueif this state should be persisted;- falseotherwise.
 
 
-