Package org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer

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


      Iterator it= differences.iterator();

      // 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


      // get end / length
      int to= line + nLines - 1;
      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;
View Full Code Here

    RangeDifference diff= null;
    final List differences= fDifferences;
    synchronized (differences) {
      for (Iterator it= differences.iterator(); it.hasNext();) {
        diff= (RangeDifference) it.next();
        if (line >= diff.rightStart() && line < diff.rightEnd()) {
          if (diff.kind() == RangeDifference.NOCHANGE && it.hasNext())
            diff= (RangeDifference) it.next();
          break;
        }
      }
View Full Code Here

    }

    if (diff == null)
      return 0;

    int rOffset= fRightDocument.getLineOffset(diff.rightEnd());
    int rLength= 0;
    int leftLine= diff.leftStart() + diff.rightLength();
    int lOffset= fLeftDocument.getLineOffset(leftLine);
    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

    if (consistentBefore.kind() == RangeDifference.NOCHANGE) {
      int unchanged;
      if (leftToRight)
        unchanged= Math.min(fFirstLine, consistentBefore.leftEnd()) - consistentBefore.leftStart();
      else
        unchanged=  Math.min(fFirstLine, consistentBefore.rightEnd()) - consistentBefore.rightStart();

      shiftBefore= Math.max(0, unchanged - size);
    }

    int shiftAfter= 0;
View Full Code Here

    RangeDifference last= (RangeDifference) diffs.get(diffs.size() - 1);
    if (shiftAfter > 0) {
      if (last.kind() == RangeDifference.NOCHANGE)
        last.extendEnd(shiftAfter);
      else
        diffs.add(new RangeDifference(RangeDifference.NOCHANGE, last.rightEnd(), shiftAfter , last.leftEnd(), shiftAfter));
    }

    // replace changed diff range
    synchronized (fDifferences) {
      final ListIterator it= fDifferences.listIterator();
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.