Possible Approach
There is a similar question for search & highlight functionality in WebView
:
Perhaps you could use an adjustment of that approach (internally the HTMLEditor is implemented as a WebView I believe, though I could be wrong).
You might be able to use some techniques for customizing the existing HTMLEditor to get UI controls for executing searches into the toolbar of the HTMLEditor.
Alternatives
Rather than using HTMLEditor
you could either use:
- A
WebView
with ContentEditable.
- A native JavaFX rich text editor.
- A markdown editor (there are native JavaFX solutions for this if you google JavaFX markdown).
- A WebView running an embedded third party JavaScript based HTMLEditor which includes search and replace functionality (there are many of these, you can just run a google search to evaluate alternatives).
If it were me, I'd probably choose the Markdown editor approach if the editor was for a semi-technical audience or the third party JavaScript editor in WebView if the audience was non-technical and required a WYSIWYG HTML editor with a ribbon.