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

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


        Map<String, String> attributesMap = Maps.newHashMap();
        for (ProtocolDocumentOperation.Component.KeyValuePair pair :
            c.getElementStart().getAttributeList()) {
          attributesMap.put(pair.getKey(), pair.getValue());
        }
        output.elementStart(c.getElementStart().getType(), new AttributesImpl(attributesMap));
      } else if (c.hasElementEnd()) {
        output.elementEnd();
      } else if (c.hasRetainItemCount()) {
        output.retain(c.getRetainItemCount());
      } else if (c.hasDeleteCharacters()) {
        output.deleteCharacters(c.getDeleteCharacters());
      } else if (c.hasDeleteElementStart()) {
        Map<String, String> attributesMap = Maps.newHashMap();
        for (ProtocolDocumentOperation.Component.KeyValuePair pair :
            c.getDeleteElementStart().getAttributeList()) {
          attributesMap.put(pair.getKey(), pair.getValue());
        }
        output.deleteElementStart(c.getDeleteElementStart().getType(),
            new AttributesImpl(attributesMap));
      } else if (c.hasDeleteElementEnd()) {
        output.deleteElementEnd();
      } else if (c.hasReplaceAttributes()) {
        if (c.getReplaceAttributes().getEmpty()) {
          output.replaceAttributes(AttributesImpl.EMPTY_MAP, AttributesImpl.EMPTY_MAP);
        } else {
          Map<String, String> oldAttributesMap = Maps.newHashMap();
          Map<String, String> newAttributesMap = Maps.newHashMap();
          for (ProtocolDocumentOperation.Component.KeyValuePair pair :
              c.getReplaceAttributes().getOldAttributeList()) {
            oldAttributesMap.put(pair.getKey(), pair.getValue());
          }
          for (ProtocolDocumentOperation.Component.KeyValuePair pair :
              c.getReplaceAttributes().getNewAttributeList()) {
            newAttributesMap.put(pair.getKey(), pair.getValue());
          }
          output.replaceAttributes(new AttributesImpl(oldAttributesMap),
              new AttributesImpl(newAttributesMap));
        }
      } else if (c.hasUpdateAttributes()) {
        if (c.getUpdateAttributes().getEmpty()) {
          output.updateAttributes(AttributesUpdateImpl.EMPTY_MAP);
        } else {
View Full Code Here


  private void createEntry(WaveletId waveletId) {
    String waveletIdStr = WaveletBasedConversation.idFor(waveletId);
    ObservableMutableDocument<? super E, E, ?> doc = getDocument();
    E container =
        doc.createChildElement(doc.getDocumentElement(), WaveletBasedSupplement.CONVERSATION_TAG,
            new AttributesImpl(WaveletBasedSupplement.ID_ATTR, waveletIdStr));
  }
View Full Code Here

      if (indent > 0) {
        attrList.add(new Attribute(INDENT_ATTR, "" + indent));
      }
    }

    AttributesImpl attributes = AttributesImpl.fromUnsortedAttributes(attrList);

    return attributes;
  }
View Full Code Here

  }

  private void createEntry(String gadgetId) {
    getDocument().createChildElement(getDocument().getDocumentElement(),
        WaveletBasedSupplement.GADGET_TAG,
        new AttributesImpl(WaveletBasedSupplement.ID_ATTR, gadgetId));
  }
View Full Code Here

  private E createEntry(K key, V value) {
    Map<String, String> attrs = new HashMap<String, String>();
    attrs.put(keyAttrName, keySerializer.toString(key));
    attrs.put(valueAttrName, valueSerializer.toString(value));
    // Always insert the new element at the start of the parent container.
    return prependChild(getDocument(), container, entryTagName, new AttributesImpl(attrs));

    // The document should fire an onEntryAdded event, which will cause the value to show up in
    // the entries map.
  }
View Full Code Here

        switch (parser.getCurrentType()) {
          case TEXT:
            builder.characters(parser.getText());
            break;
          case START_ELEMENT:
            builder.elementStart(parser.getTagName(), new AttributesImpl(CollectionUtils
                .newJavaMap(parser.getAttributes())));
            break;
          case END_ELEMENT:
            builder.elementEnd();
            break;
View Full Code Here

    Point.checkPoint(this, point, "MutableDocumentImpl.createElement");
    try {
      begin();

      int location = doc.getLocation(point);
      consume(createElement(tagName, new AttributesImpl(attributes), at(location)));

      Point<N> result = doc.locate(location);

      return doc.asElement(result.isInTextNode()
          ? doc.getNextSibling(result.getContainer()) : result.getNodeAfter());
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.