Class PreferenceMemento


  • public class PreferenceMemento
    extends java.lang.Object
    A utility to change and remember preference values and later restore there original value. The first time a preference value is changed its current value is stored. Later you can reset all preference values (which are changed through this class) to the state they had when creating the memento.

    This class is most useful for testing to prevent leakage of preference changes between individual tests.

    Since:
    3.18
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void resetPreferences()
      Reset every preference changed by this utility to its state before the first change.
      <T> void setValue​(IPreferenceStore store, java.lang.String name, T value)
      Set the value for the given preference on the given store.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait