Package com.google.collide.shared.document

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


    LineInfo lineInfo = startLineInfo.copy();
    do {
      if (!executor.onSearchLine(lineInfo.line(), lineInfo.number(), true)) {
        return false;
      }
    } while (lineInfo.line() != searchDirectionHelper.getViewportEndLine()
        && lineInfo.moveTo(searchDirectionHelper.isGoingDown()));

    /*
     * If we stopped because lineInfo == endline then we need to continue async
     * scanning, otherwise this moveTo call will fail and we won't bother. We
View Full Code Here


      startAnchorLine = searchDirectionHelper.getWrapDocumentLine();
    }

    if (searchTaskAnchor == null) {
      searchTaskAnchor =
          document.getAnchorManager().createAnchor(SEARCH_TASK_ANCHOR, startAnchorLine.line(),
              startAnchorLine.number(), AnchorManager.IGNORE_COLUMN);
      searchTaskAnchor.setRemovalStrategy(RemovalStrategy.SHIFT);
    } else {
      document.getAnchorManager().moveAnchor(searchTaskAnchor, startAnchorLine.line(),
          startAnchorLine.number(), AnchorManager.IGNORE_COLUMN);
View Full Code Here

      searchTaskAnchor =
          document.getAnchorManager().createAnchor(SEARCH_TASK_ANCHOR, startAnchorLine.line(),
              startAnchorLine.number(), AnchorManager.IGNORE_COLUMN);
      searchTaskAnchor.setRemovalStrategy(RemovalStrategy.SHIFT);
    } else {
      document.getAnchorManager().moveAnchor(searchTaskAnchor, startAnchorLine.line(),
          startAnchorLine.number(), AnchorManager.IGNORE_COLUMN);
    }
  }

  private void dispatchSearchBegin() {
View Full Code Here

  private class AsyncSearchTask implements IncrementalScheduler.Task {
    @Override
    public boolean run(int workAmount) {
      LineInfo lineInfo = searchTaskAnchor.getLineInfo();

      for (; lineInfo.line() != stopLineAnchor.getLine() && workAmount > 0; workAmount--) {
        if (!executor.onSearchLine(lineInfo.line(), lineInfo.number(), false)) {
          dispatchSearchDone();
          return false;
        }
View Full Code Here

    @Override
    public boolean run(int workAmount) {
      LineInfo lineInfo = searchTaskAnchor.getLineInfo();

      for (; lineInfo.line() != stopLineAnchor.getLine() && workAmount > 0; workAmount--) {
        if (!executor.onSearchLine(lineInfo.line(), lineInfo.number(), false)) {
          dispatchSearchDone();
          return false;
        }

        if (!lineInfo.moveTo(searchDirectionHelper.isGoingDown())) {
View Full Code Here

            return false;
          }
        }
      }

      if (lineInfo.line() == stopLineAnchor.getLine()) {
        dispatchSearchDone();
        return false;
      }

      document.getAnchorManager().moveAnchor(
View Full Code Here

        dispatchSearchDone();
        return false;
      }

      document.getAnchorManager().moveAnchor(
          searchTaskAnchor, lineInfo.line(), lineInfo.number(), AnchorManager.IGNORE_COLUMN);
      dispatchSearchProgress();
      return true;
    }
  }
}
View Full Code Here

   */
  public void move(MoveAction action, boolean isShiftHeld) {
    boolean shouldUpdatePreferredColumn = true;
    int column = cursorAnchor.getColumn();
    LineInfo lineInfo = cursorAnchor.getLineInfo();
    String lineText = lineInfo.line().getText();

    switch (action) {
      case LEFT:
        column = TextUtils.findPreviousNonMarkNorOtherCharacter(lineText, column);
        break;
View Full Code Here

         * at the end of a word on the line. If this line ends in a* {@code \n}
         * that will cause us to move to the next line when we check
         * {@link LineUtils#getLastCursorColumn} which isn't what we want. So
         * fix it now in case the lines ends in {@code \n}.
         */
        if (column == lineInfo.line().length()) {
          column = rubberbandColumn(lineInfo.line(), column);
        }
        break;

      case WORD_RIGHT:
View Full Code Here

         * that will cause us to move to the next line when we check
         * {@link LineUtils#getLastCursorColumn} which isn't what we want. So
         * fix it now in case the lines ends in {@code \n}.
         */
        if (column == lineInfo.line().length()) {
          column = rubberbandColumn(lineInfo.line(), column);
        }
        break;

      case WORD_RIGHT:
        column = TextUtils.findNextWord(lineText, column, true);
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.