Codota Logo
ILineRange.getStartLine
Code IndexAdd Codota to your IDE (free)

How to use
getStartLine
method
in
org.eclipse.jface.text.source.ILineRange

Best Java code snippets using org.eclipse.jface.text.source.ILineRange.getStartLine (Showing top 20 results out of 315)

  • Common ways to obtain ILineRange
private void myMethod () {
ILineRange i =
  • Codota Iconnew LineRange(startLine, int1)
  • Codota Iconint lint;Lint lint3;new LineRange(lint, lint3)
  • Codota IconIAnnotationHoverExtension iAnnotationHoverExtension;ISourceViewer viewer;iAnnotationHoverExtension.getHoverLineRange(viewer, lineNumber)
  • Smart code suggestions by Codota
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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();
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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();
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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();
}
origin: angelozerr/jdt-codemining

/**
 * 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();
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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;
}
origin: org.eclipse.platform/org.eclipse.jface.text

@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;
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@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;
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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());
}
origin: org.eclipse.platform/org.eclipse.jface.text

  @Override
  public String toString() {
    return "ChangeRegion [" + fRevision.toString() + ", [" + fLines.getStartLine() + "+" + fLines.getNumberOfLines() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  @Override
  public String toString() {
    return "ChangeRegion [" + fRevision.toString() + ", [" + fLines.getStartLine() + "+" + fLines.getNumberOfLines() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

@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);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@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);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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();
}
origin: org.eclipse/org.eclipse.ui.workbench.texteditor

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());
  }
}
origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

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());
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

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);
}
org.eclipse.jface.text.sourceILineRangegetStartLine

Javadoc

Returns the start line of this line range or -1.

Popular methods of ILineRange

  • getNumberOfLines
    Returns the number of lines of this line range or -1.

Popular in Java

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now