Class CodeTextModel


public class CodeTextModel extends BasicTextModel
Editable plain text model with optional syntax highlighting for use with the CodeArea control.

This model supports custom content storage mechanism via BasicTextModel.Content. By default, the model provides an in-memory storage via its BasicTextModel.InMemoryContent implementation.

Since:
24
  • Property Details

  • Constructor Details

    • CodeTextModel

      public CodeTextModel()
      Constructs the CodeTextModel with an in-memory content.
    • CodeTextModel

      public CodeTextModel(BasicTextModel.Content c)
      Constructs the CodeTextModel with the specified content.
      Parameters:
      c - the content
  • Method Details

    • getParagraph

      public final RichParagraph getParagraph(int index)
      Description copied from class: StyledTextModel
      Returns a RichParagraph at the given model index. The callers must ensure that the value of index is within the valid document range, since doing otherwise might result in an exception or undetermined behavior.

      This method makes no guarantees that the same paragraph instance will be returned for the same model index.

      Specified by:
      getParagraph in class StyledTextModel
      Parameters:
      index - the paragraph index in the range (0...StyledTextModel.size())
      Returns:
      the instance of RichParagraph
    • decoratorProperty

      public final ObjectProperty<SyntaxDecorator> decoratorProperty()
      Syntax decorator applies styling to the plain text stored in the model.
      Returns:
      the syntax decorator value (may be null)
      See Also:
    • getDecorator

      public final SyntaxDecorator getDecorator()
      Gets the value of the decorator property.
      Property description:
      Syntax decorator applies styling to the plain text stored in the model.
      Returns:
      the value of the decorator property
      See Also:
    • setDecorator

      public final void setDecorator(SyntaxDecorator d)
      Sets the value of the decorator property.
      Property description:
      Syntax decorator applies styling to the plain text stored in the model.
      Parameters:
      d - the value for the decorator property
      See Also: