public class CursorLinePainter extends Object implements IPainter, LineBackgroundListener
Clients usually instantiate and configure object of this class.
This class is not intended to be subclassed.
CONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
Constructor and Description |
---|
CursorLinePainter(ITextViewer textViewer)
Creates a new painter for the given source viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
deactivate(boolean redraw)
Deactivates this painter.
|
void |
dispose()
Disposes this painter.
|
void |
lineGetBackground(LineBackgroundEvent event)
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.
|
public CursorLinePainter(ITextViewer textViewer)
textViewer
- the source viewer for which to create a painterpublic void setHighlightColor(Color highlightColor)
highlightColor
- the color in which to draw the background of the cursor linepublic void lineGetBackground(LineBackgroundEvent event)
LineBackgroundListener
The following event fields are used:
lineGetBackground
in interface LineBackgroundListener
event
- the given eventLineBackgroundEvent
public void deactivate(boolean redraw)
IPainter
redraw
indicates whether the painter
should remove any decoration it previously applied. A deactivated painter
can be reactivated by calling paint
.deactivate
in interface IPainter
redraw
- true
if any previously applied decoration
should be removedIPainter.paint(int)
public void dispose()
IPainter
dispose
in interface IPainter
IPainter.deactivate(boolean)
public void paint(int reason)
IPainter
public void setPositionManager(IPaintPositionManager manager)
IPainter
setPositionManager
in interface IPainter
manager
- the paint position manager or null
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.