Class CursorLinePainter

    • Constructor Detail

      • CursorLinePainter

        public CursorLinePainter​(ITextViewer textViewer)
        Creates a new painter for the given source viewer.
        Parameters:
        textViewer - the source viewer for which to create a painter
    • Method Detail

      • setHighlightColor

        public void setHighlightColor​(Color highlightColor)
        Sets the color in which to draw the background of the cursor line.
        Parameters:
        highlightColor - the color in which to draw the background of the cursor line
      • lineGetBackground

        public void lineGetBackground​(LineBackgroundEvent event)
        Description copied from interface: LineBackgroundListener
        This method is called when a line is about to be drawn in order to get its background color.

        The following event fields are used:

        • event.lineOffset line start offset (input)
        • event.lineText line text (input)
        • event.lineBackground line background color (output)
        Specified by:
        lineGetBackground in interface LineBackgroundListener
        Parameters:
        event - the given event
        See Also:
        LineBackgroundEvent
      • deactivate

        public void deactivate​(boolean redraw)
        Description copied from interface: IPainter
        Deactivates this painter. If the painter is inactive, this call does not have any effect. redraw indicates whether the painter should remove any decoration it previously applied. A deactivated painter can be reactivated by calling paint.
        Specified by:
        deactivate in interface IPainter
        Parameters:
        redraw - true if any previously applied decoration should be removed
        See Also:
        IPainter.paint(int)
      • dispose

        public void dispose()
        Description copied from interface: IPainter
        Disposes this painter. Prior to disposing, a painter should be deactivated. A disposed painter can not be reactivated.
        Specified by:
        dispose in interface IPainter
        See Also:
        IPainter.deactivate(boolean)
      • paint

        public void paint​(int reason)
        Description copied from interface: IPainter
        Requests this painter to repaint because of the given reason. Based on the given reason the painter can decide whether it will repaint or not. If it repaints and is inactive, it will activate itself.
        Specified by:
        paint in interface IPainter
        Parameters:
        reason - the repaint reason, value is one of the constants defined in this interface
      • setPositionManager

        public void setPositionManager​(IPaintPositionManager manager)
        Description copied from interface: IPainter
        Sets the paint position manager that can be used by this painter or removes any previously set paint position manager.
        Specified by:
        setPositionManager in interface IPainter
        Parameters:
        manager - the paint position manager or null