Package org.eclipse.jface.text
Class CursorLinePainter
java.lang.Object
org.eclipse.jface.text.CursorLinePainter
- All Implemented Interfaces:
EventListener
,IPainter
,LineBackgroundListener
,SWTEventListener
A painter the draws the background of the caret line in a configured color.
Clients usually instantiate and configure object of this class.
This class is not intended to be subclassed.
- Since:
- 2.1
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from interface org.eclipse.jface.text.IPainter
CONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
-
Constructor Summary
ConstructorDescriptionCursorLinePainter
(ITextViewer textViewer) Creates a new painter for the given source viewer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
deactivate
(boolean redraw) Deactivates this painter.void
dispose()
Disposes this painter.void
This method is called when a line is about to be drawn in order to get its background color.void
paint
(int reason) Requests this painter to repaint because of the given reason.void
setHighlightColor
(Color highlightColor) Sets the color in which to draw the background of the cursor line.void
setPositionManager
(IPaintPositionManager manager) Sets the paint position manager that can be used by this painter or removes any previously set paint position manager.
-
Constructor Details
-
CursorLinePainter
Creates a new painter for the given source viewer.- Parameters:
textViewer
- the source viewer for which to create a painter
-
-
Method Details
-
setHighlightColor
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
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 interfaceLineBackgroundListener
- Parameters:
event
- the given event- See Also:
-
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 callingpaint
.- Specified by:
deactivate
in interfaceIPainter
- Parameters:
redraw
-true
if any previously applied decoration should be removed- See Also:
-
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. -
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. -
setPositionManager
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 interfaceIPainter
- Parameters:
manager
- the paint position manager ornull
-