Class JSyntaxTextArea

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextArea
org.fife.ui.rtextarea.RTextAreaBase
org.fife.ui.rtextarea.RTextArea
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
org.apache.jmeter.gui.util.JSyntaxTextArea
All Implemented Interfaces:
ImageObserver, MenuContainer, Printable, Serializable, Accessible, Scrollable, org.fife.ui.rsyntaxtextarea.SyntaxConstants

public class JSyntaxTextArea extends org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
Utility class to handle RSyntaxTextArea code It's not currently possible to instantiate the RSyntaxTextArea class when running headless. So we use getInstance methods to create the class and allow for headless testing.
See Also:
  • Constructor Details

    • JSyntaxTextArea

      @Deprecated public JSyntaxTextArea()
      Deprecated.
    • JSyntaxTextArea

      @Deprecated public JSyntaxTextArea(int rows, int cols)
      Deprecated.
      Creates the default syntax highlighting text area. The following are set:
      • setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)
      • setCodeFoldingEnabled(true)
      • setAntiAliasingEnabled(true)
      • setLineWrap(true)
      • setWrapStyleWord(true)
      Parameters:
      rows - The number of rows for the text area
      cols - The number of columns for the text area
    • JSyntaxTextArea

      @Deprecated public JSyntaxTextArea(int rows, int cols, boolean disableUndo)
      Deprecated.
      Creates the default syntax highlighting text area. The following are set:
      • setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)
      • setCodeFoldingEnabled(true)
      • setAntiAliasingEnabled(true)
      • setLineWrap(true)
      • setWrapStyleWord(true)
      Parameters:
      rows - The number of rows for the text area
      cols - The number of columns for the text area
      disableUndo - true to disable undo manager, defaults to false
  • Method Details

    • getInstance

      public static JSyntaxTextArea getInstance(int rows, int cols, boolean disableUndo)
      Creates the default syntax highlighting text area. The following are set:
      • setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)
      • setCodeFoldingEnabled(true)
      • setAntiAliasingEnabled(true)
      • setLineWrap(true)
      • setWrapStyleWord(true)
      Parameters:
      rows - The number of rows for the text area
      cols - The number of columns for the text area
      disableUndo - true to disable undo manager
      Returns:
      JSyntaxTextArea
    • getInstance

      public static JSyntaxTextArea getInstance(int rows, int cols)
      Creates the default syntax highlighting text area. The following are set:
      • setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)
      • setCodeFoldingEnabled(true)
      • setAntiAliasingEnabled(true)
      • setLineWrap(true)
      • setWrapStyleWord(true)
      Parameters:
      rows - The number of rows for the text area
      cols - The number of columns for the text area
      Returns:
      JSyntaxTextArea
    • setLanguage

      public void setLanguage(String language)
      Sets the language of the text area.
      Parameters:
      language - The language to be set
    • createUndoManager

      protected org.fife.ui.rtextarea.RUndoManager createUndoManager()
      Override UndoManager to allow disabling if feature causes issues See Issue 19 on RSyntaxTextArea
      Overrides:
      createUndoManager in class org.fife.ui.rtextarea.RTextArea
    • setInitialText

      public void setInitialText(String string)
      Sets initial text resetting undo history
      Parameters:
      string - The initial text to be set