Package org.waveprotocol.wave.client.editor

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


   */
  public static Editor getMinimalEditor() {
    registerHandlers(Editor.ROOT_REGISTRIES);

    EditorStaticDeps.setPopupProvider(Popup.LIGHTWEIGHT_POPUP_PROVIDER);
    Editor editor = Editors.create();
    editor.init(Editor.ROOT_REGISTRIES, KeyBindingRegistry.NONE, EditorSettings.DEFAULT);
    editor.setEditing(true);
    return editor;
  }
View Full Code Here


              return element.setAutoAppendContainer(Document.get().createElement(tag));
            }
          });
    }
    doc.setRegistries(registries);
    Editor editor = getMinimalEditor();
    editor.setContent(doc);
    return doc;
  }
View Full Code Here

      public PopupChrome createPopupChrome() {
        return null;
      }
    });

    Editor editor = Editors.create();
    editor.getWidget().getElement().setId(id);
    editor.addKeySignalListener(this);
    return editor;
  }
View Full Code Here

   */
  public static Editor getRealisticEditor() {
    registerHandlers(Editor.ROOT_REGISTRIES);

    EditorStaticDeps.setPopupProvider(Popup.LIGHTWEIGHT_POPUP_PROVIDER);
    Editor editor = Editors.create();
    editor.init(Editor.ROOT_REGISTRIES, KeyBindingRegistry.NONE, EditorSettings.DEFAULT);
    return editor;
  }
View Full Code Here

      // TODO(user): this does not work if the view has been deleted and
      // detached.
      editing.getMeta().deselect(MenuOption.EDIT_DONE);
      editing.getMeta().enable(BlipMetaViewBuilder.DISABLED_WHILE_EDITING_MENU_OPTIONS_SET);
      editing.getMeta().disable(BlipMetaViewBuilder.ENABLED_WHILE_EDITING_MENU_OPTIONS_SET);
      Editor oldEditor = editor;
      BlipView oldEditing = editing;
      editor = null;
      editing = null;
      fireOnSessionEnd(oldEditor, oldEditing);
    }
View Full Code Here

      public PopupChrome createPopupChrome() {
        return null;
      }
    });

    Editor editor = Editors.create();
    editor.getWidget().getElement().setId(id);
    editor.addKeySignalListener(this);
    return editor;
  }
View Full Code Here

   */
  public static Editor getRealisticEditor() {
    registerHandlers(Editor.ROOT_REGISTRIES);

    EditorStaticDeps.setPopupProvider(Popup.LIGHTWEIGHT_POPUP_PROVIDER);
    Editor editor = Editors.create();
    editor.init(Editor.ROOT_REGISTRIES, KeyBindingRegistry.NONE, EditorSettings.DEFAULT);
    return editor;
  }
View Full Code Here

        (Editor) editorDiv.getPropertyObject(EDITOR_WEBDRIVER_PROPERTY);
  }

  /** Utility that flushes an editor div before getting the selected range. */
  private static Range getSelectionWithFlush(Element editorDiv) {
    Editor editor = getByEditorDiv(editorDiv);
    if (editor != null) {
      EditorTestingUtil.forceFlush(editor);
      return editor.getSelectionHelper().getOrderedSelectionRange();
    }
    return null;
  }
View Full Code Here

  /**
   * @param editorDiv
   * @return content of editor owning doc div
   */
  public static String webdriverEditorGetContent(Element editorDiv) {
    Editor editor = getByEditorDiv(editorDiv);
    if (editor != null) {
      // This must not be called synchronously in the same key event before
      // the dom is modified.
      EditorTestingUtil.forceFlush(editor);

      // NOTE(patcoleman): it seems empty strings get converted to null objects here by webdriver,
      //   this code removes the prefix that avoids that problem.
      // TODO(patcoleman): investigate where this happens with Simon.
      String content = XmlStringBuilder.innerXml(editor.getPersistentDocument()).toString();
      return content == null ? null : "_" + content;
    } else {
      return "Error in webdriverEditorGetContent";
    }
  }
View Full Code Here

  /**
   * @param editorDiv
   * @return local annotations of the editor owning div
   */
  public static String webdriverEditorGetLocalDiffAnnotations(Element editorDiv) {
    Editor editor = getByEditorDiv(editorDiv);
    if (editor == null) {
      return "Error in webdriverEditorGetContent";
    }
    // This must not be called synchronously in the same key event before the dom is modified.
    EditorTestingUtil.forceFlush(editor);

    StringBuilder ans = new StringBuilder("");
    ReadableStringSet keys = CollectionUtils.newStringSet(
        DiffHighlightingFilter.DIFF_INSERT_KEY,
        DiffHighlightingFilter.DIFF_DELETE_KEY);
    MutableAnnotationSet.Local annotations = editor.getContent().getLocalAnnotations();
    annotations.annotationIntervals(0, annotations.size(), keys);
    for (AnnotationInterval<Object> interval :
        annotations.annotationIntervals(0, annotations.size(), keys)) {

      boolean isInsertion = interval.annotations()
View Full Code Here

TOP

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

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.