Package com.google.gwt.json.client

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


    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){
      int maxLength = (int)attributeNumberObj.doubleValue();
      if(maxLength > 0)
        ((HasVkMaxLength)widget).setMaxLength(maxLength);
    }
    attributeJsObj = childObj.get(HasVkHorizontalAlignment.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
View Full Code Here


      ((HasVkImageUrl)widget).setImageUrl(attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkScrollBarShowing.NAME);
    if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
      ((HasVkScrollBarShowing)widget).setAlwaysShowScrollBars(attributeBooleanObj.booleanValue());
    attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null && attributeNumberObj.doubleValue() > -1)
      ((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
    attributeJsObj = childObj.get(HasVkName.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      ((HasVkName)widget).setName(attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkValue.NAME);
View Full Code Here

    attributeJsObj = childObj.get(HasVkScrollBarShowing.NAME);
    if(attributeJsObj != null && (attributeBooleanObj = attributeJsObj.isBoolean()) != null)
      ((HasVkScrollBarShowing)widget).setAlwaysShowScrollBars(attributeBooleanObj.booleanValue());
    attributeJsObj = childObj.get(HasVkSwitchNumberedWidget.NAME);
    if(attributeJsObj != null && (attributeNumberObj = attributeJsObj.isNumber()) != null && attributeNumberObj.doubleValue() > -1)
      ((HasVkSwitchNumberedWidget)widget).showWidget((int)attributeNumberObj.doubleValue());
    attributeJsObj = childObj.get(HasVkName.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != null)
      ((HasVkName)widget).setName(attributeStringObj.stringValue());
    attributeJsObj = childObj.get(HasVkValue.NAME);
    if(attributeJsObj != null && (attributeStringObj = attributeJsObj.isString()) != 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

    @Override
    public void setJSONValue(JSONValue value) {
      JSONNumber numberVal = value.isNumber();
      JSONString stringVal = value.isString();
      if (numberVal != null) {
        textbox.setValue(String.valueOf(numberVal.doubleValue()));
      } else if (stringVal != null){
        textbox.setValue(stringVal.stringValue());
      } else {
        throw new JSONException("Not a valid JSON number: " + value.toString());
      }
View Full Code Here

      return v2.isNull() != null;
    }
    else if (v1.isNumber() != null) {
      JSONNumber n1 = v1.isNumber();
      JSONNumber n2 = v2.isNumber();
      return n1.doubleValue() == n2.doubleValue();
    }
    else if (v1.isObject() != null) {
      JSONObject o1 = v1.isObject();
      JSONObject o2 = v2.isObject();
      if (!o1.keySet().equals(o2.keySet())) {
View Full Code Here

      JSONObject object = (JSONObject) o.get("object");

      // Assert
      assertEquals("json string", string.stringValue());
      assertEquals(3.0, number.doubleValue(), 0);
      assertEquals(3.1415, fl.doubleValue(), 0);
      assertTrue(bool.booleanValue());
      // array
      assertEquals(1.0, ((JSONNumber) array.get(0)).doubleValue(), 0);
      assertEquals(33.7, ((JSONNumber) array.get(1)).doubleValue(), 0);
      assertEquals("l33t", ((JSONString) array.get(2)).stringValue());
View Full Code Here

      JSONObject object = (JSONObject) o.get("object");

      // Assert
      assertEquals("json string", string.stringValue());
      assertEquals(3.0, number.doubleValue(), 0);
      assertEquals(3.1415, fl.doubleValue(), 0);
      assertTrue(bool.booleanValue());
      // array
      assertEquals(1.0, ((JSONNumber) array.get(0)).doubleValue(), 0);
      assertEquals(33.7, ((JSONNumber) array.get(1)).doubleValue(), 0);
      assertEquals("l33t", ((JSONString) array.get(2)).stringValue());
View Full Code Here

                        {
                            JSONNumber jnum = jval.isNumber();

                            if (jnum != null)
                            {
                                sizes[i] = jnum.doubleValue();
                            }
                        }
                    }
                }
            }
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.