|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectasquare.gwt.tk.client.util.JsUtil
public class JsUtil
JSNI methods for working with native JavaScript objects.
| Constructor Summary | |
|---|---|
JsUtil()
|
|
| Method Summary | |
|---|---|
static JavaScriptObject |
arrayConvert(float[] array)
Converts an array of float to a native JavaScript array. |
static JavaScriptObject |
arrayConvert(int[] array)
Converts an array of int to a native JavaScript array. |
static JavaScriptObject |
arrayConvert(Object[] array)
Converts an array of objects to a native JavaScript array. |
static float |
arrayGetFloat(JavaScriptObject array,
int index)
Get a float value from a native JavaScript array. |
static int |
arrayGetInt(JavaScriptObject array,
int index)
Get an int value from a native JavaScript array. |
static Object |
arrayGetObject(JavaScriptObject array,
int index)
Get an object from a native JavaScript array. |
static int |
arrayLength(JavaScriptObject array)
Get the length of a native JavaScript array. |
static JavaScriptObject |
arrayNewArray(int length)
Constructs an empty native JavaScript array. |
static void |
arraySet(JavaScriptObject array,
int index,
float value)
Set a float value at the specified index in a native JavaScript array. |
static void |
arraySet(JavaScriptObject array,
int index,
int value)
Set an int value at the specified index in a native JavaScript array. |
static void |
arraySet(JavaScriptObject array,
int index,
Object value)
Set an object at the specified index in a native JavaScript array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsUtil()
| Method Detail |
|---|
public static JavaScriptObject arrayConvert(int[] array)
array - a regular Java array
public static JavaScriptObject arrayConvert(float[] array)
array - a regular Java array
public static JavaScriptObject arrayConvert(Object[] array)
array - a regular Java array
public static JavaScriptObject arrayNewArray(int length)
length - the array length
JavaScriptException - if length is less than 0public static int arrayLength(JavaScriptObject array)
array - an opaque handle to a JavaScript array
JavaScriptException - if the array is null
public static int arrayGetInt(JavaScriptObject array,
int index)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0
JavaScriptException - if the array is null
JavaScriptException - if the index is out of bounds
JavaScriptException - if value at the index is not coercable to an
int (hosted mode only)
public static float arrayGetFloat(JavaScriptObject array,
int index)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0
JavaScriptException - if the array is null
JavaScriptException - if the index is out of bounds
JavaScriptException - if value at the index is not coercable to a
float (hosted mode only)
public static Object arrayGetObject(JavaScriptObject array,
int index)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0
JavaScriptException - if the array is null
JavaScriptException - if the index is out of bounds
JavaScriptException - if value at the index is not an object
(hosted mode only)
public static void arraySet(JavaScriptObject array,
int index,
int value)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0value - an integer primative value
JavaScriptException - if the array is null
JavaScriptException - if the index is negative
public static void arraySet(JavaScriptObject array,
int index,
float value)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0value - an float primative value
JavaScriptException - if the array is null
JavaScriptException - if the index is negative
public static void arraySet(JavaScriptObject array,
int index,
Object value)
array - an opaque handle to a JavaScript arrayindex - the index, starting at 0value - an object
JavaScriptException - if the array is null
JavaScriptException - if the index is negative
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||