Interface UserProfile


public interface UserProfile
A user profile, where user preferences can be stored.

In MMStudio and its plugins, all user preferences should be stored in the current user profile, not in the standard Java preferences.

This works similarly to Preferences, except that it is possible to switch between multiple profiles within a single operating system user account. This is provided because sharing an OS account by all users is a widespread practice on computers attached to scientific equipment.

The user profile stores the same kinds of values as PropertyMap, but is mutable and periodically saves any modifications (if thus set up by the system).

  • Method Details

    • getProfileName

      String getProfileName()
      Returns the name of this profile as displayed to the user.
      Returns:
      the profile name
    • getSettings

      MutablePropertyMapView getSettings(Class<?> owner)
      Get an interface to save and retrieve settings.

      This is the main interface for accessing values in the user profile.

      Parameters:
      owner - the class that "owns" the settings
      Returns:
      an object allowing settings to be set and retrieved
    • clearSettingsForAllClasses

      void clearSettingsForAllClasses()
      Reset this user profile, deleting all settings.

      Do not confuse with getSettings(owner).clear()!

    • getString

      @Deprecated String getString(Class<?> c, String key, String fallback)
      Deprecated.
      use getSettings(c).getString(key, fallback) instead
      Deprecated.
    • getStringArray

      @Deprecated String[] getStringArray(Class<?> c, String key, String[] fallback)
      Deprecated.
      use getSettings(c).getStringList(key, fallback) instead
      Deprecated.
    • setString

      @Deprecated void setString(Class<?> c, String key, String value)
      Deprecated.
      use getSettings(c).putString(key, value) instead
      Deprecated.
    • setStringArray

      @Deprecated void setStringArray(Class<?> c, String key, String[] value)
      Deprecated.
      use getSettings(c).putStringList(key, value) instead
      Deprecated.
    • getInt

      @Deprecated Integer getInt(Class<?> c, String key, Integer fallback)
      Deprecated.
      use getSettings(c).getInteger(key, fallback) instead
      Deprecated.
    • getIntArray

      @Deprecated Integer[] getIntArray(Class<?> c, String key, Integer[] fallback)
      Deprecated.
      use getSettings(c).getIntegerList(key, fallback) instead
      Deprecated.
    • setInt

      @Deprecated void setInt(Class<?> c, String key, Integer value)
      Deprecated.
      use getSettings(c).putInteger(key, value) instead
      Deprecated.
    • setIntArray

      @Deprecated void setIntArray(Class<?> c, String key, Integer[] value)
      Deprecated.
      use getSettings(c).putIntegerList(key, value) instead
      Deprecated.
    • getLong

      @Deprecated Long getLong(Class<?> c, String key, Long fallback)
      Deprecated.
      use getSettings(c).getLong(key, fallback) instead
      Deprecated.
    • getLongArray

      @Deprecated Long[] getLongArray(Class<?> c, String key, Long[] fallback)
      Deprecated.
      use getSettings(c).getLongList(key, fallback) instead
      Deprecated.
    • setLong

      @Deprecated void setLong(Class<?> c, String key, Long value)
      Deprecated.
      use getSettings(c).putLong(key, value) instead
      Deprecated.
    • setLongArray

      @Deprecated void setLongArray(Class<?> c, String key, Long[] value)
      Deprecated.
      use getSettings(c).putLongList(key, value) instead
      Deprecated.
    • getDouble

      @Deprecated Double getDouble(Class<?> c, String key, Double fallback)
      Deprecated.
      use getSettings(c).getDouble(key, fallback) instead
      Deprecated.
    • getDoubleArray

      @Deprecated Double[] getDoubleArray(Class<?> c, String key, Double[] fallback)
      Deprecated.
      use getSettings(c).getDoubleList(key, fallback) instead
      Deprecated.
    • setDouble

      @Deprecated void setDouble(Class<?> c, String key, Double value)
      Deprecated.
      use getSettings(c).putDouble(key, value) instead
      Deprecated.
    • setDoubleArray

      @Deprecated void setDoubleArray(Class<?> c, String key, Double[] value)
      Deprecated.
      use getSettings(c).putDoubleList(key, value) instead
      Deprecated.
    • getBoolean

      @Deprecated Boolean getBoolean(Class<?> c, String key, Boolean fallback)
      Deprecated.
      use getSettings(c).getBoolean(key, fallback) instead
      Deprecated.
    • getBooleanArray

      @Deprecated Boolean[] getBooleanArray(Class<?> c, String key, Boolean[] fallback)
      Deprecated.
      use getSettings(c).getBooleanList(key, fallback) instead
      Deprecated.
    • setBoolean

      @Deprecated void setBoolean(Class<?> c, String key, Boolean value)
      Deprecated.
      use getSettings(c).putBoolean(key, value) instead
      Deprecated.
    • setBooleanArray

      @Deprecated void setBooleanArray(Class<?> c, String key, Boolean[] value)
      Deprecated.
      use getSettings(c).putBooleanList(key, value) instead
      Deprecated.