Package com.google.collide.client.editor

Examples of com.google.collide.client.editor.Buffer$View


    updatePopupDummyElementWidth();
  }

  private void updatePopupDummyElementWidth() {
    if (startAnchor != null && endAnchor != null) {
      Buffer buffer = editor.getBuffer();
      int left = buffer.calculateColumnLeft(startAnchor.getLine(), startAnchor.getColumn());
      popupDummyElement.getStyle().setWidth(
          buffer.calculateColumnLeft(endAnchor.getLine(), endAnchor.getColumn() + 1) - left,
          CSSStyleDeclaration.Unit.PX);
    }
  }
View Full Code Here


    document = createDocument();
    createSelectionModel(document);
  }
 
  private void createSelectionModel(Document document) {
    Buffer buffer = EasyMock.createNiceMock(Buffer.class);
    ListenerManager<MouseDragListener> listener = ListenerManager.create();
    expect(buffer.getMouseDragListenerRegistrar()).andReturn(listener).anyTimes();
    replay(buffer);
    model = SelectionModel.create(document, buffer);
    model.setSelection(document.getFirstLineInfo(), 0, document.getFirstLineInfo(), 0);
  }
View Full Code Here

    if (fileEditSessionKey == null) {
      return;
    }

    SelectionModel selectionModel = editor.getSelection();
    Buffer buffer = editor.getBuffer();

    int cursorLineNumber = selectionModel.getCursorLineNumber();
    int cursorScrollTopOffset = buffer.calculateLineTop(cursorLineNumber) - buffer.getScrollTop();

    selections.put(fileEditSessionKey, new Selection(selectionModel.getBaseLineNumber(),
        selectionModel.getBaseColumn(), cursorLineNumber, selectionModel.getCursorColumn(),
        cursorScrollTopOffset));
  }
View Full Code Here

    // Defer to match editor's initially deferred scrolling
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
      @Override
      public void execute() {
        Buffer buffer = editor.getBuffer();
        int targetScrollTop = buffer.calculateLineTop(cursorLineInfo.number())
            - selection.cursorScrollTopOffset;
        buffer.setScrollTop(Math.max(0, targetScrollTop));
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.google.collide.client.editor.Buffer$View

Copyright © 2018 www.massapicom. 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.