Package com.google.collide.shared.document

Examples of com.google.collide.shared.document.LineInfo.line()


    LineInfo curLine = start.getLineInfo();
    curLine.moveTo(iterateForward);

    while (curLine.line() != end.getLine()) {
      if (!lineVisitor.accept(curLine.line(), curLine.number(), 0, curLine.line().length())) {
        return;
      }

      if (!curLine.moveTo(iterateForward)) {
        throw new IllegalStateException(
View Full Code Here


    if (beginLineNumber <= viewport.getBottomLineNumber()) {
      // Only fill or update lines if the content change affects the viewport
      LineInfo beginLine =
          viewport.getDocument().getLineFinder().findLine(viewport.getBottom(), beginLineNumber);
      animationController.onBeforeAnimationStarted();
      fillOrUpdateLines(beginLine.line(), beginLine.number(), viewport.getBottomLine(),
          viewport.getBottomLineNumber(), createOffset);
    }
  }

  void renderViewportLineNumbersChanged(EnumSet<Edge> changedEdges) {
View Full Code Here

       * Collaborator added/removed lines above us, update the viewport lines
       * since their tops may have changed
       */
      LineInfo top = viewport.getTop();
      LineInfo bottom = viewport.getBottom();
      fillOrUpdateLines(top.line(), top.number(), bottom.line(), bottom.number(), 0);
    }
  }
 
  /**
   * Renders changes to the viewport positioning.
View Full Code Here

       */
      if (oldTop != null && oldBottom != null) {
        garbageCollectLines(oldTop.line(), oldTop.number(), oldBottom.line(), oldBottom.number());
      }

      fillOrUpdateLines(top.line(), top.number(), bottom.line(), bottom.number(), 0);

    } else {
      // There is some overlap, so be more efficient with our update
      if (oldTop.number() < top.number()) {
        // The viewport moved down, need to GC the offscreen lines
View Full Code Here

            oldTop.number() - 1, 0);
      }

      if (oldBottom.number() < bottom.number()) {
        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
        garbageCollectLines(bottom.line().getNextLine(), bottom.number() + 1, oldBottom.line(),
            oldBottom.number());
View Full Code Here

        // The viewport moved down, need to fill with lines
        fillOrUpdateLines(oldBottom.line().getNextLine(), oldBottom.number() + 1, bottom.line(),
            bottom.number(), 0);
      } else if (oldBottom.number() > bottom.number()) {
        // The viewport moved up, need to GC the offscreen lines
        garbageCollectLines(bottom.line().getNextLine(), bottom.number() + 1, oldBottom.line(),
            oldBottom.number());
      }
    }
  }
View Full Code Here

            lineInfo.line().getText());
        column = (column != firstNonWhitespaceColumn) ? firstNonWhitespaceColumn : 0;
        break;

      case LINE_END:
        column = LineUtils.getLastCursorColumn(lineInfo.line());
        break;

      case TEXT_START:
        lineInfo = new LineInfo(document.getFirstLine(), 0);
        column = 0;
View Full Code Here

        column = 0;
        break;

      case TEXT_END:
        lineInfo = new LineInfo(document.getLastLine(), document.getLineCount() - 1);
        column = LineUtils.getLastCursorColumn(lineInfo.line());
        break;
    }

    if (column < 0) {
      if (lineInfo.moveToPrevious()) {
View Full Code Here

        break;
    }

    if (column < 0) {
      if (lineInfo.moveToPrevious()) {
        column = getLastCursorColumn(lineInfo.line());
      } else {
        column = 0;
      }
    } else if (column > getLastCursorColumn(lineInfo.line())) {
      if (lineInfo.moveToNext()) {
View Full Code Here

      if (lineInfo.moveToPrevious()) {
        column = getLastCursorColumn(lineInfo.line());
      } else {
        column = 0;
      }
    } else if (column > getLastCursorColumn(lineInfo.line())) {
      if (lineInfo.moveToNext()) {
        column = LineUtils.getFirstCursorColumn(lineInfo.line());
      } else {
        column = rubberbandColumn(lineInfo.line(), column);
      }
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.