|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.allen_sauer.gwt.dnd.client.util.DOMUtil
public class DOMUtil
Provides DOM utility methods.
Field Summary | |
---|---|
static boolean |
DEBUG
Whether or not debugging is enabled. |
Constructor Summary | |
---|---|
DOMUtil()
|
Method Summary | |
---|---|
static java.lang.String |
adjustTitleForBrowser(java.lang.String title)
Adjust line breaks within in the provided title for optimal readability and display length for the current user agent. |
static void |
cancelAllDocumentSelections()
Cancel all currently selected region(s) on the current page. |
static void |
debugWidgetWithColor(com.google.gwt.user.client.ui.Widget widget,
java.lang.String color)
Set a widget's border style for debugging purposes. |
static void |
fastSetElementPosition(com.google.gwt.dom.client.Element elem,
int left,
int top)
Set an element's location as fast as possible, avoiding some of the overhead in AbsolutePanel.setWidgetPosition(Widget, int, int) . |
static int |
findIntersect(com.google.gwt.user.client.ui.IndexedPanel parent,
Location location,
LocationWidgetComparator comparator)
Find child widget intersection at the provided location using the provided comparator strategy. |
static int |
getBorderLeft(com.google.gwt.dom.client.Element elem)
Gets an element's CSS based 'border-left-width' in pixels or 0 (zero) when the
element is hidden. |
static int |
getBorderTop(com.google.gwt.dom.client.Element elem)
Gets an element's CSS based 'border-top-widget' in pixels or 0 (zero) when the
element is hidden. |
static int |
getClientHeight(com.google.gwt.dom.client.Element elem)
Gets an element's client height in pixels or 0 (zero) when the element is hidden. |
static int |
getClientWidth(com.google.gwt.dom.client.Element elem)
Gets an element's client widget in pixels or 0 (zero) when the element is hidden. |
static java.lang.String |
getEffectiveStyle(com.google.gwt.dom.client.Element elem,
java.lang.String styleName)
|
static int |
getHorizontalBorders(com.google.gwt.user.client.ui.Widget widget)
Gets the sum of an element's left and right CSS borders in pixels. |
static java.lang.String |
getNodeName(com.google.gwt.dom.client.Element elem)
Determine an element's node name via the nodeName property. |
static int |
getVerticalBorders(com.google.gwt.user.client.ui.Widget widget)
Gets the sum of an element's top and bottom CSS borders in pixels. |
static void |
reportFatalAndThrowRuntimeException(java.lang.String msg)
Report a fatal exception via Window.alert() than throw a RuntimeException . |
static void |
setStatus(java.lang.String text)
Set the browser's status bar text, if supported and enabled in the client browser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
Constructor Detail |
---|
public DOMUtil()
Method Detail |
---|
public static java.lang.String adjustTitleForBrowser(java.lang.String title)
title
- the desired raw text
public static void cancelAllDocumentSelections()
public static void debugWidgetWithColor(com.google.gwt.user.client.ui.Widget widget, java.lang.String color)
widget
- the widget to colorcolor
- the desired border colorpublic static void fastSetElementPosition(com.google.gwt.dom.client.Element elem, int left, int top)
AbsolutePanel.setWidgetPosition(Widget, int, int)
.
elem
- the element's whose position is to be modifiedleft
- the left pixel offsettop
- the top pixel offsetpublic static int findIntersect(com.google.gwt.user.client.ui.IndexedPanel parent, Location location, LocationWidgetComparator comparator)
parent
- the parent widget which contains the children to be comparedlocation
- the location of the intersectioncomparator
- the comparator strategy
public static int getBorderLeft(com.google.gwt.dom.client.Element elem)
0
(zero) when the
element is hidden.
elem
- the element to be measured
public static int getBorderTop(com.google.gwt.dom.client.Element elem)
0
(zero) when the
element is hidden.
elem
- the element to be measured
public static int getClientHeight(com.google.gwt.dom.client.Element elem)
0
(zero) when the element is hidden.
This is equal to offset height minus the top and bottom CSS borders.
elem
- the element to be measured
public static int getClientWidth(com.google.gwt.dom.client.Element elem)
0
(zero) when the element is hidden.
This is equal to offset width minus the left and right CSS borders.
elem
- the element to be measured
public static java.lang.String getEffectiveStyle(com.google.gwt.dom.client.Element elem, java.lang.String styleName)
public static int getHorizontalBorders(com.google.gwt.user.client.ui.Widget widget)
widget
- the widget to be measured
public static java.lang.String getNodeName(com.google.gwt.dom.client.Element elem)
nodeName
property.
elem
- the element whose node name is to be determined
public static int getVerticalBorders(com.google.gwt.user.client.ui.Widget widget)
widget
- the widget to be measured
public static void reportFatalAndThrowRuntimeException(java.lang.String msg) throws java.lang.RuntimeException
Window.alert()
than throw a RuntimeException
.
msg
- the message to report
java.lang.RuntimeException
- a new exception based on the provided messagepublic static void setStatus(java.lang.String text)
text
- the message to use as the window status
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |