Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JsArrayMixed


      new JsUtils.JsFunction(jso).fe();
      return $();
    }
    // Wraps a native array like jquery does
    if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) {
      JsArrayMixed c = jso.cast();
      JsNodeArray elms = JsNodeArray.create();
      for (int i = 0; i < c.length(); i++) {
        Object obj = c.getObject(i);
        if (obj instanceof Node) {
          elms.addNode((Node) obj);
        }
      }
      return $(elms);
View Full Code Here


                newArgs[0] = dispId;
                newArgs[1] = getNativeFunction();
                for (int i = 0; i < paramCount; i++) {
                    newArgs[i + 2] = args.get(0);
                }
                JsArrayMixed array = getStatic().apply(newArgs).cast();
                if (array.getBoolean(0)) {
                    JavaScriptUtils.throwJavaScriptObject(
                            array.getObject(1));
                    //won't get here
                    throw new RuntimeException("Error");
                } else {
                    return (T) array.getObject(1);
                }
            }
        }.getNativeFunction();
    }
View Full Code Here

        }
    }

    public final DashArray getDashArray()
    {
        JsArrayMixed dash = getArray(Attribute.DASH_ARRAY.getProperty());

        if (null != dash)
        {
            DashArrayJSO djso = dash.cast();

            return new DashArray(djso);
        }
        return new DashArray();
    }
View Full Code Here

    public native String debugString(JavaScriptObject array, int i) /*-{
        return 'typeof=' + typeof array[i] + ' toString="' + array[i] + '"';
    }-*/;

    public JsArrayMixed toJso(List<Object> args) {
        JsArrayMixed result = (JsArrayMixed) JavaScriptObject.createArray();
        for (Object o : args) {
            if (o == null) {
                result.push((JavaScriptObject) null);
            } else if (o instanceof String) {
                result.push((String) o);
            } else if (o instanceof Date) {
                result.push(JsDate.create(((Date) o).getTime()));
            } else if (o instanceof Double) {
                result.push(((Double) o).doubleValue());
            } else {
                throw new IllegalArgumentException("Don't know how to handle "
                        + o);
            }
        }
View Full Code Here

            }
        }
    }

    private JsArrayMixed args(Object... args) {
        JsArrayMixed result = (JsArrayMixed) JavaScriptObject.createArray();

        for (Object x : args) {
            if (x instanceof String) {
                result.push((String) x);
            } else {
                result.push((JavaScriptObject) x);
            }
        }
        return result;
    }
View Full Code Here

        dateIn.setUTCMonth(4);
        dateIn.setUTCDate(15);
        dateIn.setUTCHours(22);
        dateIn.setUTCMinutes(13);

        JsArrayMixed mixed = (JsArrayMixed) JsArrayMixed.createArray();
        mixed.push(dateIn);
        mixed.push(new Double(123.12d));
        mixed.push("123");
        mixed.push("false");

        List<Object> list = JsList.get().toList(mixed);
        Date dateOut = (Date) list.get(0);
        Date dateOutUtc = new Date(dateOut.getTime() + 60 * 1000 * dateOut.getTimezoneOffset());
        assertEquals(14, dateOutUtc.getYear());
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.JsArrayMixed

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.