Highlight Content

Question

How can we add custom highlights to the Author document content?

Answer

There are two types of highlights you can add:
  1. Not Persistent Highlights. Such highlights are removed when the document is closed and then re-opened.

    You can use the following API method:
    ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.getHighlighter()
    to obtain an AuthorHighlighter which allows you to add a highlight between certain offsets with a certain painter.

    For example you can use this support to implement your custom spell checker.

  2. Persistent Highlights. Such highlights are saved in the XML content as processing instructions.

    You can use the following API method:
    ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.getPersistentHighlighter()
    to obtain an AuthorPersistentHighlighter which allows you to add a persistent highlight between certain offsets and containing certain custom properties and render it with a certain painter.

    For example you can use this support to implement your own way of adding review comments.