Interface Highlight


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

      • HOVER_ACTIONS_PROVIDER_ADDITIONAL_DATA

        static final java.lang.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:
        Constant Field Values
    • Method Detail

      • 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

        java.lang.Object getAdditionalData()
        Returns:
        Additional data for the highlight.
      • getAdditionalData

        java.lang.Object getAdditionalData​(java.lang.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​(java.lang.String key,
                               java.lang.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

        java.lang.String getId()
        Gets the highlight id.
        Returns:
        The id of the highlight.