com.extjs.gxt.ui.client.js
Class JsUtil

java.lang.Object
  extended by com.extjs.gxt.ui.client.js.JsUtil

public class JsUtil
extends java.lang.Object

JavaScript related methods.


Constructor Summary
JsUtil()
           
 
Method Summary
static com.google.gwt.core.client.JavaScriptObject eval(java.lang.String code)
          Creates a new javascript object from the JSON text.
static boolean isInteger(java.lang.String value)
          Returns true if the value is a integer.
static
<X> java.util.List<X>
subList(java.util.List<X> list, int start, int end)
          Returns a section of the given list.
static com.google.gwt.user.client.Element[] toElementArray(com.google.gwt.core.client.JavaScriptObject jsArray)
          Converts a native javascript array to an element array.
static com.google.gwt.core.client.JavaScriptObject toJavaScriptArray(java.lang.Object[] array)
          Converts a object array to a javascript array.
static
<V> com.google.gwt.core.client.JavaScriptObject
toJavaScriptObject(java.util.Map<java.lang.String,V> params)
          Converts a map into a javascript object, setting all values as properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsUtil

public JsUtil()
Method Detail

eval

public static com.google.gwt.core.client.JavaScriptObject eval(java.lang.String code)
Creates a new javascript object from the JSON text.

Parameters:
code - the JSON text
Returns:
the new javascript object

isInteger

public static boolean isInteger(java.lang.String value)
Returns true if the value is a integer.

Parameters:
value - the value to test
Returns:
the integer state

subList

public static <X> java.util.List<X> subList(java.util.List<X> list,
                                            int start,
                                            int end)
Returns a section of the given list.

Parameters:
list - the list
start - the start index
end - the end index
Returns:
the sub list

toElementArray

public static com.google.gwt.user.client.Element[] toElementArray(com.google.gwt.core.client.JavaScriptObject jsArray)
Converts a native javascript array to an element array.

Parameters:
jsArray - the array to be converted
Returns:
the element array

toJavaScriptArray

public static com.google.gwt.core.client.JavaScriptObject toJavaScriptArray(java.lang.Object[] array)
Converts a object array to a javascript array.

Parameters:
array - the java array
Returns:
the new javascript array

toJavaScriptObject

public static <V> com.google.gwt.core.client.JavaScriptObject toJavaScriptObject(java.util.Map<java.lang.String,V> params)
Converts a map into a javascript object, setting all values as properties. Map keys must be strings.

Parameters:
params - the parameters
Returns:
the new javascript object