|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.terminal.gwt.client.Util
public class Util
Constructor Summary | |
---|---|
Util()
|
Method Summary | ||
---|---|---|
static void |
addPngFix(com.google.gwt.user.client.Element el)
Adds transparent PNG fix to image element; only use for IE6. |
|
static void |
alert(String string)
|
|
static void |
browserDebugger()
Helper method for debugging purposes. |
|
static com.google.gwt.user.client.Element |
cloneNode(com.google.gwt.user.client.Element element,
boolean deep)
Clones given element as in JavaScript. |
|
static void |
componentSizeUpdated(Set<Paintable> paintables)
Called when the size of one or more widgets have changed during rendering. |
|
static void |
detachAttach(com.google.gwt.user.client.Element element)
Detaches and re-attaches the element from its parent. |
|
static void |
doIE6PngFix(com.google.gwt.user.client.Element el)
|
|
static boolean |
equals(Object a,
Object b)
|
|
static String |
escapeAttribute(String attribute)
Escapes the string so it is safe to write inside an HTML attribute. |
|
static String |
escapeHTML(String html)
Converts html entities to text. |
|
static
|
findWidget(com.google.gwt.user.client.Element element,
Class<? extends com.google.gwt.user.client.ui.Widget> class1)
Helper method to find first instance of given Widget type found by traversing DOM upwards from given element. |
|
static void |
focus(com.google.gwt.user.client.Element el)
Will (attempt) to focus the given DOM Element. |
|
static void |
forceWebkitRedraw(com.google.gwt.user.client.Element element)
Force webkit to redraw an element |
|
static int |
getChildElementIndex(com.google.gwt.user.client.Element childElement)
Returns the index of the childElement within its parent. |
|
static Paintable |
getChildPaintableForElement(ApplicationConnection client,
Container parent,
com.google.gwt.user.client.Element element)
Locates the child component of |
|
static com.google.gwt.user.client.Element |
getElementFromPoint(int clientX,
int clientY)
Returns the topmost element of from given coordinates. |
|
static com.google.gwt.user.client.Element |
getElementUnderMouse(com.google.gwt.dom.client.NativeEvent event)
Find the element corresponding to the coordinates in the passed mouse event. |
|
static com.google.gwt.user.client.Element |
getIEFocusedElement()
Gets the currently focused element for Internet Explorer. |
|
static Container |
getLayout(com.google.gwt.user.client.ui.Widget component)
Returns closest parent Widget in hierarchy that implements Container interface |
|
static int |
getNativeScrollbarSize()
|
|
static Paintable |
getPaintableForElement(ApplicationConnection client,
com.google.gwt.user.client.ui.Widget parent,
com.google.gwt.user.client.Element element)
Locates the nested child component of |
|
static int |
getRequiredHeight(com.google.gwt.dom.client.Element element)
|
|
static int |
getRequiredHeight(com.google.gwt.user.client.ui.Widget widget)
|
|
static int |
getRequiredWidth(com.google.gwt.dom.client.Element element)
|
|
static int |
getRequiredWidth(com.google.gwt.user.client.ui.Widget widget)
|
|
static String |
getSimpleName(Object widget)
|
|
static int |
getTouchOrMouseClientX(com.google.gwt.user.client.Event event)
A helper method to return the client position from an event. |
|
static int |
getTouchOrMouseClientX(com.google.gwt.dom.client.NativeEvent event)
|
|
static int |
getTouchOrMouseClientY(com.google.gwt.user.client.Event event)
A helper method to return the client position from an event. |
|
static int |
getTouchOrMouseClientY(com.google.gwt.dom.client.NativeEvent currentGwtEvent)
|
|
static boolean |
isAttachedAndDisplayed(com.google.gwt.user.client.ui.Widget widget)
Kind of stronger version of isAttached(). |
|
static boolean |
isCached(UIDL uidl)
|
|
static boolean |
isFF2()
Deprecated. use BrowserInfo class instead |
|
static boolean |
isIE()
Deprecated. use BrowserInfo class instead |
|
static boolean |
isIE6()
Deprecated. use BrowserInfo class instead |
|
static boolean |
isIE7()
Deprecated. use BrowserInfo class instead |
|
static boolean |
isTouchEvent(com.google.gwt.user.client.Event event)
|
|
static boolean |
isTouchEvent(com.google.gwt.dom.client.NativeEvent event)
|
|
static boolean |
isTouchEventOrLeftMouseButton(com.google.gwt.user.client.Event event)
Checks if the given event is either a touch event or caused by the left mouse button |
|
static boolean |
mayHaveScrollBars(com.google.gwt.dom.client.Element pe)
Detects what is currently the overflow style attribute in given element. |
|
static int |
measureHorizontalBorder(com.google.gwt.user.client.Element element)
|
|
static int |
measureHorizontalPaddingAndBorder(com.google.gwt.user.client.Element element,
int paddingGuess)
|
|
static int |
measureMarginLeft(com.google.gwt.user.client.Element element)
|
|
static int |
measureVerticalBorder(com.google.gwt.user.client.Element element)
|
|
static int |
measureVerticalPaddingAndBorder(com.google.gwt.user.client.Element element,
int paddingGuess)
|
|
static void |
notifyParentOfSizeChange(Paintable widget,
boolean lazy)
This helper method can be called if components size have been changed outside rendering phase. |
|
static float |
parseRelativeSize(String size)
|
|
static RenderInformation.FloatSize |
parseRelativeSize(UIDL uidl)
Parses the UIDL parameter and fetches the relative size of the component. |
|
static void |
runIE7ZeroSizedBodyFix()
IE7 sometimes "forgets" to render content. |
|
static void |
runWebkitOverflowAutoFix(com.google.gwt.user.client.Element elem)
Run workaround for webkits overflow auto issue. |
|
static void |
scrollIntoViewVertically(com.google.gwt.user.client.Element elem)
Scrolls an element into view vertically only. |
|
static void |
setFloat(com.google.gwt.user.client.Element element,
String value)
|
|
static int |
setHeightExcludingPaddingAndBorder(com.google.gwt.user.client.Element element,
int requestedHeight,
int verticalPaddingBorderGuess,
boolean requestedHeightIncludesPaddingBorder)
|
|
static int |
setHeightExcludingPaddingAndBorder(com.google.gwt.user.client.ui.Widget widget,
String height,
int paddingBorderGuess)
|
|
static void |
setIEFocusedElement(com.google.gwt.user.client.Element elem)
Gets the currently focused element for Internet Explorer. |
|
static void |
setStyleTemporarily(com.google.gwt.user.client.Element element,
String styleProperty,
String tempValue)
Temporarily sets the styleProperty to tempValue and then
resets it to its current value. |
|
static int |
setWidthExcludingPaddingAndBorder(com.google.gwt.user.client.Element element,
int requestedWidth,
int horizontalPaddingBorderGuess,
boolean requestedWidthIncludesPaddingBorder)
|
|
static int |
setWidthExcludingPaddingAndBorder(com.google.gwt.user.client.ui.Widget widget,
String width,
int paddingBorderGuess)
|
|
static void |
shakeBodyElement()
Does some very small adjustments to body element. |
|
static void |
simulateClickFromTouchEvent(com.google.gwt.user.client.Event touchevent,
com.google.gwt.user.client.ui.Widget widget)
|
|
static void |
sinkOnloadForImages(com.google.gwt.user.client.Element element)
|
|
static void |
updateRelativeChildrenAndSendSizeUpdateEvent(ApplicationConnection client,
com.google.gwt.user.client.ui.HasWidgets container)
|
|
static void |
updateRelativeChildrenAndSendSizeUpdateEvent(ApplicationConnection client,
com.google.gwt.user.client.ui.HasWidgets container,
Paintable widget)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static void browserDebugger()
public static com.google.gwt.user.client.Element getElementFromPoint(int clientX, int clientY)
x
- y
-
public static void notifyParentOfSizeChange(Paintable widget, boolean lazy)
widget
- lazy
- run componentSizeUpdated lazylypublic static void componentSizeUpdated(Set<Paintable> paintables)
paintables
- public static float parseRelativeSize(String size)
public static Container getLayout(com.google.gwt.user.client.ui.Widget component)
component
-
@Deprecated public static boolean isIE()
@Deprecated public static boolean isIE6()
@Deprecated public static boolean isIE7()
@Deprecated public static boolean isFF2()
public static String escapeHTML(String html)
html
-
public static String escapeAttribute(String attribute)
attribute
- The string to escape
public static void addPngFix(com.google.gwt.user.client.Element el)
el
- IMG elementpublic static void doIE6PngFix(com.google.gwt.user.client.Element el)
public static com.google.gwt.user.client.Element cloneNode(com.google.gwt.user.client.Element element, boolean deep)
element
- deep
- clone child tree also
public static int measureHorizontalPaddingAndBorder(com.google.gwt.user.client.Element element, int paddingGuess)
public static int measureVerticalPaddingAndBorder(com.google.gwt.user.client.Element element, int paddingGuess)
public static int measureHorizontalBorder(com.google.gwt.user.client.Element element)
public static int measureVerticalBorder(com.google.gwt.user.client.Element element)
public static int measureMarginLeft(com.google.gwt.user.client.Element element)
public static int setHeightExcludingPaddingAndBorder(com.google.gwt.user.client.ui.Widget widget, String height, int paddingBorderGuess)
public static int setWidthExcludingPaddingAndBorder(com.google.gwt.user.client.ui.Widget widget, String width, int paddingBorderGuess)
public static int setWidthExcludingPaddingAndBorder(com.google.gwt.user.client.Element element, int requestedWidth, int horizontalPaddingBorderGuess, boolean requestedWidthIncludesPaddingBorder)
public static int setHeightExcludingPaddingAndBorder(com.google.gwt.user.client.Element element, int requestedHeight, int verticalPaddingBorderGuess, boolean requestedHeightIncludesPaddingBorder)
public static String getSimpleName(Object widget)
public static void setFloat(com.google.gwt.user.client.Element element, String value)
public static int getNativeScrollbarSize()
public static void runWebkitOverflowAutoFix(com.google.gwt.user.client.Element elem)
elem
- with overflow autopublic static RenderInformation.FloatSize parseRelativeSize(UIDL uidl)
uidl
-
public static boolean isCached(UIDL uidl)
public static void alert(String string)
public static boolean equals(Object a, Object b)
public static void updateRelativeChildrenAndSendSizeUpdateEvent(ApplicationConnection client, com.google.gwt.user.client.ui.HasWidgets container)
public static void updateRelativeChildrenAndSendSizeUpdateEvent(ApplicationConnection client, com.google.gwt.user.client.ui.HasWidgets container, Paintable widget)
public static int getRequiredWidth(com.google.gwt.dom.client.Element element)
public static int getRequiredHeight(com.google.gwt.dom.client.Element element)
public static int getRequiredWidth(com.google.gwt.user.client.ui.Widget widget)
public static int getRequiredHeight(com.google.gwt.user.client.ui.Widget widget)
public static boolean mayHaveScrollBars(com.google.gwt.dom.client.Element pe)
pe
- the element to detect
public static void runIE7ZeroSizedBodyFix()
public static void shakeBodyElement()
public static Paintable getChildPaintableForElement(ApplicationConnection client, Container parent, com.google.gwt.user.client.Element element)
#getPaintableForElement(ApplicationConnection, Container, Element)
for the deepest nested paintable of parent that contains the element.
client
- A reference to ApplicationConnectionparent
- The widget that contains element
- An element that is a sub element of the parent
public static Paintable getPaintableForElement(ApplicationConnection client, com.google.gwt.user.client.ui.Widget parent, com.google.gwt.user.client.Element element)
getChildPaintableForElement(ApplicationConnection, Container, Element)
for the immediate child component of parent that contains the element.
client
- A reference to ApplicationConnectionparent
- The widget that contains element
- An element that is a sub element of the parent
public static void focus(com.google.gwt.user.client.Element el)
el
- the element to focuspublic static <T> T findWidget(com.google.gwt.user.client.Element element, Class<? extends com.google.gwt.user.client.ui.Widget> class1)
element
- the element where to start seeking of Widgetclass1
- the Widget type to seek forpublic static void forceWebkitRedraw(com.google.gwt.user.client.Element element)
element
- The element that should be redrawnpublic static void detachAttach(com.google.gwt.user.client.Element element)
element
- The element to detach and re-attachpublic static void sinkOnloadForImages(com.google.gwt.user.client.Element element)
public static int getChildElementIndex(com.google.gwt.user.client.Element childElement)
subElement
-
public static void setStyleTemporarily(com.google.gwt.user.client.Element element, String styleProperty, String tempValue)
styleProperty
to tempValue
and then
resets it to its current value. Used mainly to work around rendering
issues in IE (and possibly in other browsers)
element
- The target elementstyleProperty
- The name of the property to settempValue
- The temporary valuepublic static int getTouchOrMouseClientX(com.google.gwt.user.client.Event event)
event
-
public static com.google.gwt.user.client.Element getElementUnderMouse(com.google.gwt.dom.client.NativeEvent event)
event
- the mouse event to get coordinates from
public static int getTouchOrMouseClientY(com.google.gwt.user.client.Event event)
event
-
public static int getTouchOrMouseClientY(com.google.gwt.dom.client.NativeEvent currentGwtEvent)
currentGwtEvent
-
getTouchOrMouseClientY(Event)
public static int getTouchOrMouseClientX(com.google.gwt.dom.client.NativeEvent event)
event
-
getTouchOrMouseClientX(Event)
public static boolean isTouchEvent(com.google.gwt.user.client.Event event)
public static boolean isTouchEvent(com.google.gwt.dom.client.NativeEvent event)
public static void simulateClickFromTouchEvent(com.google.gwt.user.client.Event touchevent, com.google.gwt.user.client.ui.Widget widget)
public static com.google.gwt.user.client.Element getIEFocusedElement()
public static void setIEFocusedElement(com.google.gwt.user.client.Element elem)
public static boolean isAttachedAndDisplayed(com.google.gwt.user.client.ui.Widget widget)
widget
-
public static void scrollIntoViewVertically(com.google.gwt.user.client.Element elem)
elem
- The element to scroll into viewpublic static boolean isTouchEventOrLeftMouseButton(com.google.gwt.user.client.Event event)
event
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |