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

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


    return oldDoc;
  }

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

    clearContent();
    oldDoc.setShelved();

    return oldDoc;
  }
View Full Code Here


            ? nodeManager.findElementWrapper(Element.as(rawEvent.getEventTarget())) : null;
        if (el == null) {
          repairListener.onFullDocumentRevert(mutable());

          // Destroy all rendering
          ContentDocument savedDoc = removeContent();
          savedDoc.setShelved();

          // Re-insert document to re-render from scratch
          setContent(savedDoc);

          repairer.flashShowRepair(full().getDocumentElement());
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

    StyleAnnotationHandler.register(registries);
  }

  /** For testing purposes only. */
  public static ContentDocument createTestDocument() {
    ContentDocument doc = new ContentDocument(DocumentSchema.NO_SCHEMA_CONSTRAINTS);
    Registries registries = Editor.ROOT_REGISTRIES.createExtension();
    for (String t : new String[] {"q", "a", "b", "c", "x"}) {
      final String tag = t;
      registries.getElementHandlerRegistry().registerRenderer(tag,
          new Renderer() {
            @Override
            public Element createDomImpl(Renderable element) {
              return element.setAutoAppendContainer(Document.get().createElement(tag));
            }
          });
    }
    doc.setRegistries(registries);
    Editor editor = getMinimalEditor();
    editor.setContent(doc);
    return doc;
  }
View Full Code Here

TOP

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

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.