public interface TextFinder
Modifier and Type | Method and Description |
---|---|
void |
find(java.lang.String text,
java.util.function.Consumer<FindResult> onFindResult)
Performs search of the given
text , highlights all matches and selects the first match
on the currently loaded web page. |
void |
find(java.lang.String text,
FindOptions options,
java.util.function.Consumer<FindResult> onFindResult)
Performs search of the given
text with the given options , highlights all
matches and selects the first match on the currently loaded web page. |
void |
stopFindingAndClearSelection()
Stops finding and clears the highlighting of the found matches.
|
void |
stopFindingAndKeepSelection()
Stops finding and keeps the the currently highlighted match selected.
|
void find(java.lang.String text, java.util.function.Consumer<FindResult> onFindResult)
text
, highlights all matches and selects the first match
on the currently loaded web page.
The search is performed only through a visible content on the loaded web page. If some text is presented on the web page, but due to CSS rules it is not visible, the text finder will not check this content during search. Also, it does not find text on the web pages with an empty size, so make sure that the size of the browser instance where the text search is performed isn't empty.
text
- a text to searchonFindResult
- a consumer object which allows obtaining the search resultjava.lang.IllegalArgumentException
- when text
is empty or blankjava.lang.IllegalStateException
- when the browser is closedvoid find(java.lang.String text, FindOptions options, java.util.function.Consumer<FindResult> onFindResult)
text
with the given options
, highlights all
matches and selects the first match on the currently loaded web page.
The search is performed only through a visible content on the loaded web page. If some text is presented on the web page, but due to CSS rules it is not visible, the text finder will not check this content during search. Also, it does not find text on the web pages with an empty size, so make sure that the size of the browser instance where the text search is performed isn't empty.
text
- a text to searchoptions
- the parameters such as direction and match caseonFindResult
- a consumer object which allows obtaining the search resultjava.lang.IllegalArgumentException
- when text
is emptyjava.lang.IllegalStateException
- when the browser is closedvoid stopFindingAndKeepSelection()
java.lang.IllegalStateException
- when the browser is closedvoid stopFindingAndClearSelection()
java.lang.IllegalStateException
- when the browser is closed