Package org.eclipse.jface.text
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
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jface.text.IPainter
CONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
-
-
Constructor Summary
Constructors Constructor Description WhitespaceCharacterPainter(ITextViewer textViewer)Creates a new painter for the given text viewer.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeactivate(boolean redraw)Deactivates this painter.voiddispose()Disposes this painter.voidpaint(int reason)Requests this painter to repaint because of the given reason.voidpaintControl(PaintEvent event)Sent when a paint event occurs for the control.voidsetPositionManager(IPaintPositionManager manager)Sets the paint position manager that can be used by this painter or removes any previously set paint position manager.
-
-
-
Constructor Detail
-
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 toshowLeadingSpaces- iftrue, show leading SpacesshowEnclosedSpaces- iftrue, show enclosed SpacesshowTrailingSpaces- iftrue, show trailing SpacesshowLeadingIdeographicSpaces- iftrue, show leading Ideographic SpacesshowEnclosedIdeographicSpaces- iftrue, show enclosed Ideographic SpacesshowTrailingIdeographicSpace- iftrue, show trailing Ideographic SpacesshowLeadingTabs- iftrue, show leading TabsshowEnclosedTabs- iftrue, show enclosed TabsshowTrailingTabs- iftrue, show trailing TabsshowCarriageReturn- iftrue, show Carriage ReturnsshowLineFeed- iftrue, show Line Feedsalpha- the alpha value- Since:
- 3.7
-
-
Method Detail
-
dispose
public void dispose()
Description copied from interface:IPainterDisposes this painter. Prior to disposing, a painter should be deactivated. A disposed painter can not be reactivated.- Specified by:
disposein interfaceIPainter- See Also:
IPainter.deactivate(boolean)
-
paint
public void paint(int reason)
Description copied from interface:IPainterRequests 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.
-
deactivate
public void deactivate(boolean redraw)
Description copied from interface:IPainterDeactivates this painter. If the painter is inactive, this call does not have any effect.redrawindicates whether the painter should remove any decoration it previously applied. A deactivated painter can be reactivated by callingpaint.- Specified by:
deactivatein interfaceIPainter- Parameters:
redraw-trueif any previously applied decoration should be removed- See Also:
IPainter.paint(int)
-
setPositionManager
public void setPositionManager(IPaintPositionManager manager)
Description copied from interface:IPainterSets the paint position manager that can be used by this painter or removes any previously set paint position manager.- Specified by:
setPositionManagerin interfaceIPainter- Parameters:
manager- the paint position manager ornull
-
paintControl
public void paintControl(PaintEvent event)
Description copied from interface:PaintListenerSent when a paint event occurs for the control.- Specified by:
paintControlin interfacePaintListener- Parameters:
event- an event containing information about the paint
-
-