Class TextState


  • 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.

    Since:
    3.2
    See Also:
    INamedHandleStateIds
    • Constructor Detail

      • TextState

        public TextState()
    • Method Detail

      • save

        public final void save​(IPreferenceStore store,
                               String preferenceKey)
        Description copied from class: PersistentState
        Saves this state to the preference store, given the location at which to write. This method must be symmetric with a call to PersistentState.load(IPreferenceStore, String).
        Specified by:
        save in class PersistentState
        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.
      • setValue

        public void setValue​(Object value)
        Description copied from class: State
        Sets the value for this state object.
        Overrides:
        setValue in class State
        Parameters:
        value - The value to set; may be anything.