public class MarginPainter extends Object implements IPainter, PaintListener
Clients usually instantiate and configure objects of this class.
This class is not intended to be subclassed.
CONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
Constructor and Description |
---|
MarginPainter(ITextViewer textViewer)
Creates a new painter for the given text viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
deactivate(boolean redraw)
Deactivates this painter.
|
void |
dispose()
Disposes this painter.
|
void |
initialize()
Initializes this painter, by flushing and recomputing all caches and causing
the widget to be redrawn.
|
void |
paint(int reason)
Requests this painter to repaint because of the given reason.
|
void |
paintControl(PaintEvent e)
Sent when a paint event occurs for the control.
|
void |
setMarginRulerColor(Color color)
Sets the color of the margin line.
|
void |
setMarginRulerColumn(int width)
Sets the column after which to draw the margin line.
|
void |
setMarginRulerStyle(int lineStyle)
Sets the line style of the margin line.
|
void |
setMarginRulerWidth(int lineWidth)
Sets the line width of the margin 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 MarginPainter(ITextViewer textViewer)
textViewer
- the text viewerpublic void setMarginRulerColumn(int width)
width
- the columnpublic void setMarginRulerStyle(int lineStyle)
lineStyle
- a SWT
style constant describing the line stylepublic void setMarginRulerWidth(int lineWidth)
lineWidth
- the line widthpublic void setMarginRulerColor(Color color)
paint
is called the first time.color
- the colorpublic void initialize()
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 paintControl(PaintEvent e)
PaintListener
paintControl
in interface PaintListener
e
- an event containing information about the paintpublic void setPositionManager(IPaintPositionManager manager)
IPainter
setPositionManager
in interface IPainter
manager
- the paint position manager or null
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.