Class WhitespaceCharacterPainter

java.lang.Object
org.eclipse.jface.text.WhitespaceCharacterPainter
All Implemented Interfaces:
EventListener, IPainter, PaintListener, SWTEventListener

public class WhitespaceCharacterPainter extends Object implements IPainter, PaintListener
A painter for drawing visible characters for (invisible) whitespace characters.
Since:
3.3
  • Constructor Details

    • WhitespaceCharacterPainter

      public WhitespaceCharacterPainter(ITextViewer textViewer)
      Creates a new painter for the given text viewer.
      Parameters:
      textViewer - the text viewer the painter should be attached to
    • WhitespaceCharacterPainter

      public WhitespaceCharacterPainter(ITextViewer viewer, boolean showLeadingSpaces, boolean showEnclosedSpaces, boolean showTrailingSpaces, boolean showLeadingIdeographicSpaces, boolean showEnclosedIdeographicSpaces, boolean showTrailingIdeographicSpace, boolean showLeadingTabs, boolean showEnclosedTabs, boolean showTrailingTabs, boolean showCarriageReturn, boolean showLineFeed, int alpha)
      Creates a new painter for the given text viewer and the painter options.
      Parameters:
      viewer - the text viewer the painter should be attached to
      showLeadingSpaces - if true, show leading Spaces
      showEnclosedSpaces - if true, show enclosed Spaces
      showTrailingSpaces - if true, show trailing Spaces
      showLeadingIdeographicSpaces - if true, show leading Ideographic Spaces
      showEnclosedIdeographicSpaces - if true, show enclosed Ideographic Spaces
      showTrailingIdeographicSpace - if true, show trailing Ideographic Spaces
      showLeadingTabs - if true, show leading Tabs
      showEnclosedTabs - if true, show enclosed Tabs
      showTrailingTabs - if true, show trailing Tabs
      showCarriageReturn - if true, show Carriage Returns
      showLineFeed - if true, show Line Feeds
      alpha - the alpha value
      Since:
      3.7
  • Method Details

    • 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:
    • 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
    • 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:
    • 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
    • paintControl

      public void paintControl(PaintEvent event)
      Description copied from interface: PaintListener
      Sent when a paint event occurs for the control.
      Specified by:
      paintControl in interface PaintListener
      Parameters:
      event - an event containing information about the paint