Class TextAreaOption

All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class TextAreaOption extends AbstractOption
An option that uses a JTextArea to edit its value.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • TextAreaOption

      public TextAreaOption()
      Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
    • TextAreaOption

      public TextAreaOption(String name, String label, String tooltip, String value)
      Initialize this text area option with the specified parameters.
      Parameters:
      name - this component's name.
      label - the label displayed with the text area.
      tooltip - the tooltip associated with the text area.
      value - the initial value of this component.
  • Method Details

    • createUI

      public void createUI()
      Create the UI components for this option.
      Specified by:
      createUI in class AbstractOptionProperties
    • getValue

      public Object getValue()
      Get the current value for this option.
      Specified by:
      getValue in interface Option
      Overrides:
      getValue in class AbstractOption
      Returns:
      a String instance.
    • setValue

      public void setValue(Object value)
      Set the current value for this option.
      Overrides:
      setValue in class AbstractOption
      Parameters:
      value - a String instance.
    • append

      public void append(String value)
      Set the current value for this option.
      Parameters:
      value - a String instance.
    • setupValueChangeNotifications

      protected void setupValueChangeNotifications()
      Add a listener to the underlying text document, to receive and propagate change events.
      Specified by:
      setupValueChangeNotifications in class AbstractOption
    • isEditable

      public boolean isEditable()
      Determine whether the text area is editable.
      Returns:
      true if the text area is editable, false otherwise.
    • setEditable

      public void setEditable(boolean editable)
      Specify whether the text area is editable.
      Specified by:
      setEditable in interface OptionProperties
      Overrides:
      setEditable in class AbstractOptionProperties
      Parameters:
      editable - true if the text area is editable, false otherwise.
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from interface: OptionProperties
      Enable or disable this option.
      Parameters:
      enabled - true to enable this option, false to disable it.
    • getTextArea

      public JTextArea getTextArea()
      Get the underlying JTextArea.
      Returns:
      an instance of JTextArea.
    • getTimestampFormat

      public String getTimestampFormat()
      Get the format of an optional timestamp displayed before the message.
      Returns:
      the format as a string.
    • setTimestampFormat

      public void setTimestampFormat(String timestampFormat)
      Set the format of an optional timestamp displayed before the message.
      Parameters:
      timestampFormat - the format as a string.