/** * Returns <code>true</code> if the ruler is showing revision information, <code>false</code> * otherwise * * @return <code>true</code> if revision information is shown, <code>false</code> otherwise * @since 3.3 */ public boolean isShowingRevisionInformation() { return fRevisionPainter.hasInformation(); }
/** * Returns <code>true</code> if the ruler is showing revision information, <code>false</code> * otherwise * * @return <code>true</code> if revision information is shown, <code>false</code> otherwise * @since 3.3 */ public boolean isShowingRevisionInformation() { return fRevisionPainter.hasInformation(); }
/** * Returns the width in chars required to display information. * * @return the width in chars required to display information * @since 3.3 */ public int getRequiredWidth() { if (fRequiredWidth == -1) { if (hasInformation() && (fShowRevision || fShowAuthor)) { int revisionWidth= 0; int authorWidth= 0; for (Iterator<Revision> it= fRevisionInfo.getRevisions().iterator(); it.hasNext();) { Revision revision= it.next(); revisionWidth= Math.max(revisionWidth, revision.getId().length()); authorWidth= Math.max(authorWidth, revision.getAuthor().length()); } fRevisionIdChars= revisionWidth + 1; if (fShowAuthor && fShowRevision) fRequiredWidth= revisionWidth + authorWidth + 2; else if (fShowAuthor) fRequiredWidth= authorWidth + 1; else fRequiredWidth= revisionWidth + 1; } else { fRequiredWidth= 0; } } return fRequiredWidth; }
/** * Returns the width in chars required to display information. * * @return the width in chars required to display information * @since 3.3 */ public int getRequiredWidth() { if (fRequiredWidth == -1) { if (hasInformation() && (fShowRevision || fShowAuthor)) { int revisionWidth= 0; int authorWidth= 0; for (Revision revision : fRevisionInfo.getRevisions()) { revisionWidth= Math.max(revisionWidth, revision.getId().length()); authorWidth= Math.max(authorWidth, revision.getAuthor().length()); } fRevisionIdChars= revisionWidth + 1; if (fShowAuthor && fShowRevision) fRequiredWidth= revisionWidth + authorWidth + 2; else if (fShowAuthor) fRequiredWidth= authorWidth + 1; else fRequiredWidth= revisionWidth + 1; } else { fRequiredWidth= 0; } } return fRequiredWidth; }
@Override protected int computeNumberOfDigits() { int digits; if (fCharacterDisplay && getModel() != null) { if (fShowNumbers) digits= super.computeNumberOfDigits() + 1; else digits= 1; } else { if (fShowNumbers) digits= super.computeNumberOfDigits(); else digits= 0; } if (fRevisionPainter.hasInformation()) digits+= fRevisionPainter.getRequiredWidth(); return digits; }
@Override protected int computeNumberOfDigits() { int digits; if (fCharacterDisplay && getModel() != null) { if (fShowNumbers) digits= super.computeNumberOfDigits() + 1; else digits= 1; } else { if (fShowNumbers) digits= super.computeNumberOfDigits(); else digits= 0; } if (fRevisionPainter.hasInformation()) digits+= fRevisionPainter.getRequiredWidth(); return digits; }
/** * Draws the ruler column. * * @param gc the GC to draw into */ private void doPaint(GC gc) { ILineRange visibleModelLines= computeVisibleModelLines(); if (visibleModelLines == null) return; fSensitiveToTextChanges= isViewerCompletelyShown(); fScrollPos= fCachedTextWidget.getTopPixel(); fRevisionPainter.paint(gc, visibleModelLines); if (!fRevisionPainter.hasInformation()) // don't paint quick diff colors if revisions are painted fDiffPainter.paint(gc, visibleModelLines); }
/** * Draws the ruler column. * * @param gc the GC to draw into */ private void doPaint(GC gc) { ILineRange visibleModelLines= computeVisibleModelLines(); if (visibleModelLines == null) return; fSensitiveToTextChanges= isViewerCompletelyShown(); fScrollPos= fCachedTextWidget.getTopPixel(); fRevisionPainter.paint(gc, visibleModelLines); if (!fRevisionPainter.hasInformation()) // don't paint quick diff colors if revisions are painted fDiffPainter.paint(gc, visibleModelLines); }
@Override void doPaint(GC gc, ILineRange visibleLines) { Color foreground= gc.getForeground(); if (visibleLines != null) { if (fRevisionPainter.hasInformation()) fRevisionPainter.paint(gc, visibleLines); else if (fDiffPainter.hasInformation()) // don't paint quick diff colors if revisions are painted fDiffPainter.paint(gc, visibleLines); } gc.setForeground(foreground); if (fShowNumbers || fCharacterDisplay) super.doPaint(gc, visibleLines); }
@Override void doPaint(GC gc, ILineRange visibleLines) { Color foreground= gc.getForeground(); if (visibleLines != null) { if (fRevisionPainter.hasInformation()) { fRevisionPainter.setZoom(fZoom); fRevisionPainter.paint(gc, visibleLines); } else if (fDiffPainter.hasInformation()) { // don't paint quick diff colors if revisions are painted fDiffPainter.setZoom(fZoom); fDiffPainter.paint(gc, visibleLines); } } gc.setForeground(foreground); if (fShowNumbers || fCharacterDisplay) super.doPaint(gc, visibleLines); }