Package org.waveprotocol.wave.model.document.operation.impl

Examples of org.waveprotocol.wave.model.document.operation.impl.AttributesImpl


      E nodeToDelete = substrate.asElement(currentContainer.getValue());
      if (nodeToDelete == null) {
        throw new OpCursorException("No element to delete at the current location.");
      }
      String tagName = substrate.getTagName(nodeToDelete);
      Attributes attributes = new AttributesImpl(substrate.getAttributes(nodeToDelete));
      if (deletionDepth == 0) {
        substrate.removeChild(currentParent, nodeToDelete);
      }

      doSingleDelete(tagName, attributes);
View Full Code Here


   * @return The operation.
   */
  private static DocOp structuralSample5(int size, int location) {
    return new DocOpBuilder()
        .retain(location)
        .elementStart("a", new AttributesImpl("href", "http://www.google.com/"))
        .characters("google")
        .elementEnd()
        .retain(size - location)
        .build();
  }
View Full Code Here

   * @return The operation.
   */
  private static DocOp structuralDeletionSample5(int size, int location) {
    return new DocOpBuilder()
        .retain(location)
        .deleteElementStart("a", new AttributesImpl("href", "http://www.google.com/"))
        .deleteCharacters("google")
        .deleteElementEnd()
        .retain(size - location - 8)
        .build();
  }
View Full Code Here

  }

  public void testElements() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    Attributes b = new AttributesImpl();
    Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));

    m.elementStart("a", a);
    m.elementStart("b", b);
    m.elementStart("c", c);
    m.elementEnd();
View Full Code Here

  }

  public void testCharactersAndElements() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    Attributes b = new AttributesImpl();
    Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));

    m.elementStart("a", a);
    m.characters("hello");
    m.elementStart("b", b);
    m.characters("world");
View Full Code Here

  }

  public void testDeleteElements() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    Attributes b = new AttributesImpl();
    Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));

    m.deleteElementStart("a", a);
    m.deleteElementStart("b", b);
    m.deleteElementStart("c", c);
    m.deleteElementEnd();
View Full Code Here

  }

  public void testDeleteCharactersAndElements() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    Attributes b = new AttributesImpl();
    Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));

    m.deleteElementStart("a", a);
    m.deleteCharacters("hello");
    m.deleteElementStart("b", b);
    m.deleteCharacters("world");
View Full Code Here

  }

  public void testAnnotationBoundary() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    AnnotationBoundaryMap mapA = new AnnotationBoundaryMapImpl(
        new String[]{},new String[]{"a"},new String[]{null},new String[]{"b"});
    AnnotationBoundaryMap mapB = new AnnotationBoundaryMapImpl(
        new String[]{},new String[]{"a"},new String[]{"b"},new String[]{null});
    AnnotationBoundaryMap mapC = new AnnotationBoundaryMapImpl(
View Full Code Here

  }

  public void testEmptyAnnotationBoundary() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    m.elementStart("a", a);
    m.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
    m.characters("text");
    m.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
    m.elementEnd();
View Full Code Here

  }

  public void testReplaceAttributes() {
    DocOpBuilder m = new DocOpBuilder();

    Attributes oldA = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
    Attributes newA = new AttributesImpl(ImmutableMap.of("a1", "3", "a2", "4"));

    m.retain(4);
    m.replaceAttributes(oldA, newA);
    m.retain(4);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.impl.AttributesImpl

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.