Class Buffer.Builder<B extends Buffer.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Buffer

public static class Buffer.Builder<B extends Buffer.Builder<B>> extends TextBuffer.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Buffer build()
      Finish building the Buffer object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Buffer.
      Overrides:
      build in class TextBuffer.Builder<B extends Buffer.Builder<B>>
      Returns:
      a new instance of Buffer with the properties that were set in the Builder object.
    • setHighlightMatchingBrackets

      public B setHighlightMatchingBrackets(boolean highlightMatchingBrackets)
      Whether to highlight matching brackets in the buffer.
      Parameters:
      highlightMatchingBrackets - the value for the highlight-matching-brackets property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHighlightSyntax

      public B setHighlightSyntax(boolean highlightSyntax)
      Whether to highlight syntax in the buffer.
      Parameters:
      highlightSyntax - the value for the highlight-syntax property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setImplicitTrailingNewline

      public B setImplicitTrailingNewline(boolean implicitTrailingNewline)
      Whether the buffer has an implicit trailing newline. See Buffer.setImplicitTrailingNewline(boolean).
      Parameters:
      implicitTrailingNewline - the value for the implicit-trailing-newline property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLanguage

      public B setLanguage(Language language)
    • setStyleScheme

      public B setStyleScheme(StyleScheme styleScheme)
      Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets style.
      Parameters:
      styleScheme - the value for the style-scheme property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onBracketMatched

      public B onBracketMatched(Buffer.BracketMatchedCallback handler)

      iter is set to a valid iterator pointing to the matching bracket if state is BracketMatchType.FOUND. Otherwise iter is meaningless.

      The signal is emitted only when the state changes, typically when the cursor moves.

      A use-case for this signal is to show messages in a Statusbar.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onCursorMoved

      public B onCursorMoved(Buffer.CursorMovedCallback handler)
      The "cursor-moved" signal is emitted when then insertion mark has moved.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onHighlightUpdated

      public B onHighlightUpdated(Buffer.HighlightUpdatedCallback handler)
      The ::highlight-updated signal is emitted when the syntax highlighting and context classes are updated in a certain region of the buffer.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSourceMarkUpdated

      public B onSourceMarkUpdated(Buffer.SourceMarkUpdatedCallback handler)
      The ::source-mark-updated signal is emitted each time a mark is added to, moved or removed from the buffer.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: