Add Highlighter on document
Posted: Fri Nov 17, 2023 8:29 pm
Hello,
We use Author web in version 26.0.0, and we want to manage Highlighter on the document.
I tried to do it this way :
The highlighter is well added in editorAccess, and can be accessed in an other java doOperation().
But no blue STROKE_WAVY_NO_ENDINGS are displayed in web author.
Even if i force the refresh of the document with authorEditorAccess.refresh(), no highlighter are displayed.
How can we manage highlighter in Author Web ?
Thanks,
Regards,
Isabelle
We use Author web in version 26.0.0, and we want to manage Highlighter on the document.
I tried to do it this way :
Code: Select all
public String doOperation(AuthorDocumentModel authorDocumentModel, ArgumentsMap argumentsMap) throws IllegalArgumentException, AuthorOperationException {
AuthorAccess authorAccess = authorDocumentModel.getAuthorAccess();
AuthorEditorAccess editorAccess = authorAccess.getEditorAccess();
AuthorHighlighter highlighter = editorAccess.getHighlighter();
ColorHighlightPainter colorHighlightPainter = new ColorHighlightPainter();
colorHighlightPainter.setColor(Color.COLOR_BLUE);
colorHighlightPainter.setTextDecorationStroke(Graphics.STROKE_WAVY_NO_ENDINGS);
int oxygenOffsetStart = 70;
int oxygenOffsetEnd = 100;
String authorRuleMatch = "It is a Match";
highlighter.addHighlight(oxygenOffsetStart, oxygenOffsetEnd, colorHighlightPainter, authorRuleMatch);
}
But no blue STROKE_WAVY_NO_ENDINGS are displayed in web author.
Even if i force the refresh of the document with authorEditorAccess.refresh(), no highlighter are displayed.
How can we manage highlighter in Author Web ?
Thanks,
Regards,
Isabelle