Class CodeEditorOption

All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class CodeEditorOption extends AbstractOption
An option that uses a code editor to edit its value.

See also: the code editor is provided by the RSyntaxTextArea project.

Since:
5.2
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • CodeEditorOption

      public CodeEditorOption()
      Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
  • 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 org.fife.ui.rsyntaxtextarea.RSyntaxTextArea getTextArea()
      Get the underlying JTextArea.
      Returns:
      an instance of JTextArea.
    • getLanguage

      public String getLanguage()
      Get the language used by the code editor.
      Returns:
      the language in mime type format, e.g. "text/java".
    • setLanguage

      public void setLanguage(String language)
      Set the language used by the code editor.
      Parameters:
      language - the language in mime type format, e.g. "text/java".