Interface PluginWithTransientState<T>

Type Parameters:
T - the type used to record the state, usually a Java record

public interface PluginWithTransientState<T>
A Plugin that can save and restore transient state

Plugins should implements this if they have state that needs to be saved as domain objects get switched between active and inactive, i.e., when the user tabs to a different domain object and back. Whatever object is returned by getTransientState() state will be fed back to this plugin via restoreTransientState(Object) after the tool state is switched back to the domain object that was active.

  • Method Details

    • getTransientState

      T getTransientState()
      Returns an object containing the plugins state.
      Returns:
      Object to be return in the restoreTransientState() method.
    • restoreTransientState

      void restoreTransientState(T state)
      Provides the transient state object that was returned in the corresponding getTransientState() call.
      Parameters:
      state - the state object that was generated by this plugin's getTransientState() method.
    • isDisposed

      boolean isDisposed()
      Already required/provided by Plugin
      Returns:
      true if the plugin has been disposed