public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gwt.core.client.JavaScriptObject |
addEventListener(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.user.client.EventListener listener)
Adds an event listener to an HTML element.
|
static void |
addEventListenerOnce(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.user.client.EventListener listener)
Removes (if exiting) and adds an event listener to an HTML element.
|
static void |
console(String msg)
Writes a debug message to the browser's console.
|
static void |
forceFullRepaint()
Will re-redner a screen on android.
|
static com.google.gwt.dom.client.Element |
getActiveElement()
Retunns the current active HTML Element.
|
static int |
getDevicePixelRatio()
Returns the device pixel ratio.
|
static int |
getHeight(com.google.gwt.dom.client.Element ele)
Computes the height of passed HTML element.
|
static int |
getMatrixY(com.google.gwt.dom.client.Element ele)
Returns the sixth 2D vector value.
|
static int |
getTargetItemIndex(com.google.gwt.dom.client.Element parent,
com.google.gwt.dom.client.EventTarget target)
Retuns the index of the target relative to his parent.
|
static String |
getTransitionEventName(com.google.gwt.dom.client.Element ele) |
static int |
getTranslateX(com.google.gwt.dom.client.Element ele)
Returns the x position of an element.
|
static int |
getTranslateY(com.google.gwt.dom.client.Element ele)
Returns the y position of an element.
|
static int |
getWidth(com.google.gwt.dom.client.Element ele)
Computes the width of passed HTML element.
|
static void |
hideKeyBoard()
A utility method to hide the soft keyboard
|
static boolean |
isHtmlFormControl(com.google.gwt.dom.client.Element ele)
Returns true if the passed HTML element is a Form element.
|
static boolean |
isSubclassOf(Class<?> class1,
Class<?> class2)
Returns true if class1 ist sublass of class2
|
static boolean |
isWVGA()
Bestimmt ob es sich um eine WVGA ausloesung handelt.
|
static void |
redirect(String url)
Fuhrt ein Redirect der url durch.
|
static void |
removeEventListener(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.core.client.JavaScriptObject callBack)
Removes an event listener form an HTML element.
|
static void |
removeTitleBar()
Removes the Title bar on Adroid
|
static void |
setTransitionDuration(com.google.gwt.dom.client.Element ele,
double value)
Sets a duration of an Transition.
|
static void |
setTranslateX(com.google.gwt.dom.client.Element ele,
double value)
Moves an element on x-axis.
|
static void |
setTranslateY(com.google.gwt.dom.client.Element ele,
double value)
Moves an element on y-axis.
|
public static void console(String msg)
msg - message to be writtenpublic static void redirect(String url)
url - die Zielurlpublic static void removeTitleBar()
public static void hideKeyBoard()
public static void forceFullRepaint()
public static com.google.gwt.core.client.JavaScriptObject addEventListener(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.user.client.EventListener listener)
ele - the elementevent - the eventcapture - .listener - the listener to addpublic static void addEventListenerOnce(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.user.client.EventListener listener)
ele - the elementevent - the eventcapture - .listener - the listener to addpublic static void removeEventListener(com.google.gwt.dom.client.Element ele,
String event,
boolean capture,
com.google.gwt.core.client.JavaScriptObject callBack)
ele - the elementevent - the eventcapture - .callBack - call back if removedpublic static boolean isHtmlFormControl(com.google.gwt.dom.client.Element ele)
ele - the html elementpublic static com.google.gwt.dom.client.Element getActiveElement()
public static boolean isWVGA()
public static int getDevicePixelRatio()
public static void setTranslateX(com.google.gwt.dom.client.Element ele,
double value)
ele - the element.value - the value in pxpublic static int getTranslateX(com.google.gwt.dom.client.Element ele)
ele - the elementpublic static void setTranslateY(com.google.gwt.dom.client.Element ele,
double value)
ele - the element.value - the value in pxpublic static int getTranslateY(com.google.gwt.dom.client.Element ele)
ele - the elementpublic static int getMatrixY(com.google.gwt.dom.client.Element ele)
ele - the element.public static void setTransitionDuration(com.google.gwt.dom.client.Element ele,
double value)
ele - the element.value - the valuepublic static String getTransitionEventName(com.google.gwt.dom.client.Element ele)
public static int getHeight(com.google.gwt.dom.client.Element ele)
ele - the height.public static int getWidth(com.google.gwt.dom.client.Element ele)
ele - the width.public static int getTargetItemIndex(com.google.gwt.dom.client.Element parent,
com.google.gwt.dom.client.EventTarget target)
parent - the paent.target - the target element.Copyright © 2011–2015 SWM. All rights reserved.