Interface Highlight
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface Highlight
The highlight interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey 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.intGets the ending model offset for the highlight.getId()Gets the highlight id.Gets the painter for the highlighter.intGets the starting model offset for the highlight.booleanisEmpty()voidsetAdditionalData(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:
trueif 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_DATAcan be used in order to get theHighlightActionsProviderobject, 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_DATAcan 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_DATAkey, 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.
-