ur_rna.StructureEditor.services

## Class UserPrefs

- java.lang.Object
- - ur_rna.StructureEditor.services.UserPrefs

-     public class UserPrefs
      extends java.lang.Object

  Assists with storing User Preferences to file.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.prefs.Preferences` | `appNode`
    `static java.lang.String` | `DEFAULT_USER`
    `private FilePreferences` | `root`
    `private java.util.prefs.Preferences` | `userNode`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserPrefs(java.io.File settingsFile)`
    `UserPrefs(java.lang.String appName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.prefs.Preferences` | `app()` Store application-wide settings that are not user-specific here.
    `java.lang.String` | `get(java.lang.String name)`
    `java.lang.String` | `get(java.lang.String name, java.lang.String defaultValue)`
    `java.lang.String` | `getUser()`
    `void` | `put(java.lang.String name, java.lang.String value)`
    `static void` | `register()`
    `protected void` | `save()` Save user preferences to file.
    `void` | `setUser(java.lang.String name)`
    `java.util.prefs.Preferences` | `user()` Store user-specific settings here.

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### appNode

          private java.util.prefs.Preferences appNode

    - #### DEFAULT_USER

          public static final java.lang.String DEFAULT_USER

      See Also:
        Constant Field Values

    - #### root

          private final FilePreferences root

    - #### userNode

          private java.util.prefs.Preferences userNode

  - ### Constructor Detail

    - #### UserPrefs

          public UserPrefs(java.io.File settingsFile)

    - #### UserPrefs

          public UserPrefs(java.lang.String appName)

  - ### Method Detail

    - #### app

          public java.util.prefs.Preferences app()

      Store application-wide settings that are not user-specific here.

    - #### get

          public java.lang.String get(java.lang.String name)

    - #### get

          public java.lang.String get(java.lang.String name,
                                      java.lang.String defaultValue)

    - #### getUser

          public java.lang.String getUser()

    - #### put

          public void put(java.lang.String name,
                          java.lang.String value)

    - #### register

          public static void register()

    - #### save

          protected void save()

      Save user preferences to file. This happens automatically upon proper Java shutdown, and is only really necessary in scenarios where the JVM is terminated unexpectedly.

    - #### setUser

          public void setUser(java.lang.String name)

    - #### user

          public java.util.prefs.Preferences user()

      Store user-specific settings here.