/** * Installs the painter on the editor. */ private void installPainter() { Assert.isTrue(fWhitespaceCharPainter == null); ITextViewer viewer= getTextViewer(); if (viewer instanceof ITextViewerExtension2) { fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer); ((ITextViewerExtension2)viewer).addPainter(fWhitespaceCharPainter); } }
/** * Installs the painter on the viewer. */ private void installPainter() { Assert.isTrue(whitespaceCharPainter == null); ITextViewer v = getTextViewer(); if (v instanceof ITextViewerExtension2) { whitespaceCharPainter = new WhitespaceCharacterPainter(v); ((ITextViewerExtension2) v).addPainter(whitespaceCharPainter); } }
/** * 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); } } }
/** * Shows the cursor line. */ private void showCursorLine() { if (fCursorLinePainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fCursorLinePainter= new CursorLinePainter(fSourceViewer); fCursorLinePainter.setHighlightColor(getColor(fCursorLinePainterColorKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fCursorLinePainter); } } }
/** * Shows the cursor line. */ private void showCursorLine() { if (fCursorLinePainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fCursorLinePainter= new CursorLinePainter(fSourceViewer); fCursorLinePainter.setHighlightColor(getColor(fCursorLinePainterColorKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fCursorLinePainter); } } }
/** * Shows the cursor line. */ private void showCursorLine() { if (fCursorLinePainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fCursorLinePainter= new CursorLinePainter(fSourceViewer); fCursorLinePainter.setHighlightColor(getColor(fCursorLinePainterColorKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fCursorLinePainter); } } }
/** * Installs the painter on the editor. */ private void installPainter() { Assert.isTrue(fWhitespaceCharPainter == null); ITextViewer viewer= getTextViewer(); if (viewer instanceof ITextViewerExtension2) { if (fStore != null) { fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer, fShowLeadingSpaces, fShowEnclosedSpaces, fShowTrailingSpaces, fShowLeadingIdeographicSpaces, fShowEnclosedIdeographicSpaces, fShowTrailingIdeographicSpace, fShowLeadingTabs, fShowEnclosedTabs, fShowTrailingTabs, fShowCarriageReturn, fShowLineFeed, fAlpha); } else { fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer); } ((ITextViewerExtension2)viewer).addPainter(fWhitespaceCharPainter); } }
/** * Installs the painter on the editor. */ private void installPainter() { Assert.isTrue(fWhitespaceCharPainter == null); ITextViewer viewer= getTextViewer(); if (viewer instanceof ITextViewerExtension2) { if (fStore != null) { fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer, fShowLeadingSpaces, fShowEnclosedSpaces, fShowTrailingSpaces, fShowLeadingIdeographicSpaces, fShowEnclosedIdeographicSpaces, fShowTrailingIdeographicSpace, fShowLeadingTabs, fShowEnclosedTabs, fShowTrailingTabs, fShowCarriageReturn, fShowLineFeed, fAlpha); } else { fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer); } ((ITextViewerExtension2)viewer).addPainter(fWhitespaceCharPainter); } }
private void createCursorLinePainter() { cursorLinePainter = new CursorLinePainter(txtViewer); Color color = new Color(Display.getCurrent(),PreferenceConverter.getColor(store,ILogViewerConstants.PREF_CURSORLINE_COLOR)); cursorLinePainter.setHighlightColor(color); ITextViewerExtension2 extension = (ITextViewerExtension2)txtViewer; extension.addPainter(cursorLinePainter); }
/** * Shows the margin. */ private void showMargin() { if (fMarginPainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fMarginPainter= new MarginPainter(fSourceViewer); fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey)); if (fPreferenceStore != null) fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fMarginPainter); } } }
/** * 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); } } }
/** * Shows the margin. */ private void showMargin() { if (fMarginPainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fMarginPainter= new MarginPainter(fSourceViewer); fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey)); if (fPreferenceStore != null) fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fMarginPainter); fFontPropertyChangeListener= new FontPropertyChangeListener(); JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener); } } }
/** * Shows the margin. */ private void showMargin() { if (fMarginPainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fMarginPainter= new MarginPainter(fSourceViewer); fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey)); if (fPreferenceStore != null) fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey)); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fMarginPainter); fFontPropertyChangeListener= new FontPropertyChangeListener(); JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener); } } }
/** * Enables annotations in the source viewer for the given annotation type. * * @param annotationType the annotation type * @param highlighting <code>true</code> if highlighting <code>false</code> if painting squiggles * @param updatePainter if <code>true</code> update the annotation painter * @since 3.0 */ private void showAnnotations(Object annotationType, boolean highlighting, boolean updatePainter) { if (fSourceViewer instanceof ITextViewerExtension2) { if (fAnnotationPainter == null) { fAnnotationPainter= createAnnotationPainter(); if (fSourceViewer instanceof ITextViewerExtension4) ((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(fAnnotationPainter); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fAnnotationPainter); } fAnnotationPainter.setAnnotationTypeColor(annotationType, getAnnotationTypeColor(annotationType)); if (highlighting) fAnnotationPainter.addHighlightAnnotationType(annotationType); else fAnnotationPainter.addAnnotationType(annotationType, getAnnotationDecorationType(annotationType)); if (updatePainter) updateAnnotationPainter(); } }
/** * Enables annotations in the source viewer for the given annotation type. * * @param annotationType the annotation type * @param updatePainter if <code>true</code> update the annotation painter * @since 3.0 */ private void showAnnotations(Object annotationType, boolean updatePainter) { if (fSourceViewer instanceof ITextViewerExtension2) { if (fAnnotationPainter == null) { fAnnotationPainter= createAnnotationPainter(); if (fSourceViewer instanceof ITextViewerExtension4) ((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(fAnnotationPainter); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fAnnotationPainter); } fAnnotationPainter.setAnnotationTypeColor(annotationType, getAnnotationTypeColor(annotationType)); Object decorationType= getAnnotationDecorationType(annotationType); if (decorationType != null) fAnnotationPainter.addAnnotationType(annotationType, decorationType); else fAnnotationPainter.addHighlightAnnotationType(annotationType); if (updatePainter) updateAnnotationPainter(); } }
/** * Enables annotations in the source viewer for the given annotation type. * * @param annotationType the annotation type * @param updatePainter if <code>true</code> update the annotation painter * @since 3.0 */ private void showAnnotations(Object annotationType, boolean updatePainter) { if (fSourceViewer instanceof ITextViewerExtension2) { if (fAnnotationPainter == null) { fAnnotationPainter= createAnnotationPainter(); if (fSourceViewer instanceof ITextViewerExtension4) ((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(fAnnotationPainter); ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer; extension.addPainter(fAnnotationPainter); if (fSourceViewer instanceof ISourceViewerExtension5) ((ISourceViewerExtension5) fSourceViewer).setCodeMiningAnnotationPainter(fAnnotationPainter); } fAnnotationPainter.setAnnotationTypeColor(annotationType, getAnnotationTypeColor(annotationType)); Object decorationType= getAnnotationDecorationType(annotationType); if (decorationType != null) fAnnotationPainter.addAnnotationType(annotationType, decorationType); else fAnnotationPainter.addHighlightAnnotationType(annotationType); if (updatePainter) updateAnnotationPainter(); } }