/** * 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(); }
/** * Returns <code>true</code> if <code>range</code> contains <code>line</code>. A line is * not contained in a range if it is the range's exclusive end line. * * @param range the range to check whether it contains <code>line</code> * @param line the line the line * @return <code>true</code> if <code>range</code> contains <code>line</code>, * <code>false</code> if not */ private static boolean contains(ILineRange range, int line) { return range.getStartLine() <= line && end(range) > line; }
/** * Returns <code>true</code> if <code>range</code> contains <code>line</code>. A line is * not contained in a range if it is the range's exclusive end line. * * @param range the range to check whether it contains <code>line</code> * @param line the line the line * @return <code>true</code> if <code>range</code> contains <code>line</code>, * <code>false</code> if not */ private static boolean contains(ILineRange range, int line) { return range.getStartLine() <= line && end(range) > line; }
/** * 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(); }
/** * Returns <code>true</code> if <code>range</code> contains <code>line</code>. A * line is not contained in a range if it is the range's exclusive end line. * * @param range the range to check whether it contains <code>line</code> * @param line the line the line * @return <code>true</code> if <code>range</code> contains <code>line</code>, * <code>false</code> if not */ private static boolean contains(ILineRange range, int line) { return range.getStartLine() <= line && end(range) > line; }
/** * 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(); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { return getProjectionTextAtLine(sourceViewer, lineRange.getStartLine(), visibleLines); }
/** * 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(); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { return getHoverInfoForLine(sourceViewer, lineRange.getStartLine()); }
/** * 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(); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { return getProjectionTextAtLine(sourceViewer, lineRange.getStartLine(), visibleLines); }
private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { return getHoverInfoForLine(sourceViewer, lineRange.getStartLine()); }
private static int end(ILineRange range) { return range.getStartLine() + range.getNumberOfLines(); }
public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { return getHoverInfoForLine(sourceViewer, lineRange.getStartLine()); }
/** * 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 Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleNumberOfLines) { RevisionRange range= getRange(lineRange.getStartLine()); Object info= range == null ? null : range.getRevision().getHoverInfo(); return info; }
@Override public String toString() { return "ChangeRegion [" + fRevision.toString() + ", [" + fLines.getStartLine() + "+" + fLines.getNumberOfLines() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } }
/** * Returns the line coverage of the adjusted ranges, an empty range if the coverage is empty. * * @return the line coverage of the adjusted ranges */ public ILineRange getAdjustedCoverage() { if (fAdjusted.isEmpty()) return new LineRange(fLines.getStartLine(), 0); Range first= fAdjusted.get(0); Range last= fAdjusted.get(fAdjusted.size() - 1); return Range.createAbsolute(first.start(), last.end()); }
/** * 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()); }