Module is.codion.swing.common.ui
Class SearchHighlighter
java.lang.Object
is.codion.swing.common.ui.component.text.SearchHighlighter
Highlights search results in a JTextComponent.
Instantiate via the
Instantiate via the
searchHighlighter(JTextComponent) factory method.-
Method Summary
Modifier and TypeMethodDescriptionis.codion.common.state.Statestatic SearchHighlightersearchHighlighter(JTextComponent textComponent) Instantiates a new search highlighter for the given text component.is.codion.common.value.Value<String>voidsetHighlightColor(Color color) voidsetSelectedHighlightColor(Color color)
-
Method Details
-
searchString
- Returns:
- the search string value
-
caseSensitive
public is.codion.common.state.State caseSensitive()- Returns:
- the state controlling whether the search is case-sensitive.
-
setHighlightColor
- Parameters:
color- the color to use when highlighting search results.
-
setSelectedHighlightColor
- Parameters:
color- the color to use when highlighting the selected search result.
-
createSearchField
- Returns:
- a text field for entering the search text.
-
searchHighlighter
Instantiates a new search highlighter for the given text component.- Parameters:
textComponent- the text component to search- Returns:
- a new
SearchHighlighterfor the given component
-