Package org.waveprotocol.wave.client.editor.content

Examples of org.waveprotocol.wave.client.editor.content.ContentDocument$LocalAnnotationSet


    return isLoaded() ? document.getDocument().flush(resume) : true;
  }

  @Override
  public void startRendering(Registries registries, LogicalPanel logicalPanel) {
    ContentDocument document;
    if (!isLoaded()) {
      loadWith(registries);
      document = this.document.getDocument();
    } else {
      document = this.document.getDocument();
      document.setRegistries(registries);
    }
    document.setInteractive(logicalPanel);
    // ContentDocument does not render synchronously, so we have to force it
    // to finish, rather than reveal half-rendered content at the end of the
    // event cycle.
    AnnotationPainter.flush(document.getContext());
  }
View Full Code Here


    boolean useHack = createEditor2DocDetached.getValue();

    // EDITOR1: Pojo -> editor mode
    double start = Duration.currentTimeMillis();
    doc1 = new ContentDocument(testEditorRegistries, op, schema);
    double middle = Duration.currentTimeMillis();
    editor1.setContent(doc1);
    double end = Duration.currentTimeMillis();
    logger.log(AbstractLogger.Level.TRACE, "Set content1 took: " + (end - start)
        + " (Pojo creation: " + (middle - start) + ", rendering: " + (end - middle));

    // EDITOR2: Build document in edit mode
    start = Duration.currentTimeMillis();
    doc2 = new ContentDocument(schema);
    doc2.setRegistries(testEditorRegistries);
    editor2.setContent(doc2);

    // HACK to ensure it's created non-attached to dom, to ensure fair speed comparisons
    double start2, end2;
View Full Code Here

  }

  @Override
  public void reply(BlipView blipUi) {
    ConversationBlip blip = views.getBlip(blipUi);
    ContentDocument doc = documents.get(blip).getDocument();
    // Insert the reply at a good spot near the current selection, or use the
    // end of the document as a fallback.
    int location = DocumentUtil.getLocationNearSelection(doc);
    if (location == -1) {
      location = blip.getContent().size() - 1;
View Full Code Here

   */
  private void startNewSession(BlipView blipUi) {
    assert !isEditing() && blipUi != null;

    // Find the document.
    ContentDocument document = documents.get(views.getBlip(blipUi)).getDocument();
    blipUi.getMeta().enable(BlipMetaViewBuilder.ENABLED_WHILE_EDITING_MENU_OPTIONS_SET);
    blipUi.getMeta().disable(BlipMetaViewBuilder.DISABLED_WHILE_EDITING_MENU_OPTIONS_SET);
    blipUi.getMeta().select(MenuOption.EDIT_DONE);

    // Create or re-use and editor for it.
View Full Code Here

   */
  private void startNewSession(BlipView blipUi) {
    assert !isEditing() && blipUi != null;

    // Find the document.
    ContentDocument document = documents.get(views.getBlip(blipUi)).getDocument();
    blipUi.getMeta().select(MenuOption.EDIT);

    // Create or re-use and editor for it.
    editor = Editors.attachTo(document);
    container.doAdopt(editor.getWidget());
View Full Code Here

  }

  @Override
  public void reply(BlipView blipUi) {
    ConversationBlip blip = views.getBlip(blipUi);
    ContentDocument doc = documents.get(blip).getDocument();
    // Insert the reply at a good spot near the current selection, or use the
    // end of the document as a fallback.
    int location = DocumentUtil.getLocationNearSelection(doc);
    if (location == -1) {
      location = blip.getContent().size() - 1;
View Full Code Here

   */
  // Type conversion with flattened generics in setDelegate();
  @SuppressWarnings("unchecked")
  private void loadWith(Registries registries) {
    assert !isLoaded() : "already loaded";
    ContentDocument core = new ContentDocument(DocumentSchema.NO_SCHEMA_CONSTRAINTS);
    document = DiffContentDocument.create(core);
    if (outputSink != null) {
      core.setOutgoingSink(outputSink);
    }
    core.setRegistries(registries);
    setDelegate((MutableDocument) core.getMutableDoc());
    if (spec != null) {
      spec.applyTo(document);
      spec = null;
    }
  }
View Full Code Here

    return isLoaded() ? document.getDocument().flush(resume) : true;
  }

  @Override
  public void startRendering(Registries registries, LogicalPanel logicalPanel) {
    ContentDocument document;
    if (!isLoaded()) {
      loadWith(registries);
      document = this.document.getDocument();
    } else {
      document = this.document.getDocument();
      document.setRegistries(registries);
    }
    document.setInteractive(logicalPanel);
    // ContentDocument does not render synchronously, so we have to force it
    // to finish, rather than reveal half-rendered content at the end of the
    // event cycle.
    AnnotationPainter.flush(document.getContext());
  }
View Full Code Here

  }

  @Override
  public void setContent(final DocInitialization op, DocumentSchema schema) {
    Preconditions.checkState(ownsDocument, "Can not replace content not owned");
    setContent(new ContentDocument(registries, op, schema));
  }
View Full Code Here

    return content;
  }

  @Override
  public ContentDocument removeContent() {
    ContentDocument oldDoc = content;

    clearContent();

    if (ownsDocument) {
      oldDoc.setRendering();
      oldDoc.replaceOutgoingSink(SilentOperationSink.Void.get());
    } else {
      oldDoc.setInteractive();
    }

    // TODO(danilatos): Clear all the stuff initialised in setContent()
    return oldDoc;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.editor.content.ContentDocument$LocalAnnotationSet

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.