use of org.eclipse.jface.text.source.MatchingCharacterPainter in project eclipse.platform.text by eclipse.
the class BracketMatchingReconciler method install.
@Override
public void install(ITextViewer textViewer) {
if (textViewer instanceof ITextViewerExtension2 && textViewer instanceof SourceViewer) {
fSourceViewer = (SourceViewer) textViewer;
fMatchingCharacterPainter = new MatchingCharacterPainter(fSourceViewer, fCharacterPairMatcher);
fMatchingCharacterPainter.setColor(new Color(Display.getCurrent(), fBoxingRGB));
fMatchingCharacterPainter.setHighlightCharacterAtCaretLocation(true);
fMatchingCharacterPainter.setHighlightEnclosingPeerCharacters(true);
fSourceViewer.addPainter(fMatchingCharacterPainter);
}
}
use of org.eclipse.jface.text.source.MatchingCharacterPainter in project eclipse.platform.text by eclipse.
the class SourceViewerDecorationSupport method showMatchingCharacters.
/**
* Enables showing of matching characters.
*/
private void showMatchingCharacters() {
if (fMatchingCharacterPainter == null) {
if (fSourceViewer instanceof ITextViewerExtension2) {
fMatchingCharacterPainter = new MatchingCharacterPainter(fSourceViewer, fCharacterPairMatcher);
fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey));
fMatchingCharacterPainter.setHighlightCharacterAtCaretLocation(isCharacterAtCaretLocationShown());
fMatchingCharacterPainter.setHighlightEnclosingPeerCharacters(areEnclosingPeerCharactersShown());
ITextViewerExtension2 extension = (ITextViewerExtension2) fSourceViewer;
extension.addPainter(fMatchingCharacterPainter);
}
}
}
Aggregations