/** * Computes the end index of a line range. * * @param range a line range * @return the last line (exclusive) of <code>range</code> */ private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
/** * Computes the end index of a line range. * * @param range a line range * @return the last line (exclusive) of <code>range</code> */ private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
/** * Computes the end index of a line range. * * @param range a line range * @return the last line (exclusive) of <code>range</code> */ private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
/** * Computes the end index of a line range. * * @param range a line range * @return the last line (exclusive) of <code>range</code> */ private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
/** * Computes the end index of a line range. * * @param range a line range * @return the last line (exclusive) of <code>range</code> */ private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
RevisionRange(Revision revision, ILineRange range) { Assert.isLegal(revision != null); fRevision= revision; fStartLine= range.getStartLine(); fNumberOfLines= range.getNumberOfLines(); }
/** * Creates a new range with the same start and length as the passed line range. * * @param range the range to copy * @return a <code>Range</code> with the same start and length as <code>range</code> * @throws LineIndexOutOfBoundsException if the passed {@link ILineRange} does not adhere to the * contract of {@link Range} */ public static Range copy(ILineRange range) throws LineIndexOutOfBoundsException { return createRelative(range.getStartLine(), range.getNumberOfLines()); }
/** * Creates a new range with the same start and length as the passed line range. * * @param range the range to copy * @return a <code>Range</code> with the same start and length as <code>range</code> * @throws LineIndexOutOfBoundsException if the passed {@link ILineRange} does not adhere to the * contract of {@link Range} */ public static Range copy(ILineRange range) throws LineIndexOutOfBoundsException { return createRelative(range.getStartLine(), range.getNumberOfLines()); }
@Override public String toString() { return "ChangeRegion [" + fRevision.toString() + ", [" + fLines.getStartLine() + "+" + fLines.getNumberOfLines() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } }
@Override public String toString() { return "ChangeRegion [" + fRevision.toString() + ", [" + fLines.getStartLine() + "+" + fLines.getNumberOfLines() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } }
RevisionRange(Revision revision, ILineRange range) { Assert.isLegal(revision != null); fRevision= revision; fStartLine= range.getStartLine(); fNumberOfLines= range.getNumberOfLines(); }
/** * Returns <code>true</code> if the passed range has the same offset and length as the receiver. * * @param range another line range to compare the receiver to * @return <code>true</code> if <code>range</code> has the same offset and length as the receiver */ public boolean equalRange(ILineRange range) { if (range == this) return true; if (range == null) return false; return range.getStartLine() == start() && range.getNumberOfLines() == length(); }
public DocEquivalenceComparator(DocumentEquivalenceClass equivalenceClass, ILineRange range) { fEquivalenceClass= equivalenceClass; if (range == null) { fLineOffset= 0; fLines= fEquivalenceClass.getCount(); } else { fLineOffset= range.getStartLine(); fLines= range.getNumberOfLines(); Assert.isTrue(fLineOffset >= 0); Assert.isTrue(fLineOffset + fLines <= fEquivalenceClass.getCount()); } }
public DocEquivalenceComparator(DocumentEquivalenceClass equivalenceClass, ILineRange range) { fEquivalenceClass= equivalenceClass; if (range == null) { fLineOffset= 0; fLines= fEquivalenceClass.getCount(); } else { fLineOffset= range.getStartLine(); fLines= range.getNumberOfLines(); Assert.isTrue(fLineOffset >= 0); Assert.isTrue(fLineOffset + fLines <= fEquivalenceClass.getCount()); } }
public DocEquivalenceComparator(DocumentEquivalenceClass equivalenceClass, ILineRange range) { fEquivalenceClass= equivalenceClass; if (range == null) { fLineOffset= 0; fLines= fEquivalenceClass.getCount(); } else { fLineOffset= range.getStartLine(); fLines= range.getNumberOfLines(); Assert.isTrue(fLineOffset >= 0); Assert.isTrue(fLineOffset + fLines <= fEquivalenceClass.getCount()); } }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { int first= adaptFirstLine(sourceViewer, lineRange.getStartLine()); int last= adaptLastLine(sourceViewer, lineRange.getStartLine() + lineRange.getNumberOfLines() - 1); String content= computeContent(sourceViewer, first, last, visibleLines); return formatSource(content); }
private IRegion getRegion(IDocument document, ILineRange lineRange) throws BadLocationException { final int startLine= lineRange.getStartLine(); int offset= document.getLineOffset(startLine); final int numberOfLines= lineRange.getNumberOfLines(); if (numberOfLines < 1) return new Region(offset, 0); int endLine= startLine + numberOfLines - 1; int endOffset= document.getLineOffset(endLine) + document.getLineLength(endLine); return new Region(offset, endOffset - offset); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { int first= adaptFirstLine(sourceViewer, lineRange.getStartLine()); int last= adaptLastLine(sourceViewer, lineRange.getStartLine() + lineRange.getNumberOfLines() - 1); String content= computeContent(sourceViewer, first, last, visibleLines); return formatSource(content); }
/** * Computes and returns the bounds of the rectangle corresponding to a widget line range. The * rectangle is in pixel coordinates relative to the text widget's * {@link StyledText#getClientArea() client area} and has the width of the ruler. * * @param range the widget line range * @return the box bounds corresponding to <code>range</code> */ private Rectangle computeBoxBounds(ILineRange range) { int y1= fWidget.getLinePixel(range.getStartLine()); int y2= fWidget.getLinePixel(range.getStartLine() + range.getNumberOfLines()); return new Rectangle(0, y1, getWidth(), y2 - y1 - 1); }
/** * Computes and returns the bounds of the rectangle corresponding to a widget line range. The * rectangle is in pixel coordinates relative to the text widget's * {@link StyledText#getClientArea() client area} and has the width of the ruler. * * @param range the widget line range * @return the box bounds corresponding to <code>range</code> */ private Rectangle computeBoxBounds(ILineRange range) { int y1= fWidget.getLinePixel(range.getStartLine()); int y2= fWidget.getLinePixel(range.getStartLine() + range.getNumberOfLines()); return new Rectangle(0, autoScaleUp(y1), autoScaleUp(getWidth()), autoScaleUp(y2 - y1 - 1)); }