List of usage examples for com.google.gwt.core.client JsArrayMixed getBoolean
public final native boolean getBoolean(int index) ;
From source file:com.ait.toolkit.node.dev.debug.TearOff.java
License:Open Source License
@Override @SuppressWarnings("unchecked") public JavaScriptReturningFunction<T> call(JavaScriptFunctionArguments args) { final int dispId = Integer.valueOf(args.get(1).toString()); return new JavaScriptReturningFunctionWrapper<T>() { @Override//from w ww .j a v a 2 s. com public T call(JavaScriptFunctionArguments args) { Object[] newArgs = new Object[args.length() + 2]; 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(); }