public class TextState extends PersistentState
A piece of state carrying a single String
.
If this state is registered using INamedHandleStateIds.NAME
or
INamedHandleStateIds.DESCRIPTION
, then this allows the handler to
communicate a textual change for a given command. This is typically used by
graphical applications to allow more specific text to be displayed in the
menus. For example, "Undo" might become "Undo Typing" through the use of a
TextState
.
Clients may instantiate this class, but must not extend.
INamedHandleStateIds
Constructor and Description |
---|
TextState() |
Modifier and Type | Method and Description |
---|---|
void |
load(IPreferenceStore store,
String preferenceKey)
Loads this state from the preference store, given the location at which
to look.
|
void |
save(IPreferenceStore store,
String preferenceKey)
Saves this state to the preference store, given the location at which to
write.
|
void |
setValue(Object value)
Sets the value for this state object.
|
setShouldPersist, shouldPersist
addListener, dispose, fireStateChanged, getId, getValue, removeListener, setId
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public final void load(IPreferenceStore store, String preferenceKey)
PersistentState
PersistentState.save(IPreferenceStore, String)
.load
in class PersistentState
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 final void save(IPreferenceStore store, String preferenceKey)
PersistentState
PersistentState.load(IPreferenceStore, String)
.save
in class PersistentState
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
.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.