@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface AuthorPersistentHighlighter
<?oxy_custom_start prop1="val1"....?> xml content <?oxy_custom_end?>
WSAuthorEditorPageBase.getPersistentHighlighter()
.Modifier and Type | Method and Description |
---|---|
AuthorPersistentHighlight |
addHighlight(int startOffset,
int endOffset,
java.util.LinkedHashMap<java.lang.String,java.lang.String> properties)
Add a custom persistent highlight.
|
boolean |
canAddHighlight(int startOffset,
int endOffset)
Check if a custom
AuthorPersistentHighlight can be added for the given
start and end offsets. |
AuthorPersistentHighlight[] |
getHighlights()
Fetches the list of custom persistent highlights.
|
AuthorPersistentHighlight[] |
getHighlights(int startOffset,
int endOffset)
Fetches the list of custom persistent highlights that intersect the interval
between the given start offset and end offset.
|
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 |
setHighlightsActionsProvider(AuthorPersistentHighlightActionsProvider provider)
Set the provider for the actions that are available for a specific highlight.
|
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() |
AuthorPersistentHighlight addHighlight(int startOffset, int endOffset, java.util.LinkedHashMap<java.lang.String,java.lang.String> properties) throws java.lang.IllegalArgumentException
oxy_custom_start
and oxy_custom_end
.
AuthorPersistentHighlight.PersistentHighlightType.CUSTOM_HIGHLIGHT
.startOffset
- Start offset (inclusive).endOffset
- End offset (inclusive). The highlight end offset must be equal
or greater than the start 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)
.
null
if the highlight cannot be added.java.lang.IllegalArgumentException
- Thrown when a property name is not a valid XML attribute name or when
the given end offset is less than start offset.boolean canAddHighlight(int startOffset, int endOffset)
AuthorPersistentHighlight
can be added for the given
start and end offsets. If one of these offsets correspond to a read-only context
(they are inside a content deleted with track changes, an element set as read-only from
CSS or a content generated from expanding a reference) the highlight cannot
be inserted and this method returns false
.
addHighlight(int, int, LinkedHashMap)
method. The name of the
processing instruction markers corresponding to the custom persistent
highlight are oxy_custom_start
and oxy_custom_end
.
startOffset
- Start offset (inclusive).endOffset
- End offset (inclusive). The highlight end offset must be equal
or greater than the start offset.true
if a custom persistent highlight can be insertedvoid removeHighlight(AuthorPersistentHighlight highlight)
highlight
- the highlight to removevoid removeAllHighlights()
AuthorPersistentHighlight[] getHighlights()
AuthorPersistentHighlight[] getHighlights(int startOffset, int endOffset)
startOffset
- The start offset(inclusive).endOffset
- The end offset (inclusive).null
if
no custom persistent highlight intersects the given offsets interval.void setProperties(AuthorPersistentHighlight highlight, java.util.LinkedHashMap<java.lang.String,java.lang.String> newProperties) throws java.lang.IllegalArgumentException
AuthorPersistentHighlight.getClonedProperties()
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.
java.lang.IllegalArgumentException
- Thrown when a property name is not a valid XML attribute name.void setHighlightRenderer(PersistentHighlightRenderer renderer)
renderer
- The renderer defining the way in which the highlights are painted.void setHighlightsActionsProvider(AuthorPersistentHighlightActionsProvider provider)
AuthorCalloutsController.setCalloutsRenderingInformationProvider(CalloutsRenderingInformationProvider)
method must be used.provider
- The highlights callout rendering information provider.java.lang.IllegalArgumentException
- Thrown when a property name is not a valid XML attribute name.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.