Class SearchLocationContextBuilder

java.lang.Object
docking.widgets.search.SearchLocationContextBuilder

public class SearchLocationContextBuilder NEW extends Object
A builder for SearchLocationContext objects. Use append(String) for normal text pieces. Use appendMatch(String) for text that is meant to be rendered specially by the context class.
  • Constructor Details

    • SearchLocationContextBuilder

      public SearchLocationContextBuilder()
  • Method Details

    • append

      public SearchLocationContextBuilder append(String text)
      Appends the given text to this builder.
      Parameters:
      text - the text
      Returns:
      this builder
    • appendMatch

      public SearchLocationContextBuilder appendMatch(String text)
      Appends the given text to this builder. This text represents a client-defined 'match' that will be rendered with markup when SearchLocationContext.getBoldMatchingText() is called.
      Parameters:
      text - the text
      Returns:
      this builder
    • lineNumber

      public SearchLocationContextBuilder lineNumber(int line)
      Sets an optional line number for clients that use numbered lines. The line number will be prepended to the text form of the context.
      Parameters:
      line - the line number
      Returns:
      this builder
    • newline

      public SearchLocationContextBuilder newline()
      Adds a newline character to the previously added text.
      Returns:
      this builder
    • build

      public SearchLocationContext build()
      Builds a SearchLocationContext using the text supplied via the append methods.
      Returns:
      the context
    • isEmpty

      public boolean isEmpty()
      Returns true if no text has been added to this builder.
      Returns:
      true if no text has been added to this builder
    • toString

      public String toString()
      Overrides:
      toString in class Object