@Override public String toString() { return "Revision " + getId(); //$NON-NLS-1$ }
@Override public String toString() { return "Revision " + getId(); //$NON-NLS-1$ }
/** * 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; }
/** * Handles the selection of a revision id and informs listeners * * @param id the selected revision id */ void handleRevisionSelected(String id) { Assert.isLegal(id != null); if (fRevisionInfo == null) return; for (Iterator<Revision> it= fRevisionInfo.getRevisions().iterator(); it.hasNext();) { Revision revision= it.next(); if (id.equals(revision.getId())) { handleRevisionSelected(revision); return; } } // clear selection if it does not exist handleRevisionSelected((Revision) null); }
/** * 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; }
IRegion charRegion= toCharRegion(range); Position position= new Position(charRegion.getOffset(), charRegion.getLength()); Annotation annotation= new RevisionAnnotation(revision.getId()); added.put(annotation, position); } catch (BadLocationException x) {
/** * Handles the selection of a revision id and informs listeners * * @param id the selected revision id */ void handleRevisionSelected(String id) { Assert.isLegal(id != null); if (fRevisionInfo == null) return; for (Revision revision : fRevisionInfo.getRevisions()) { if (id.equals(revision.getId())) { handleRevisionSelected(revision); return; } } // clear selection if it does not exist handleRevisionSelected((Revision) null); }
IRegion charRegion= toCharRegion(range); Position position= new Position(charRegion.getOffset(), charRegion.getLength()); Annotation annotation= new RevisionAnnotation(revision.getId()); added.put(annotation, position); } catch (BadLocationException x) {
int baselineBias= getBaselineBias(gc, widgetRange.getStartLine()); if (fShowAuthor && fShowRevision) { gc.drawString(revision.getId(), indentation, box.y + baselineBias, true); gc.drawString(revision.getAuthor(), fAuthorInset, box.y + baselineBias, true); } else if (fShowAuthor) { gc.drawString(revision.getAuthor(), indentation, box.y + baselineBias, true); } else if (fShowRevision) { gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);
int baselineBias= getBaselineBias(gc, widgetRange.getStartLine()); if (fShowAuthor && fShowRevision) { gc.drawString(revision.getId(), indentation, box.y + baselineBias, true); gc.drawString(revision.getAuthor(), fAuthorInset, box.y + baselineBias, true); } else if (fShowAuthor) { gc.drawString(revision.getAuthor(), indentation, box.y + baselineBias, true); } else if (fShowRevision) { gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);