Interface Highlight


@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface Highlight
The highlight interface.
  • Field Details

    • HOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA

      static final String 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 a HighlightActionsProvider
      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

      Object getAdditionalData(String key)
      Gets the additional data for the given key.
      Parameters:
      key - the key for which the additional data is to be retrieved. The key HOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA can be used in order to get the HighlightActionsProvider 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

      void setAdditionalData(String key, Object additionalData)
      Sets the additional data for the given key.
      Parameters:
      key - The key for which the additional data is set.
      The key HOVER_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 the HOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA key, the value must be a HighlightActionsProvider.
      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.