Package org.eclipse.jface.text.source
Class MatchingCharacterPainter
java.lang.Object
org.eclipse.jface.text.source.MatchingCharacterPainter
- All Implemented Interfaces:
- EventListener,- IPainter,- PaintListener
Highlights the peer character matching the character near the caret position, or a pair of peer
 characters enclosing the caret position. This painter can be configured with an
 
ICharacterPairMatcher or an
 ICharacterPairMatcherExtension.
 Clients instantiate and configure an object of this class.
- Since:
- 2.1
- 
Field SummaryFields inherited from interface org.eclipse.jface.text.IPainterCONFIGURATION, INTERNAL, KEY_STROKE, MOUSE_BUTTON, SELECTION, TEXT_CHANGE
- 
Constructor SummaryConstructorsConstructorDescriptionMatchingCharacterPainter(ISourceViewer sourceViewer, ICharacterPairMatcher matcher) Creates a new MatchingCharacterPainter for the given source viewer using the given character pair matcher.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeactivate(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.voidSets the color in which to highlight the match character.voidsetHighlightCharacterAtCaretLocation(boolean highlightCharacterAtCaretLocation) Sets whether to highlight the character at caret location or not.voidsetHighlightEnclosingPeerCharacters(boolean highlightEnclosingPeerCharcters) Sets whether to highlight enclosing peer characters or not.voidsetPositionManager(IPaintPositionManager manager) Sets the paint position manager that can be used by this painter or removes any previously set paint position manager.
- 
Constructor Details- 
MatchingCharacterPainterCreates a new MatchingCharacterPainter for the given source viewer using the given character pair matcher. The character matcher is not adopted by this painter. Thus, it is not disposed. However, this painter requires exclusive access to the given pair matcher.- Parameters:
- sourceViewer- the source viewer
- matcher- the character pair matcher
 
 
- 
- 
Method Details- 
setHighlightCharacterAtCaretLocationpublic void setHighlightCharacterAtCaretLocation(boolean highlightCharacterAtCaretLocation) Sets whether to highlight the character at caret location or not.- Parameters:
- highlightCharacterAtCaretLocation- whether to highlight the character at caret location or not
- Since:
- 3.8
 
- 
setHighlightEnclosingPeerCharacterspublic void setHighlightEnclosingPeerCharacters(boolean highlightEnclosingPeerCharcters) Sets whether to highlight enclosing peer characters or not.- Parameters:
- highlightEnclosingPeerCharcters- whether to highlight enclosing peer characters or not
- Since:
- 3.8
 
- 
setColorSets the color in which to highlight the match character.- Parameters:
- color- the color
 
- 
disposepublic void dispose()Description copied from interface:IPainterDisposes this painter. Prior to disposing, a painter should be deactivated. A disposed painter can not be reactivated.
- 
deactivatepublic 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 interface- IPainter
- Parameters:
- redraw-- trueif any previously applied decoration should be removed
- See Also:
 
- 
paintControlDescription copied from interface:PaintListenerSent when a paint event occurs for the control.- Specified by:
- paintControlin interface- PaintListener
- Parameters:
- event- an event containing information about the paint
 
- 
paintpublic 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.
- 
setPositionManagerDescription 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 interface- IPainter
- Parameters:
- manager- the paint position manager or- null
 
 
-