Examples of rightStart()


Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

   */
  private int getLeftLine(int rightLine) {
    RangeDifference d= getRangeDifferenceForRightLine(rightLine);
    if (d == null)
      return -1;
    return Math.min(d.leftEnd() - 1, d.leftStart() + rightLine - d.rightStart());
  }

  /**
   * Gets the corresponding line on the right side for a line on the left.
   *
 
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

   */
  private int getRightLine(int leftLine) {
    RangeDifference d= getRangeDifferenceForLeftLine(leftLine);
    if (d == null)
      return -1;
    return Math.min(d.rightEnd() - 1, d.rightStart() + leftLine - d.leftStart());
  }

  /**
   * Gets the RangeDifference for a line on the left hand side.
   *
 
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

  private RangeDifference getRangeDifferenceForRightLine(int rightLine) {
    final List differences= fDifferences;
    synchronized (differences) {
      for (Iterator it= differences.iterator(); it.hasNext();) {
        RangeDifference d= (RangeDifference) it.next();
        if (rightLine >= d.rightStart() && rightLine < d.rightEnd()) {
          return d;
        }
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

   */
  public Position getPosition(Annotation annotation) {
    if (fRightDocument != null && annotation instanceof DiffRegion) {
      RangeDifference difference= ((DiffRegion)annotation).getDifference();
      try {
        int offset= fRightDocument.getLineOffset(difference.rightStart());
        return new Position(offset, fRightDocument.getLineOffset(difference.rightEnd() - 1) + fRightDocument.getLineLength(difference.rightEnd() - 1) - offset);
      } catch (BadLocationException e) {
        // ignore and return null;
      }
    }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

    if (isSuspended())
      return fLineChangeInfo;

    // try cache first / speeds up linear search
    RangeDifference last= fLastDifference;
    if (last != null && last.rightStart() <= line && last.rightEnd() > line)
      return new DiffRegion(last, line - last.rightStart(), fDifferences, fLeftDocument);

    fLastDifference= getRangeDifferenceForRightLine(line);
    last= fLastDifference;
    if (last != null)
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

      return fLineChangeInfo;

    // try cache first / speeds up linear search
    RangeDifference last= fLastDifference;
    if (last != null && last.rightStart() <= line && last.rightEnd() > line)
      return new DiffRegion(last, line - last.rightStart(), fDifferences, fLeftDocument);

    fLastDifference= getRangeDifferenceForRightLine(line);
    last= fLastDifference;
    if (last != null)
      return new DiffRegion(last, line - last.rightStart(), fDifferences, fLeftDocument);
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

      return new DiffRegion(last, line - last.rightStart(), fDifferences, fLeftDocument);

    fLastDifference= getRangeDifferenceForRightLine(line);
    last= fLastDifference;
    if (last != null)
      return new DiffRegion(last, line - last.rightStart(), fDifferences, fLeftDocument);

    return null;
  }

  /*
 
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

    DiffRegion region= (DiffRegion) getLineInfo(line);
    if (region == null || fRightDocument == null || fLeftDocument == null)
      return;

    RangeDifference diff= region.getDifference();
    int rOffset= fRightDocument.getLineOffset(diff.rightStart());
    int rLength= fRightDocument.getLineOffset(diff.rightEnd() - 1) + fRightDocument.getLineLength(diff.rightEnd() - 1) - rOffset;
    int lOffset= fLeftDocument.getLineOffset(diff.leftStart());
    int lLength= fLeftDocument.getLineOffset(diff.leftEnd() - 1) + fLeftDocument.getLineLength(diff.leftEnd() - 1) - lOffset;
    fRightDocument.replace(rOffset, rLength, fLeftDocument.get(lOffset, lLength));
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

      // get start
      while (it.hasNext()) {
        diff= (RangeDifference) it.next();
        if (line < diff.rightEnd()) {
          rOffset= fRightDocument.getLineOffset(line);
          int leftLine= Math.min(diff.leftStart() + line - diff.rightStart(), diff.leftEnd() - 1);
          lOffset= fLeftDocument.getLineOffset(leftLine);
          break;
        }
      }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference.rightStart()

      while (it.hasNext()) {
        diff= (RangeDifference) it.next();
        if (to < diff.rightEnd()) {
          int rEndOffset= fRightDocument.getLineOffset(to) + fRightDocument.getLineLength(to);
          rLength= rEndOffset - rOffset;
          int leftLine= Math.min(diff.leftStart() + to - diff.rightStart(), diff.leftEnd() - 1);
          int lEndOffset= fLeftDocument.getLineOffset(leftLine) + fLeftDocument.getLineLength(leftLine);
          lLength= lEndOffset - lOffset;
          break;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.