public final class MatchingCharacterPainter extends Object implements IPainter, PaintListener
ICharacterPairMatcher
or an
ICharacterPairMatcherExtension
.
Clients instantiate and configure an object of this class.
CONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
Constructor and Description |
---|
MatchingCharacterPainter(ISourceViewer sourceViewer,
ICharacterPairMatcher matcher)
Creates a new MatchingCharacterPainter for the given source viewer using the given character
pair matcher.
|
Modifier and Type | Method and Description |
---|---|
void |
deactivate(boolean redraw)
Deactivates this painter.
|
void |
dispose()
Disposes this painter.
|
void |
paint(int reason)
Requests this painter to repaint because of the given reason.
|
void |
paintControl(PaintEvent event)
Sent when a paint event occurs for the control.
|
void |
setColor(Color color)
Sets the color in which to highlight the match character.
|
void |
setHighlightCharacterAtCaretLocation(boolean highlightCharacterAtCaretLocation)
Sets whether to highlight the character at caret location or not.
|
void |
setHighlightEnclosingPeerCharacters(boolean highlightEnclosingPeerCharcters)
Sets whether to highlight enclosing peer characters or not.
|
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 MatchingCharacterPainter(ISourceViewer sourceViewer, ICharacterPairMatcher matcher)
sourceViewer
- the source viewermatcher
- the character pair matcherpublic void setHighlightCharacterAtCaretLocation(boolean highlightCharacterAtCaretLocation)
highlightCharacterAtCaretLocation
- whether to highlight the character at caret location
or notpublic void setHighlightEnclosingPeerCharacters(boolean highlightEnclosingPeerCharcters)
highlightEnclosingPeerCharcters
- whether to highlight enclosing peer characters or notpublic void setColor(Color color)
color
- the colorpublic void dispose()
IPainter
dispose
in interface IPainter
IPainter.deactivate(boolean)
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 paintControl(PaintEvent event)
PaintListener
paintControl
in interface PaintListener
event
- an event containing information about the paintpublic 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.