Class SearchHighlighter

java.lang.Object
is.codion.swing.common.ui.component.text.SearchHighlighter

public final class SearchHighlighter extends Object
Highlights search results in a JTextComponent.
Instantiate via the searchHighlighter(JTextComponent) factory method.
  • Method Details

    • searchString

      public Value<String> searchString()
      Returns:
      the search string value
    • caseSensitive

      public State caseSensitive()
      Returns:
      the state controlling whether the search is case-sensitive.
    • highlightColor

      public void highlightColor(Color color)
      Parameters:
      color - the color to use when highlighting search results.
    • highlightSelectedColor

      public void highlightSelectedColor(Color color)
      Parameters:
      color - the color to use when highlighting the selected search result.
    • createSearchField

      public JTextField createSearchField()
      Returns:
      a text field for entering the search text.
    • searchHighlighter

      public static SearchHighlighter searchHighlighter(JTextComponent textComponent)
      Instantiates a new search highlighter for the given text component.
      Parameters:
      textComponent - the text component to search
      Returns:
      a new SearchHighlighter for the given component