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 builder(JTextComponent)
.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchHighlighter.Builder
builder
(JTextComponent textComponent) void
highlightColor
(Color color) void
Moves to the next search position, if available, with wrap-around.void
Moves to the previous search position, if available, with wrap-around.void
selectedHighlightColor
(Color color)
-
Method Details
-
searchString
- Returns:
- the search string value
-
caseSensitive
- Returns:
- the
State
controlling whether the search is case-sensitive.
-
highlightColor
- Parameters:
color
- the color to use when highlighting search results.
-
selectedHighlightColor
- Parameters:
color
- the color to use when highlighting the selected search result.
-
createSearchField
- Returns:
- a text field for entering the search text.
-
builder
- Parameters:
textComponent
- the text component- Returns:
- a new
SearchHighlighter.Builder
instance
-
nextSearchPosition
public void nextSearchPosition()Moves to the next search position, if available, with wrap-around. -
previousSearchPosition
public void previousSearchPosition()Moves to the previous search position, if available, with wrap-around.
-