Package com.google.gwt.json.client

Examples of com.google.gwt.json.client.JSONNumber.doubleValue()


        try {
            JSONValue v = obj.get(key);
            if (v != null) {
                JSONNumber n = v.isNumber();
                if (n != null) {
                    return (long) n.doubleValue();
                } else {
                    /*
                     * If this isn't a number, then it might be a string
                     * like "5" so we try to parse it as a number.
                     */
 
View Full Code Here


    {
        JSONValue v = obj.get(key);
        if (v != null) {
            JSONNumber n = v.isNumber();
            if (n != null) {
                return new Date(Double.valueOf(n.doubleValue()).longValue());
            } else {
                String s = getStringValue(obj, key);
                if (s != null) {
                    return new Date(Long.parseLong(s));
                }
View Full Code Here

    assertNotNull(fileCoverage);
    for (Map.Entry<String, Double> lineCoverage : EXPECTED_COVERAGE.entrySet()) {
      assertTrue(fileCoverage.containsKey(lineCoverage.getKey()));
      JSONNumber value = fileCoverage.get(lineCoverage.getKey()).isNumber();
      assertNotNull(value);
      assertEquals(lineCoverage.getValue(), value.doubleValue(), 0.0001);
    }
  }
}
View Full Code Here

        if (addHandler.containsKey(PROPERTY.KEY_FILTER)) {
            final JSONArray jsonArray = addHandler.get(PROPERTY.KEY_FILTER).isArray();
            for (int i = 0; i < jsonArray.size(); i++) {
                final JSONNumber keyCode = jsonArray.get(i).isNumber();
                if (keyCode.doubleValue() == event.getNativeEvent().getKeyCode()) {
                    uiService.sendDataToServer(eventInstruction);
                    break;
                }
            }
        } else {
View Full Code Here

                            if (addHandler.containsKey(PROPERTY.KEY_FILTER)) {
                                final JSONArray jsonArray = addHandler.get(PROPERTY.KEY_FILTER).isArray();
                                for (int i = 0; i < jsonArray.size(); i++) {
                                    final JSONNumber keyCode = jsonArray.get(i).isNumber();
                                    if (keyCode.doubleValue() == event.getNativeEvent().getKeyCode()) {
                                        uiService.stackInstrution(changeHandlerInstruction);
                                        uiService.stackInstrution(eventInstruction);
                                        uiService.flushEvents();
                                        break;
                                    }
View Full Code Here

                            if (addHandler.containsKey(PROPERTY.KEY_FILTER)) {
                                final JSONArray jsonArray = addHandler.get(PROPERTY.KEY_FILTER).isArray();
                                for (int i = 0; i < jsonArray.size(); i++) {
                                    final JSONNumber keyCode = jsonArray.get(i).isNumber();
                                    if (keyCode.doubleValue() == event.getNativeEvent().getKeyCode()) {
                                        uiService.sendDataToServer(eventInstruction);
                                        uiService.flushEvents();
                                        break;
                                    }
                                }
View Full Code Here

                    // just through exception below
                }
            }
            throw new DecodingException("Expected a json number, but was given: " + value);
        }
        return number.doubleValue();
    }

    static public JSONObject toObject(JSONValue value) {
        JSONObject object = value.isObject();
        if (object == null) {
View Full Code Here

    attributeJsObj = childObj.get(HasVkDirection.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      ((HasVkDirection)widget).setDirection(attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkMaxLength.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null)
      ((HasVkMaxLength)widget).setMaxLength((int)attributeNumberObj.doubleValue());
    /*attributeJsObj = childObj.get(HasVkHorizontalAlignment.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      ((HasVkHorizontalAlignment)widget).setHorizontalAlignment(attributeStringObj.stringValue());*/
    attributeJsObj = childObj.get(HasVkAnimation.NAME);
    if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
View Full Code Here

    attributeJsObj = childObj.get(HasVkAnimation.NAME);
    if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
      ((HasVkAnimation)widget).setAnimationEnabled(attributeBooleanObj.booleanValue());
    attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null)
      ((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
   
    attributeJsObj = childObj.get(HasVkBeforeSelectionHandler.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      ((HasVkBeforeSelectionHandler)widget).addBeforeSelectionHandler(attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkSelectionHandler.NAME);
View Full Code Here

    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      DOM.setElementAttribute(widget.getElement(), "className", attributeStringObj.stringValue());
    JSONNumber attributeNumberObj;
    attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null)
      ((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
  }
  @Override
  public Widget deepClone(Widget sourceWidget, Widget targetWidget) {
    boolean isVkDesignerMode = VkStateHelper.getInstance().isDesignerMode();
    if(sourceWidget instanceof IVkPanel && targetWidget instanceof IVkPanel)
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.