Examples of UpdateAttributes


Examples of com.google.walkaround.proto.ProtocolDocumentOperation.Component.UpdateAttributes

      }

      @Override
      public void updateAttributes(AttributesUpdate update) {
        Component component = MessageFactoryHelper.createDocumentOperationComponent();
        UpdateAttributes updateAttributes =
            MessageFactoryHelper.createDocumentUpdateAttributes();
        int n = update.changeSize();
        if (n == 0) {
          updateAttributes.setEmpty(true);
        } else {
          for (int i = 0; i < n; i++) {
          updateAttributes.addAttributeUpdate(createKeyValueUpdate(
              update.getChangeKey(i), update.getOldValue(i), update.getNewValue(i)));
          }
        }
        component.setUpdateAttributes(updateAttributes);
        mutation.addComponent(component);
View Full Code Here

Examples of com.google.walkaround.proto.ProtocolDocumentOperation.Component.UpdateAttributes

  }

  @Override
  public AttributesUpdate getUpdateAttributesUpdate(int i) {
    Component component = provider.getContent().getComponent(i);
    UpdateAttributes r = component.getUpdateAttributes();
    return attributesUpdateFrom(r);
  }
View Full Code Here

Examples of com.google.walkaround.proto.ProtocolDocumentOperation.Component.UpdateAttributes

      cursor.deleteElementEnd();
    } else if (component.hasReplaceAttributes()) {
      ReplaceAttributes r = component.getReplaceAttributes();
      cursor.replaceAttributes(oldAttributesFrom(r), newAttributesFrom(r));
    } else if (component.hasUpdateAttributes()) {
      UpdateAttributes r = component.getUpdateAttributes();
      cursor.updateAttributes(attributesUpdateFrom(r));
    } else {
      throw new DelayedInvalidInputException("Fell through in applyComponent: " + provider);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.UpdateAttributes

        addComponent().setReplaceAttributes(r);
      }

      @Override
      public void updateAttributes(AttributesUpdate attributes) {
        UpdateAttributes u = UpdateAttributesJsoImpl.create();
        if (attributes.changeSize() == 0) {
          u.setEmpty(true);
        } else {
          for (int i = 0; i < attributes.changeSize(); i++) {
            u.addAttributeUpdate(keyValueUpdate(attributes.getChangeKey(i),
                attributes.getOldValue(i), attributes.getNewValue(i)));
          }
        }
        addComponent().setUpdateAttributes(u);
      }
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.UpdateAttributes

        } else {
          output.replaceAttributes(new AttributesImpl(deserialize(r.getOldAttribute())),
              new AttributesImpl(deserialize(r.getNewAttribute())));
        }
      } else if (c.hasUpdateAttributes()) {
        UpdateAttributes u = c.getUpdateAttributes();
        if (u.getEmpty()) {
          output.updateAttributes(AttributesUpdateImpl.EMPTY_MAP);
        } else {
          String[] triplets = new String[u.getAttributeUpdate().size() * 3];
          int i = 0;
          for (KeyValueUpdate kvu : u.getAttributeUpdate()) {
            triplets[i++] = kvu.getKey();
            triplets[i++] = kvu.hasOldValue() ? kvu.getOldValue() : null;
            triplets[i++] = kvu.hasNewValue() ? kvu.getNewValue() : null;
          }
          output.updateAttributes(new AttributesUpdateImpl(triplets));
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.UpdateAttributes

        return this;
      }

      /** Builds a {@link UpdateAttributes} using this builder and a factory. */
      public UpdateAttributes build(Factory factory) {
        UpdateAttributes message = factory.create();
        message.setEmpty(empty);
        message.clearAttributeUpdate();
        message.addAllAttributeUpdate(attributeUpdate);
        return message;
      }
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.UpdateAttributes

        } else {
          output.replaceAttributes(new AttributesImpl(deserialize(r.getOldAttribute())),
              new AttributesImpl(deserialize(r.getNewAttribute())));
        }
      } else if (c.hasUpdateAttributes()) {
        UpdateAttributes u = c.getUpdateAttributes();
        if (u.getEmpty()) {
          output.updateAttributes(AttributesUpdateImpl.EMPTY_MAP);
        } else {
          String[] triplets = new String[u.getAttributeUpdate().size() * 3];
          int i = 0;
          for (KeyValueUpdate kvu : u.getAttributeUpdate()) {
            triplets[i++] = kvu.getKey();
            triplets[i++] = kvu.hasOldValue() ? kvu.getOldValue() : null;
            triplets[i++] = kvu.hasNewValue() ? kvu.getNewValue() : null;
          }
          output.updateAttributes(new AttributesUpdateImpl(triplets));
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.UpdateAttributes

        addComponent().setReplaceAttributes(r);
      }

      @Override
      public void updateAttributes(AttributesUpdate attributes) {
        UpdateAttributes u = UpdateAttributesJsoImpl.create();
        if (attributes.changeSize() == 0) {
          u.setEmpty(true);
        } else {
          for (int i = 0; i < attributes.changeSize(); i++) {
            u.addAttributeUpdate(keyValueUpdate(attributes.getChangeKey(i),
                attributes.getOldValue(i), attributes.getNewValue(i)));
          }
        }
        addComponent().setUpdateAttributes(u);
      }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.UpdateAttributes

  public final void replaceAttributes(Attributes oldAttrs, Attributes newAttrs) {
    accu.add(new ReplaceAttributes(oldAttrs, newAttrs));
  }
  @Override
  public final void updateAttributes(AttributesUpdate update) {
    accu.add(new UpdateAttributes(update));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.UpdateAttributes

  public final DocOpBuilder replaceAttributes(Attributes oldAttrs, Attributes newAttrs) {
    accu.add(new ReplaceAttributes(oldAttrs, newAttrs));
    return this;
  }
  public final DocOpBuilder updateAttributes(AttributesUpdate update) {
    accu.add(new UpdateAttributes(update));
    return this;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.