public boolean checkUint8ClampedArraySupport() { return ScriptHelper.evalBoolean("!!(window.Uint8ClampedArray)", this); }
public boolean runtimeSupportCheck() { return ScriptHelper.evalBoolean("!!(window.ArrayBuffer)", this); } }
public boolean isInterface() { return ScriptHelper.evalBoolean("this.$$$nativeClass___java_lang_Object.$$type == \"Interface\"", this); }
public boolean checkDataViewSupport() { return ScriptHelper.evalBoolean("!!(window.DataView)", this); }
public Class<?> getSubTypeWith(Object instance) { ScriptHelper.put("i", instance, this); boolean isElement= ScriptHelper.evalBoolean("i == 1", this); boolean isAttribute= ScriptHelper.evalBoolean("i == 2", this); if (isElement) return Element.class; else if (isAttribute) return Attr.class; else return Node.class; } }
/** * Returns true if this map maps one or more keys to the specified value. */ public boolean containsValue(Object value) { ScriptHelper.put("value", value, null); return ScriptHelper.evalBoolean("this.obj.containsValue(value)", null); }
public static boolean isLetterOrDigit(char c) { ScriptHelper.put("c", c, null); return ScriptHelper.evalBoolean("null != String.fromCharCode(c).match(/[A-Z\\d]/i)", null); };
public void printInnerStackTrace(PrintWriter printWriter) { if (ScriptHelper.evalBoolean("this.stack", this)) { String stack= (String) ScriptHelper.eval("this.stack", this); printWriter.print(stack); } }
public static boolean isProxyClass(Class class1) { ScriptHelper.put("class1", class1, null); return ScriptHelper.evalBoolean("class1 && class1.$$$nativeClass___java_lang_Object && class1.$$$nativeClass___java_lang_Object.classname.startsWith(\"ProxyOf_\")", null); }
@Override public boolean equals(java.lang.Object obj) { if (obj == null) return false; ScriptHelper.put("obj", obj, this); boolean result= ScriptHelper.evalBoolean("obj.$$$nativeClass___java_lang_Object == this.$$$nativeClass___java_lang_Object", this); return result; }
/** * Tells whether or not this string matches the given regular expression. */ public boolean matches(String regex) { ScriptHelper.put("regex", "^" + regex + "$", this); return ScriptHelper.evalBoolean("this.match(new RegExp(regex))!=null", this); }
/** * Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise. */ public static boolean isNaN(double v) { ScriptHelper.put("value", v, null); return ScriptHelper.evalBoolean("isNaN(value)", null); }
public Class<?> getSubTypeWith(Object instance) { ScriptHelper.put("contextType", instance, this); boolean is2d= ScriptHelper.evalBoolean("contextType == '2d'", this); boolean isGL= contextNames.contains(instance.toString()); if (is2d) return CanvasRenderingContext2D.class; else if (isGL) return WebGLRenderingContextExtension.class; return null; } }
/** * Compares this String to another String, ignoring case considerations. */ public boolean equalsIgnoreCase(String other) { if (other == null) return false; ScriptHelper.put("other", other, this); return ScriptHelper.evalBoolean("this.toLowerCase() == other.toLowerCase()", this); }
public Type getGenericReturnType() { Class<?> declaringClass= getDeclaringClass(); ScriptHelper.put("declaringClass", declaringClass, this); if (ScriptHelper.evalBoolean("declaringClass.$$$nativeClass___java_lang_Object.$$$$signatures ", this)) { String genericSignature= (String) ScriptHelper.eval("declaringClass.$$$nativeClass___java_lang_Object.$$$$signatures[this.$$$signature___java_lang_String]", this); return new ParameterizedTypeImpl(genericSignature.substring(genericSignature.indexOf(")") + 1)); } else return getReturnType(); }
/** * Returns true if this map contains a mapping for the specified key. */ public boolean containsKey(Object key) { ScriptHelper.put("key", getRealKey(key), null); return ScriptHelper.evalBoolean("this.obj.containsKey (key)", null); }
public Type getGenericType() { Class<?> declaringClass= getDeclaringClass(); ScriptHelper.put("declaringClass", declaringClass, this); if (ScriptHelper.evalBoolean("declaringClass.$$$nativeClass___java_lang_Object.$$$$signatures ", this)) { String genericSignature= (String) ScriptHelper.eval("declaringClass.$$$nativeClass___java_lang_Object.$$$$signatures[this.$$$signature___java_lang_String]", this); return new ParameterizedTypeImpl(genericSignature); } else return getType(); }
public static boolean containsKey(Object obj, String propertyName) { ScriptHelper.put("obj", obj, null); ScriptHelper.put("propertyName", propertyName, null); // Warning: Cannot use (obj[propertyName] != undefined) because // (null == undefined) evaluates to true. return ScriptHelper.evalBoolean("typeof(obj[propertyName]) != 'undefined'", null); }
public void clickPerformed(VisualComponent aVisualComponent) { ScriptHelper.put("e", radioButtonElement, this); boolean value= ScriptHelper.evalBoolean("e.node.checked", this); radioButton.setValue(value); } });
@MethodAlias(alias= "EventDispatcher.nrh") private static ReferenceHolder nrh(String id, String value, Boolean booleanValue, String type) { Boolean booleanValue2= ScriptHelper.evalBoolean("booleanValue", null); ScriptHelper.put("booleanValue2", booleanValue2, null); booleanValue2= (Boolean) ScriptHelper.eval("booleanValue != null ? booleanValue2 : null", null); ReferenceHolder referenceHolder= new ReferenceHolder(id, ServiceLocator.getInstance().getReflectionService().forName(type), value, booleanValue2); return referenceHolder; }