/** * Enables showing of matching characters. */ private void showMatchingCharacters() { if (fMatchingCharacterPainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fMatchingCharacterPainter= new MatchingCharacterPainter(fSourceViewer, fCharacterPairMatcher); fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fMatchingCharacterPainter); } } }
/** * 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); } } }
/** * 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); } } }
fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey)); fMatchingCharacterPainter.paint(IPainter.CONFIGURATION);
fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey)); fMatchingCharacterPainter.paint(IPainter.CONFIGURATION);
fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey)); fMatchingCharacterPainter.paint(IPainter.CONFIGURATION);
/** * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument) */ public void setDocument( IDocument document ) { if ( sourceViewer.getAnnotationModel() == null ) { IAnnotationModel model = new AnnotationModel(); sourceViewer.setDocument( sourceViewer.getDocument(), model ); } // add annotation painter if ( paintManager == null && sourceViewer.getAnnotationModel() instanceof IAnnotationModelExtension ) { AnnotationPainter ap = new AnnotationPainter( sourceViewer, null ); ap.addAnnotationType( "DEFAULT" ); //$NON-NLS-1$ ap.setAnnotationTypeColor( "DEFAULT", BrowserCommonActivator.getDefault().getColor( new RGB( 255, 0, 0 ) ) ); //$NON-NLS-1$ sourceViewer.getAnnotationModel().addAnnotationModelListener( ap ); FilterCharacterPairMatcher cpm = new FilterCharacterPairMatcher( sourceViewer, parser ); MatchingCharacterPainter mcp = new MatchingCharacterPainter( sourceViewer, cpm ); mcp.setColor( BrowserCommonActivator.getDefault().getColor( new RGB( 159, 159, 159 ) ) ); paintManager = new PaintManager( sourceViewer ); paintManager.addPainter( ap ); paintManager.addPainter( mcp ); } }