Interface Highlight
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface Highlight
The highlight interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key for the menu creator getting the actions that can be performed over the highlight, as well as information about rendering. -
Method Summary
Modifier and TypeMethodDescriptiongetAdditionalData
(String key) Gets the additional data for the given key.int
Gets the ending model offset for the highlight.getId()
Gets the highlight id.Gets the painter for the highlighter.int
Gets the starting model offset for the highlight.boolean
isEmpty()
void
setAdditionalData
(String key, Object additionalData) Sets the additional data for the given key.
-
Field Details
-
HOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA
Key for the menu creator getting the actions that can be performed over the highlight, as well as information about rendering. The value should be aHighlightActionsProvider
- See Also:
-
-
Method Details
-
getStartOffset
int getStartOffset()Gets the starting model offset for the highlight.- Returns:
- the starting offset >= 0
-
getEndOffset
int getEndOffset()Gets the ending model offset for the highlight.Note: empty highlights have
startOffset == endOffset + 1
- Returns:
- the ending offset (inclusive).
-
isEmpty
boolean isEmpty()- Returns:
true
if the highlight is empty.- Since:
- 22
-
getAdditionalData
Object getAdditionalData()- Returns:
- Additional data for the highlight.
-
getAdditionalData
Gets the additional data for the given key.- Parameters:
key
- the key for which the additional data is to be retrieved. The keyHOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA
can be used in order to get theHighlightActionsProvider
object, providing a set of actions and some rendering information. This can be used to display a widget when hovering over the highlight, from which the provided actions can be performed.- Returns:
- The additional data for the given key.
- Since:
- 17.1
-
setAdditionalData
Sets the additional data for the given key.- Parameters:
key
- The key for which the additional data is set.
The keyHOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA
can be used in order to set an actions provider for the highlight, containing a set of actions, as well as some information about their rendering. The goal is to display a widget when hovering over the highlight, from which the provided actions can be performed.additionalData
- The additional data to set.
For theHOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA
key, the value must be aHighlightActionsProvider
.- Since:
- 17.1
-
getPainter
HighlightPainter getPainter()Gets the painter for the highlighter.- Returns:
- the painter
-
getId
String getId()Gets the highlight id.- Returns:
- The id of the highlight.
-