Package com.google.gwt.json.client

Examples of com.google.gwt.json.client.JSONValue


          String title =
            Window.prompt("Enter a title for the new event", "New event");

          if (title != null) {
            // apply the new title
            JSONValue value = data.get(row);
            if (value != null && value.isObject() != null) {
              JSONObject item = value.isObject();

              item.put("content", new JSONString(title));
              timeline.setData(data.getJavaScriptObject());

              String info = "Added event " + String.valueOf(row);
View Full Code Here


      public void onEdit(EditEvent event) {
        // retrieve the row number of the changed event
        JsArray<Selection> sel = timeline.getSelections();
        if (sel.length() > 0) {
          int row = sel.get(0).getRow();
          JSONValue value = data.get(row);
          if (value != null && value.isObject() != null) {
            JSONObject item = value.isObject();
            String content = "";
            if (item.get("content") != null &&
                item.get("content").isString() != null) {
              content = item.get("content").isString().stringValue();
            }
View Full Code Here

    public void fromJSON(JSONObject object) {
      if (object == null) {
        return;
      }
     
      JSONValue uuid = object.get("_uuid");
      if (uuid != null) {
        if (uuid.isString() != null) {
          this._uuid = uuid.isString().stringValue();
        }
      }

      JSONValue updateSeq = object.get("_updateSeq");
      if (updateSeq != null) {
        if (updateSeq.isNumber() != null) {
          this._updateSeq = (int) updateSeq.isNumber().doubleValue();
        }
      }

      JSONValue name = object.get("name");
      if (name != null) {
        if (name.isString() != null) {
          this.name = name.isString().stringValue();
        }
      }

      JSONValue capacity = object.get("capacity");
      if (capacity != null) {
        if (capacity.isNumber() != null) {
          this.capacity = (int) (capacity.isNumber().doubleValue());
        }
      }     

      JSONValue store = object.get("store");
      if (store != null) {
        if (store.isString() != null) {
          this.store = store.isString().stringValue();
        }
      }
    }
View Full Code Here

      assertTrue(extended.getBounds().getSouthWest().getLatitude() != 0);
      assertTrue(extended.getBounds().getSouthWest().getLongitude() != 0);
    }

    void testMockPlacemark() {
      JSONValue v = JSONParser.parse(jsonString);
      JSONObject obj = v.isObject();
      assertNotNull("Couldn't JSON parse an object from : " + addressQuery
          + " : \n" + jsonString, obj);
      Placemark place = (Placemark) obj.getJavaScriptObject();
      comparePlacemark(place);
    }
View Full Code Here

    m_jsonArray = array;
    m_currentIndex = m_jsonArray.size() - 1;
  }

  protected void set(int index, String value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = new JSONString(value);
    }
    set(index, val);
  }
View Full Code Here

    }
    set(index, val);
  }

  protected void push(String value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = new JSONString(value);
    }
    set(++m_currentIndex, val);
  }
View Full Code Here

      push(values[i]);
    }
  }

  protected void set(int index, Number value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = new JSONNumber(value.doubleValue());
    }
    set(index, val);
  }
View Full Code Here

    }
    set(index, val);
  }

  protected void push(Number value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = new JSONNumber(value.doubleValue());
    }
    set(++m_currentIndex, val);
  }
View Full Code Here

      push(values[i]);
    }
  }

  protected void set(int index, JSONWrapper value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = value.getWrappedObj();
    }
    set(index, val);
  }
View Full Code Here

    }
    set(index, val);
  }

  protected void push(JSONWrapper value) {
    JSONValue val = JSONNull.getInstance();
    if (value != null) {
      val = value.getWrappedObj();
    }
    set(++m_currentIndex, val);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.json.client.JSONValue

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.