loci.plugins.prefs

## Class StringOption

- java.lang.Object
- - loci.plugins.prefs.Option
  - - loci.plugins.prefs.StringOption

-     public class StringOption
      extends Option

  A string option for one of the plugins.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `defaultValue` The option's default value.
    `static java.lang.String` | `INI_POSSIBLE` INI key indicating option's possible values.
    `protected java.util.Vector<java.lang.String>` | `possibleValues` List of possible values.
    `protected java.lang.String` | `value` The option's current value.

    - ### Fields inherited from class loci.plugins.prefs.Option

      `info, INI_DEFAULT, INI_INFO, INI_KEY, INI_LABEL, INI_SAVE, key, KEY_PREFIX, label, save`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringOption(java.util.HashMap<java.lang.String,java.lang.String> entry)` Constructs a string option with the parameters from the given map.
    `StringOption(java.lang.String key, boolean save, java.lang.String label, java.lang.String info, java.lang.String defaultValue, java.util.Vector<java.lang.String> possibleValues)` Constructs a string option with the given parameters.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPossible(java.lang.String val)` Adds a possible value to the list.
    `java.lang.String` | `getDefault()` Gets the default value of the option.
    `java.util.Vector<java.lang.String>` | `getPossible()` Gets the list of possible values.
    `java.lang.String` | `getValue()` Gets the current value of the option.
    `void` | `loadOption()` Loads the option's value from the ImageJ preferences file.
    `static java.util.Vector<java.lang.String>` | `parseList(java.lang.String s)` Parses a string of comma-separated values into a list of tokens.
    `void` | `parseOption(java.lang.String arg)` Parses the option's value from the given argument string.
    `void` | `removePossible(java.lang.String val)` Removes a possible value from the list.
    `void` | `saveOption()` Saves the option's value to the ImageJ preferences file.
    `void` | `setValue(java.lang.String value)` Sets the current value of the option.

    - ### Methods inherited from class loci.plugins.prefs.Option

      `getInfo, getKey, getLabel, isSaved`

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

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

- - ### Field Detail

    - #### INI_POSSIBLE

          public static final java.lang.String INI_POSSIBLE

      INI key indicating option's possible values.
      See Also:
        Constant Field Values

    - #### defaultValue

          protected java.lang.String defaultValue

      The option's default value.

    - #### possibleValues

          protected java.util.Vector<java.lang.String> possibleValues

      List of possible values.

    - #### value

          protected java.lang.String value

      The option's current value.

  - ### Constructor Detail

    - #### StringOption

          public StringOption(java.util.HashMap<java.lang.String,java.lang.String> entry)

      Constructs a string option with the parameters from the given map.

    - #### StringOption

          public StringOption(java.lang.String key,
                              boolean save,
                              java.lang.String label,
                              java.lang.String info,
                              java.lang.String defaultValue,
                              java.util.Vector<java.lang.String> possibleValues)

      Constructs a string option with the given parameters. If possible values list is null, any string value is allowed.

  - ### Method Detail

    - #### parseList

          public static java.util.Vector<java.lang.String> parseList(java.lang.String s)

      Parses a string of comma-separated values into a list of tokens.

    - #### getPossible

          public java.util.Vector<java.lang.String> getPossible()

      Gets the list of possible values.

    - #### addPossible

          public void addPossible(java.lang.String val)

      Adds a possible value to the list.

    - #### removePossible

          public void removePossible(java.lang.String val)

      Removes a possible value from the list.

    - #### getDefault

          public java.lang.String getDefault()

      Gets the default value of the option.

    - #### getValue

          public java.lang.String getValue()

      Gets the current value of the option.

    - #### setValue

          public void setValue(java.lang.String value)

      Sets the current value of the option.

    - #### parseOption

          public void parseOption(java.lang.String arg)

      Description copied from class: `Option`
      Parses the option's value from the given argument string.
      Specified by:
        `parseOption` in class `Option`

    - #### loadOption

          public void loadOption()

      Description copied from class: `Option`
      Loads the option's value from the ImageJ preferences file.
      Specified by:
        `loadOption` in class `Option`

    - #### saveOption

          public void saveOption()

      Description copied from class: `Option`
      Saves the option's value to the ImageJ preferences file.
      Specified by:
        `saveOption` in class `Option`

Copyright © 2026 Open Microscopy Environment