Oxygen XML Editor 12.2 Author API

ro.sync.ecss.extensions.api.highlights
Interface AuthorPersistentHighlighter


public interface AuthorPersistentHighlighter

Manage the user custom persistent highlights which get serialized in the XML as processing instructions with the form:
<?oxy_custom_start prop1="val1"....?> xml content <?oxy_custom_end?>
The Highlighter is accessible from WSAuthorEditorPageBase.getPersistentHighlighter().

*********************************
EXPERIMENTAL - Subject to change
*********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

Since:
12

Method Summary
 AuthorPersistentHighlight addHighlight(int startOffset, int endOffset, java.util.LinkedHashMap<java.lang.String,java.lang.String> properties)
          Add a persistent highlight
 AuthorPersistentHighlight[] getHighlights()
          Fetches the list of custom persistent highlights.
 void removeAllHighlights()
          Removes all custom persistent highlights.
 void removeHighlight(AuthorPersistentHighlight highlight)
          Removes a highlight from the view.
 void setHighlightRenderer(PersistentHighlightRenderer renderer)
          Set a renderer for customizing the way that the custom persistent highlights are displayed.
 void setProperties(AuthorPersistentHighlight highlight, java.util.LinkedHashMap<java.lang.String,java.lang.String> newProperties)
          Set new properties of a specific highlight.
A copy of the initial properties can be obtained from AuthorPersistentHighlight.getClonedProperties()
 

Method Detail

addHighlight

AuthorPersistentHighlight addHighlight(int startOffset,
                                       int endOffset,
                                       java.util.LinkedHashMap<java.lang.String,java.lang.String> properties)
                                       throws java.lang.IllegalArgumentException
Add a persistent highlight

Parameters:
startOffset - Start offset
endOffset - End offset
properties - name/value pairs which will get serialized to disk.

Notes:
1. Each property name must be a valid XML attribute name.
2. Each property value will be escaped to be a valid XML attribute value.
3. In order to change the properties for a highlight you have to use the method: setProperties(AuthorPersistentHighlight, LinkedHashMap).

Returns:
The added highlight or null if the highlight cannot be added.
Throws:
java.lang.IllegalArgumentException - Thrown when a property name is not a valid XML attribute name.

removeHighlight

void removeHighlight(AuthorPersistentHighlight highlight)
Removes a highlight from the view.

Parameters:
highlight - the highlight to remove

removeAllHighlights

void removeAllHighlights()
Removes all custom persistent highlights.


getHighlights

AuthorPersistentHighlight[] getHighlights()
Fetches the list of custom persistent highlights.

Returns:
the highlight array.

setProperties

void setProperties(AuthorPersistentHighlight highlight,
                   java.util.LinkedHashMap<java.lang.String,java.lang.String> newProperties)
                   throws java.lang.IllegalArgumentException
Set new properties of a specific highlight.
A copy of the initial properties can be obtained from AuthorPersistentHighlight.getClonedProperties()

Parameters:
highlight - The highlight for which the properties will be set.
newProperties - The new highlight properties.

Notes:
1. Each property name must be a valid XML attribute name.
2. Each property value will be escaped to be a valid XML attribute value.

Throws:
java.lang.IllegalArgumentException - Thrown when a property name is not a valid XML attribute name.

setHighlightRenderer

void setHighlightRenderer(PersistentHighlightRenderer renderer)
Set a renderer for customizing the way that the custom persistent highlights are displayed.

Parameters:
renderer - The renderer defining the way in which the highlights are painted.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.