Package org.waveprotocol.wave.client.editor

Examples of org.waveprotocol.wave.client.editor.EditorContext


  /**
   * @param editorDiv editor
   * @param end end of selection range
   */
  public static void webdriverEditorSetSelection(Element editorDiv, int start, int end) {
    EditorContext editor = getByEditorDiv(editorDiv);
    editor.getSelectionHelper().setSelectionRange(new FocusedRange(start, end));
  }
View Full Code Here


  }

  @Override
  public void onUpdate(EditorUpdateEvent event) {
    if (event.selectionLocationChanged()) {
      EditorContext context = event.context();

      // Special case to exempt caret annotations from being undoable.
      context.getResponsibilityManager().startIndirectSequence();
      try {
        writeSelection(context);
      } finally {
        context.getResponsibilityManager().endIndirectSequence();
      }
    }
  }
View Full Code Here

      // The simpler approach is to do nothing, and let the user upload the
      // file again if it still makes sense (the blip in which they intended it
      // to go has been deleted, so they may not want to upload it anymore).
      return;
    }
    EditorContext context = edit.getEditor();
    CMutableDocument doc = context.getDocument();
    FocusedContentRange selection = context.getSelectionHelper().getSelectionPoints();
    Point<ContentNode> point;
    if (selection != null) {
      point = selection.getFocus();
    } else {
      // Focus was probably lost.  Bring it back.
      context.focus(false);
      selection = context.getSelectionHelper().getSelectionPoints();
      if (selection != null) {
        point = selection.getFocus();
      } else {
        // Still no selection.  Oh well, put it at the end.
        point = doc.locate(doc.size() - 1);
View Full Code Here

  /**
   * @param editorDiv editor
   * @param end end of selection range
   */
  public static void webdriverEditorSetSelection(Element editorDiv, int start, int end) {
    EditorContext editor = getByEditorDiv(editorDiv);
    editor.getSelectionHelper().setSelectionRange(new FocusedRange(start, end));
  }
View Full Code Here

  }

  @Override
  public void onUpdate(EditorUpdateEvent event) {
    if (event.selectionLocationChanged()) {
      EditorContext context = event.context();

      // Special case to exempt caret annotations from being undoable.
      context.getResponsibilityManager().startIndirectSequence();
      try {
        writeSelection(context);
      } finally {
        context.getResponsibilityManager().endIndirectSequence();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.editor.EditorContext

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.