Examples of SelectionHelper


Examples of org.waveprotocol.wave.client.editor.selection.content.SelectionHelper

   * restore.
   */
  public void saveSelection() {
    if (editingConcerns != null && savedSelectionDepth == 0) {
      needToRestoreSelection = false;
      SelectionHelper helper = editingConcerns.getSelectionHelper();

      // Sometimes the document is not in an editing context, in which
      // case there is no selection helper.
      if (helper != null) {
        FocusedPointRange<Node> htmlSelection = NativeSelectionUtil.get();
        if (htmlSelection != null) {
          savedSelectionAnchor = htmlSelection.getAnchor();
          if (savedSelectionAnchor.isInTextNode()) {
            savedSelectionAnchorTextNodelet = savedSelectionAnchor.getContainer().cast();
            savedSelectionAnchorOffset = savedSelectionAnchor.getTextOffset();
          }
          savedSelectionFocus = htmlSelection.getFocus();
          if (savedSelectionFocus.isInTextNode()) {
            savedSelectionFocusTextNodelet = savedSelectionFocus.getContainer().cast();
            savedSelectionFocusOffset = savedSelectionFocus.getTextOffset();
          }
          savedSelection = helper.getSelectionRange();
        }
      }
    }

    savedSelectionDepth++;
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.selection.content.SelectionHelper

   * restore.
   */
  public void saveSelection() {
    if (editingConcerns != null && savedSelectionDepth == 0) {
      needToRestoreSelection = false;
      SelectionHelper helper = editingConcerns.getSelectionHelper();

      // Sometimes the document is not in an editing context, in which
      // case there is no selection helper.
      if (helper != null) {
        FocusedPointRange<Node> htmlSelection = NativeSelectionUtil.get();
        if (htmlSelection != null) {
          savedSelectionAnchor = htmlSelection.getAnchor();
          if (savedSelectionAnchor.isInTextNode()) {
            savedSelectionAnchorTextNodelet = savedSelectionAnchor.getContainer().cast();
            savedSelectionAnchorOffset = savedSelectionAnchor.getTextOffset();
          }
          savedSelectionFocus = htmlSelection.getFocus();
          if (savedSelectionFocus.isInTextNode()) {
            savedSelectionFocusTextNodelet = savedSelectionFocus.getContainer().cast();
            savedSelectionFocusOffset = savedSelectionFocus.getTextOffset();
          }
          savedSelection = helper.getSelectionRange();
        }
      }
    }

    savedSelectionDepth++;
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.