Examples of asRange()


Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

  }

  @Override
  public Range getOrderedSelectionRange() {
    FocusedRange selection = getSelectionRange();
    return selection != null ? selection.asRange() : null;
  }

  /** {@inheritDoc} */
  public void setSelectionRange(FocusedRange selection) {
    if (selection != null) {
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

    busy = true;
    deferredCommands.addCommand(new Command() {
      public void execute() {
        if (isCut) {
          aggressiveSelectionHelper.setCaret(selection.asRange().getStart());
        } else {
          aggressiveSelectionHelper.setSelectionRange(selection);
        }
        busy = false;
      }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

          current = CursorDirection.FROM_LEFT;
        }

        FocusedRange focused = getSelectionHelper().getSelectionRange();
        if (focused != null) {
          Range range = focused.asRange();
          currentSelectionBias = annotationLogic.rebias(range.getStart(), range.getEnd(), current);
        } else {
          // no selection, so have default bias
          currentSelectionBias = BiasDirection.LEFT;
        }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

      return;
    }
    try {
      // We try to create a link with the current selection, if fails, we ask
      // for a link
      Range rg = range.asRange();
      String text = DocHelper.getText(editor.getDocument(), rg.getStart(), rg.getEnd());
      String linkAnnotationValue = Link.normalizeLink(text);
      EditorAnnotationUtil.setAnnotationOverSelection(editor, AnnotationConstants.LINK_PREFIX, linkAnnotationValue);
    } catch (InvalidLinkException e) {
      String rawLinkValue =
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

    focusedRange = editor.getSelectionHelper().getSelectionRange();
    if (focusedRange == null) {
      Window.alert(ComplexColorPicker.messages.selectSomeText());
      return;
    }
    final Range range = focusedRange.asRange();
    final ColorPopup popup = new ColorPopup(button.getButton().hackGetWidget().getElement(), allowNone);
    popup.show(new OnColorChooseListener() {
      @Override
      public void onColorChoose(String color) {
        EditorAnnotationUtil.
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

  }

  @Override
  public Range getOrderedSelectionRange() {
    FocusedRange selection = getSelectionRange();
    return selection != null ? selection.asRange() : null;
  }

  /** {@inheritDoc} */
  public void setSelectionRange(FocusedRange selection) {
    if (selection != null) {
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

    busy = true;
    deferredCommands.addCommand(new Command() {
      public void execute() {
        if (isCut) {
          aggressiveSelectionHelper.setCaret(selection.asRange().getStart());
        } else {
          aggressiveSelectionHelper.setSelectionRange(selection);
        }
        busy = false;
      }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

          current = CursorDirection.FROM_LEFT;
        }

        FocusedRange focused = getSelectionHelper().getSelectionRange();
        if (focused != null) {
          Range range = focused.asRange();
          currentSelectionBias = annotationLogic.rebias(range.getStart(), range.getEnd(), current);
        } else {
          // no selection, so have default bias
          currentSelectionBias = BiasDirection.LEFT;
        }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.FocusedRange.asRange()

      return;
    }
    try {
      // We try to create a link with the current selection, if fails, we ask
      // for a link
      Range rg = range.asRange();
      String text = DocHelper.getText(editor.getDocument(), rg.getStart(), rg.getEnd());
      String linkAnnotationValue = Link.normalizeLink(text);
      EditorAnnotationUtil.setAnnotationOverSelection(editor, Link.KEY, linkAnnotationValue);
    } catch (InvalidLinkException e) {
      String rawLinkValue =
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.