public abstract class PersistentState extends State
This is a state that can be made persistent. A state is persisted to a preference store.
Clients may extend this class.
Constructor and Description |
---|
PersistentState() |
Modifier and Type | Method and Description |
---|---|
abstract void |
load(IPreferenceStore store,
String preferenceKey)
Loads this state from the preference store, given the location at which
to look.
|
abstract void |
save(IPreferenceStore store,
String preferenceKey)
Saves this state to the preference store, given the location at which to
write.
|
void |
setShouldPersist(boolean persisted)
Sets whether this state should be persisted.
|
boolean |
shouldPersist()
Whether this state should be persisted.
|
addListener, dispose, fireStateChanged, getId, getValue, removeListener, setId, setValue
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public abstract void load(IPreferenceStore store, String preferenceKey)
save(IPreferenceStore, String)
.store
- The store from which to read; must not be null
.preferenceKey
- The key at which the state is stored; must not be
null
.public abstract void save(IPreferenceStore store, String preferenceKey)
load(IPreferenceStore, String)
.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
.public void setShouldPersist(boolean persisted)
persisted
- Whether this state should be persisted.public boolean shouldPersist()
true
if this state should be persisted;
false
otherwise.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.