Package docking.widgets.values

# Class StringValue

java.lang.Object
docking.widgets.values.AbstractValue<String>
docking.widgets.values.StringValue

public class StringValue extends AbstractValue<String>
Value class for `String` values.

This class and other subclasses of `AbstractValue` are part of a subsystem for easily defining a set of values that can be displayed in an input dialog (`ValuesMapDialog`). Typically, these values are created indirectly using a `GValuesMap` which is then given to the constructor of the dialog. However, an alternate approach is to create the dialog without a ValuesMap and then use its `ValuesMapDialog.addValue(AbstractValue)` method directly.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringValue(String name)`
  `StringValue(String name, String defaultValue)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `fromString(String valueString)`
  Parses the given string into a value of type T
  `JComponent`
  `getComponent()`
  Returns a JComponent for entering or editing a value of this type.
  `protected void`
  `updateComponentFromValue()`
  Updates the JComponent returned from `AbstractValue.getComponent()` to represent the current value of this object.
  `protected void`
  `updateValueFromComponent()`
  Causes the stored value for this object to be updated based on the state of the JComponent returned from `AbstractValue.getComponent()`

  ### Methods inherited from class docking.widgets.values.AbstractValue

  `copyValue, getAsText, getName, getValue, hasValue, reset, setAsText, setValue, toString`

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

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

- ## Constructor Details

  - ### StringValue

    public StringValue(String name)

  - ### StringValue

    public StringValue(String name, String defaultValue)

- ## Method Details

  - ### getComponent

    public JComponent getComponent()
    Description copied from class: `AbstractValue`
    Returns a JComponent for entering or editing a value of this type.
    Specified by:
      `getComponent` in class `AbstractValue<String>`
    Returns:
      a JComponent for entering or editing a value of this type.

  - ### updateValueFromComponent

    protected void updateValueFromComponent()
    Description copied from class: `AbstractValue`
    Causes the stored value for this object to be updated based on the state of the JComponent returned from `AbstractValue.getComponent()`
    Specified by:
      `updateValueFromComponent` in class `AbstractValue<String>`

  - ### updateComponentFromValue

    protected void updateComponentFromValue()
    Description copied from class: `AbstractValue`
    Updates the JComponent returned from `AbstractValue.getComponent()` to represent the current value of this object.
    Specified by:
      `updateComponentFromValue` in class `AbstractValue<String>`

  - ### fromString

    public String fromString(String valueString)
    Description copied from class: `AbstractValue`
    Parses the given string into a value of type T
    Specified by:
      `fromString` in class `AbstractValue<String>`
    Parameters:
      `valueString` - the string to parse
    Returns:
      a value of type T