Package org.waveprotocol.wave.client.gadget

Examples of org.waveprotocol.wave.client.gadget.StateMap.each()


  private void updatePrefsFromAttribute(String prefAttribute) {
    if (!stateToAttribute(userPrefs).equals(prefAttribute)) {
      StateMap prefState = attributeToState(prefAttribute);
      userPrefs.parse(prefState, true);
      log("Updating user prefs: ", userPrefs.toJson());
      prefState.each(new StateMap.Each() {
        @Override
        public void apply(String key, String value) {
          setGadgetPref(key, value);
        }
      });
View Full Code Here


    // callback.
    // TODO(user): Remove this workaround once this is fixed in GGS.
    ScheduleCommand.addCommand(new Task() {
      @Override
      public void execute() {
        deltaState.each(new Each() {
          @Override
          public void apply(final String key, final String value) {
            if (value != null) {
              modifyState(key, value);
            } else {
View Full Code Here

    StateMap deltaState = StateMap.create();
    deltaState.fromJsonObject(delta);
    final String gadgetId = getOrGenerateGadgetId();
    if (gadgetId != null) {
      deltaState.each(new Each() {
        @Override
        public void apply(final String key, final String value) {
          supplement.setGadgetState(gadgetId, key, value);
        }
      });
View Full Code Here

  private void updatePrefsFromAttribute(String prefAttribute) {
    if (!stateToAttribute(userPrefs).equals(prefAttribute)) {
      StateMap prefState = attributeToState(prefAttribute);
      userPrefs.parse(prefState, true);
      log("Updating user prefs: ", userPrefs.toJson());
      prefState.each(new StateMap.Each() {
        @Override
        public void apply(String key, String value) {
          setGadgetPref(key, value);
        }
      });
View Full Code Here

    // callback.
    // TODO(user): Remove this workaround once this is fixed in GGS.
    ScheduleCommand.addCommand(new Task() {
      @Override
      public void execute() {
        deltaState.each(new Each() {
          @Override
          public void apply(final String key, final String value) {
            if (value != null) {
              modifyState(key, value);
            } else {
View Full Code Here

    StateMap deltaState = StateMap.create();
    deltaState.fromJsonObject(delta);
    final String gadgetId = getOrGenerateGadgetId();
    if (gadgetId != null) {
      deltaState.each(new Each() {
        @Override
        public void apply(final String key, final String value) {
          supplement.setGadgetState(gadgetId, key, value);
        }
      });
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.