public class DOM extends Object
Constructor and Description |
---|
DOM() |
Modifier and Type | Method and Description |
---|---|
static void |
addEventPreview(EventPreview preview)
Deprecated.
|
static void |
appendChild(Element parent,
Element child)
Deprecated.
|
static void |
appendChild(Element parent,
Element child)
Appends one element to another's list of children.
|
static Element |
asOld(Element elem)
|
static Element |
clone(Element elem,
boolean deep)
Clones an element.
|
static boolean |
compare(Element elem1,
Element elem2)
Deprecated.
Use identity comparison.
|
static Element |
createAnchor()
Creates an HTML A element.
|
static Element |
createButton()
Creates an HTML BUTTON element.
|
static Element |
createCaption()
Creates an HTML CAPTION element.
|
static Element |
createCol()
Creates an HTML COL element.
|
static Element |
createColGroup()
Creates an HTML COLGROUP element.
|
static Element |
createDiv()
Creates an HTML DIV element.
|
static Element |
createElement(String tagName)
Creates an HTML element.
|
static Element |
createFieldSet()
Creates an HTML FIELDSET element.
|
static Element |
createForm()
Creates an HTML FORM element.
|
static Element |
createIFrame()
Creates an HTML IFRAME element.
|
static Element |
createImg()
Creates an HTML IMG element.
|
static Element |
createInputCheck()
Creates an HTML INPUT type='CHECK' element.
|
static Element |
createInputPassword()
Creates an HTML INPUT type='PASSWORD' element.
|
static Element |
createInputRadio(String name)
Creates an HTML INPUT type='RADIO' element.
|
static Element |
createInputText()
Creates an HTML INPUT type='TEXT' element.
|
static Element |
createLabel()
Creates an HTML LABEL element.
|
static Element |
createLegend()
Creates an HTML LEGEND element.
|
static Element |
createOption()
Creates an HTML OPTION element.
|
static Element |
createOptions()
Deprecated.
there is no "options" element; use
createOption()
instead |
static Element |
createSelect()
Creates a single-selection HTML SELECT element.
|
static Element |
createSelect(boolean multiple)
Creates an HTML SELECT element.
|
static Element |
createSpan()
Creates an HTML SPAN element.
|
static Element |
createTable()
Creates an HTML TABLE element.
|
static Element |
createTBody()
Creates an HTML TBODY element.
|
static Element |
createTD()
Creates an HTML TD element.
|
static Element |
createTextArea()
Creates an HTML TEXTAREA element.
|
static Element |
createTFoot()
Creates an HTML TFOOT element.
|
static Element |
createTH()
Creates an HTML TH element.
|
static Element |
createTHead()
Creates an HTML THEAD element.
|
static Element |
createTR()
Creates an HTML TR element.
|
static String |
createUniqueId()
Generates a unique DOM id.
|
static boolean |
dispatchEvent(Event evt,
Element elem)
This method is a similar to
dispatchEvent(Event, Element, EventListener) but only
dispatches if an event listener is set to element. |
static void |
dispatchEvent(Event evt,
Element elem,
EventListener listener)
This method is called directly by native code when any event is fired.
|
static void |
eventCancelBubble(Event evt,
boolean cancel)
Cancels bubbling for the given event.
|
static boolean |
eventGetAltKey(Event evt)
Deprecated.
Use
NativeEvent.getAltKey() instead. |
static int |
eventGetButton(Event evt)
Deprecated.
Use
NativeEvent.getButton() instead. |
static int |
eventGetClientX(Event evt)
Deprecated.
Use
NativeEvent.getClientX() instead. |
static int |
eventGetClientY(Event evt)
Deprecated.
Use
NativeEvent.getClientY() instead. |
static boolean |
eventGetCtrlKey(Event evt)
Deprecated.
Use
NativeEvent.getCtrlKey() instead. |
static Event |
eventGetCurrentEvent()
Gets the current event that is being fired.
|
static Element |
eventGetCurrentTarget(Event evt)
Gets the current target element of the given event.
|
static Element |
eventGetFromElement(Event evt)
Gets the element from which the mouse pointer was moved (valid for
Event.ONMOUSEOVER and Event.ONMOUSEOUT ). |
static int |
eventGetKeyCode(Event evt)
Deprecated.
Use
NativeEvent.getKeyCode() instead. |
static boolean |
eventGetMetaKey(Event evt)
Deprecated.
Use
NativeEvent.getMetaKey() instead. |
static int |
eventGetMouseWheelVelocityY(Event evt)
Deprecated.
Use
NativeEvent.getMouseWheelVelocityY() instead. |
static boolean |
eventGetRepeat(Event evt)
Deprecated.
not supported in any browser but IE
|
static int |
eventGetScreenX(Event evt)
Deprecated.
Use
NativeEvent.getScreenX() instead. |
static int |
eventGetScreenY(Event evt)
Deprecated.
Use
NativeEvent.getScreenY() instead. |
static boolean |
eventGetShiftKey(Event evt)
Deprecated.
Use
NativeEvent.getShiftKey() instead. |
static Element |
eventGetTarget(Event evt)
Returns the element that was the actual target of the given event.
|
static Element |
eventGetToElement(Event evt)
Gets the element to which the mouse pointer was moved (only valid for
Event.ONMOUSEOUT and Event.ONMOUSEOVER ). |
static int |
eventGetType(Event evt)
Gets the enumerated type of this event (as defined in
Event ). |
static String |
eventGetTypeString(Event evt)
Deprecated.
Use
NativeEvent.getType() instead. |
static void |
eventPreventDefault(Event evt)
Deprecated.
Use
NativeEvent.preventDefault() instead. |
static void |
eventSetKeyCode(Event evt,
char key)
Deprecated.
this method only works in IE and should not have been added to
the API
|
static String |
eventToString(Event evt)
Deprecated.
Use
NativeEvent.getString() instead. |
static int |
getAbsoluteLeft(Element elem)
Deprecated.
Use
Element.getAbsoluteLeft() instead. |
static int |
getAbsoluteLeft(Element elem)
Deprecated.
Use
Element.getAbsoluteLeft() instead. |
static int |
getAbsoluteTop(Element elem)
Deprecated.
Use
Element.getAbsoluteTop() instead. |
static int |
getAbsoluteTop(Element elem)
Deprecated.
Use
Element.getAbsoluteTop() instead. |
static String |
getAttribute(Element elem,
String attr)
Deprecated.
Use the more appropriately named
Element.getPropertyString(String) instead. |
static boolean |
getBooleanAttribute(Element elem,
String attr)
Deprecated.
Use the more appropriately named
Element.getPropertyBoolean(String) instead. |
static Element |
getCaptureElement()
Gets the element that currently has mouse capture.
|
static Element |
getChild(Element parent,
int index)
Deprecated.
|
static Element |
getChild(Element parent,
int index)
Gets an element's n-th child element.
|
static int |
getChildCount(Element parent)
Deprecated.
|
static int |
getChildCount(Element parent)
Gets the number of child elements present in a given parent element.
|
static int |
getChildIndex(Element parent,
Element child)
Deprecated.
|
static int |
getChildIndex(Element parent,
Element child)
Gets the index of a given child element within its parent.
|
static String |
getElementAttribute(Element elem,
String attr)
Deprecated.
Use
Element.getAttribute(String) instead. |
static String |
getElementAttribute(Element elem,
String attr)
Deprecated.
Use
Element.getAttribute(String) instead. |
static Element |
getElementById(String id)
Gets the element associated with the given unique id within the entire
document.
|
static String |
getElementProperty(Element elem,
String prop)
Deprecated.
Use
Element#getProperty(String) instead. |
static String |
getElementProperty(Element elem,
String prop)
Deprecated.
Use
Element#getProperty(String) instead. |
static boolean |
getElementPropertyBoolean(Element elem,
String prop)
Deprecated.
Use
Element.getPropertyBoolean(String) instead. |
static int |
getElementPropertyInt(Element elem,
String prop)
Deprecated.
Use
Element.getPropertyInt(String) instead. |
static EventListener |
getEventListener(Element elem)
Gets the
EventListener that will receive events for the given
element. |
static int |
getEventsSunk(Element elem)
Gets the current set of events sunk by a given element.
|
static Element |
getFirstChild(Element elem)
Gets the first child element of the given element.
|
static String |
getImgSrc(Element img)
Gets the src attribute of an img element.
|
static String |
getInnerHTML(Element elem)
Deprecated.
Use
Element.getInnerHTML() instead. |
static String |
getInnerHTML(Element elem)
Deprecated.
Use
Element.getInnerHTML() instead. |
static String |
getInnerText(Element elem)
Deprecated.
Use
Element.getInnerText() instead. |
static String |
getInnerText(Element elem)
Deprecated.
Use
Element.getInnerText() instead. |
static int |
getIntAttribute(Element elem,
String attr)
Deprecated.
Use the more appropriately named
Element.getPropertyInt(String) instead. |
static int |
getIntAttribute(Element elem,
String attr)
Deprecated.
Use the more appropriately named
Element.getPropertyInt(String) instead. |
static int |
getIntStyleAttribute(Element elem,
String attr)
Gets an integer attribute on a given element's style.
|
static Element |
getNextSibling(Element elem)
Gets an element's next sibling element.
|
static Element |
getParent(Element elem)
Deprecated.
|
static Element |
getParent(Element elem)
Gets an element's parent element.
|
static String |
getStyleAttribute(Element elem,
String attr)
Deprecated.
Use
Element.getStyle() and
Style#getProperty(String) instead. |
static String |
getStyleAttribute(Element elem,
String attr)
Deprecated.
Use
Element.getStyle() and
Style#getProperty(String) instead. |
static void |
insertBefore(Element parent,
Element child,
Element before)
Inserts an element as a child of the given parent element, before another
child of that parent.
|
static void |
insertChild(Element parent,
Element child,
int index)
Deprecated.
|
static void |
insertChild(Element parent,
Element child,
int index)
Inserts an element as a child of the given parent element.
|
static void |
insertListItem(Element selectElem,
String item,
String value,
int index)
Creates an
<option> element and inserts it as a child of
the specified <select> element. |
static boolean |
isOrHasChild(Element parent,
Element child)
Deprecated.
Use
Element#isOrHasChild(Element) instead. |
static boolean |
previewEvent(Event evt)
This method is called directly by native code when event preview is being
used.
|
static void |
releaseCapture(Element elem)
Releases mouse/touch/gesture capture on the given element.
|
static void |
removeChild(Element parent,
Element child)
Deprecated.
Use
Element#removeChild(Element) instead. |
static void |
removeChild(Element parent,
Element child)
Deprecated.
Use
Element#removeChild(Element) instead. |
static void |
removeElementAttribute(Element elem,
String attr)
Deprecated.
Use
Element.removeAttribute(String) instead. |
static void |
removeEventPreview(EventPreview preview)
Deprecated.
use
HandlerRegistration
returned from
Event.addNativePreviewHandler(Event.NativePreviewHandler) |
static void |
scrollIntoView(Element elem)
Deprecated.
Use
Element.scrollIntoView() instead. |
static void |
setAttribute(Element elem,
String attr,
String value)
Deprecated.
Use the more appropriately named
Element.setPropertyString(String, String) instead. |
static void |
setBooleanAttribute(Element elem,
String attr,
boolean value)
Deprecated.
Use the more appropriately named
Element.setPropertyBoolean(String, boolean)
instead. |
static void |
setCapture(Element elem)
Sets mouse/touch/gesture capture on the given element.
|
static void |
setElementAttribute(Element elem,
String attr,
String value)
Deprecated.
Use
Element.setAttribute(String, String) instead. |
static void |
setElementProperty(Element elem,
String prop,
String value)
Deprecated.
Use
Element.setPropertyString(String, String) instead. |
static void |
setElementProperty(Element elem,
String prop,
String value)
Deprecated.
Use
Element.setPropertyString(String, String) instead. |
static void |
setElementPropertyBoolean(Element elem,
String prop,
boolean value)
Deprecated.
Use
Element.setPropertyBoolean(String, boolean) instead. |
static void |
setElementPropertyInt(Element elem,
String prop,
int value)
Deprecated.
Use
Element.setPropertyInt(String, int) instead. |
static void |
setEventListener(Element elem,
EventListener listener)
Sets the
EventListener to receive events for the given element. |
static void |
setImgSrc(Element img,
String src)
Sets the src attribute of an img element.
|
static void |
setInnerHTML(Element elem,
String html)
Deprecated.
Use
Element.setInnerHTML(String) instead. |
static void |
setInnerText(Element elem,
String text)
Deprecated.
Use
Element.setInnerText(String) instead. |
static void |
setIntAttribute(Element elem,
String attr,
int value)
Deprecated.
Use the more appropriately named
Element.setPropertyInt(String, int) instead. |
static void |
setIntStyleAttribute(Element elem,
String attr,
int value)
Sets an integer attribute on the given element's style.
|
static void |
setOptionText(Element select,
String text,
int index)
Sets the option text of the given select object.
|
static void |
setStyleAttribute(Element elem,
String attr,
String value)
Deprecated.
Use
Element.getStyle() and
Style#setProperty(String, String) instead. |
static void |
setStyleAttribute(Element elem,
String attr,
String value)
Deprecated.
Use
Element.getStyle() and
Style#setProperty(String, String) instead. |
static void |
sinkBitlessEvent(Element elem,
String eventTypeName)
Sinks a named event.
|
static void |
sinkEvents(Element elem,
int eventBits)
Sets the current set of events sunk by a given element.
|
static String |
toString(Element elem)
Deprecated.
Use
Element.getString() instead. |
static String |
toString(Element elem)
Deprecated.
Use
Element.getString() instead. |
static int |
windowGetClientHeight()
Deprecated.
As of GWT 1.5, replaced by
Window.getClientHeight() |
static int |
windowGetClientWidth()
Deprecated.
As of GWT 1.5, replaced by
Window.getClientWidth() |
@Deprecated public static void addEventPreview(EventPreview preview)
Event.addNativePreviewHandler(Event.NativePreviewHandler)
preview
- the event preview to be added to the stack.@Deprecated public static void appendChild(Element parent, Element child)
If the child element is a PotentialElement
, it is first
resolved.
parent
- the parent elementchild
- its new childPotentialElement.resolve(Element)
public static void appendChild(Element parent, Element child)
If the child element is a PotentialElement
, it is first
resolved.
parent
- the parent elementchild
- its new childPotentialElement.resolve(Element)
public static Element clone(Element elem, boolean deep)
elem
- the element to be cloneddeep
- should children be cloned as well?@Deprecated public static boolean compare(Element elem1, Element elem2)
elem1
- the first element to be comparedelem2
- the second element to be comparedtrue
if they are in fact the same elementpublic static Element createAnchor()
public static Element createButton()
public static Element createCaption()
public static Element createCol()
public static Element createColGroup()
public static Element createDiv()
public static Element createElement(String tagName)
tagName
- the HTML tag of the element to be createdpublic static Element createFieldSet()
public static Element createForm()
public static Element createIFrame()
public static Element createImg()
public static Element createInputCheck()
public static Element createInputPassword()
public static Element createInputRadio(String name)
name
- the name of the group with which this radio button will be
associatedpublic static Element createInputText()
public static Element createLabel()
public static Element createLegend()
public static Element createOption()
@Deprecated public static Element createOptions()
createOption()
insteadpublic static Element createSelect()
createSelect(false)
public static Element createSelect(boolean multiple)
multiple
- true if multiple selection of options is allowedpublic static Element createSpan()
public static Element createTable()
public static Element createTBody()
public static Element createTD()
public static Element createTextArea()
public static Element createTFoot()
public static Element createTH()
public static Element createTHead()
public static Element createTR()
public static String createUniqueId()
public static void eventCancelBubble(Event evt, boolean cancel)
evt
- the event on which to cancel bubblingcancel
- true
to cancel bubbling@Deprecated public static boolean eventGetAltKey(Event evt)
NativeEvent.getAltKey()
instead.evt
- the event to be testedtrue
if ALT was depressed when the event occurred@Deprecated public static int eventGetButton(Event evt)
NativeEvent.getButton()
instead.evt
- the event to be testedNativeEvent.BUTTON_LEFT
,
NativeEvent.BUTTON_MIDDLE
, and NativeEvent.BUTTON_RIGHT
@Deprecated public static int eventGetClientX(Event evt)
NativeEvent.getClientX()
instead.evt
- the event to be tested@Deprecated public static int eventGetClientY(Event evt)
NativeEvent.getClientY()
instead.evt
- the event to be tested@Deprecated public static boolean eventGetCtrlKey(Event evt)
NativeEvent.getCtrlKey()
instead.evt
- the event to be testedtrue
if CTRL was depressed when the event occurredpublic static Event eventGetCurrentEvent()
public static Element eventGetCurrentTarget(Event evt)
evt
- the eventeventGetTarget(Event)
public static Element eventGetFromElement(Event evt)
Event.ONMOUSEOVER
and Event.ONMOUSEOUT
).evt
- the event to be tested@Deprecated public static int eventGetKeyCode(Event evt)
NativeEvent.getKeyCode()
instead.
For Event.ONKEYPRESS
, this method returns the Unicode value of the
character generated. For Event.ONKEYDOWN
and Event.ONKEYUP
,
it returns the code associated with the physical key.
evt
- the event to be testedKeyboardListener
@Deprecated public static boolean eventGetMetaKey(Event evt)
NativeEvent.getMetaKey()
instead.evt
- the event to be testedtrue
if META was depressed when the event occurred@Deprecated public static int eventGetMouseWheelVelocityY(Event evt)
NativeEvent.getMouseWheelVelocityY()
instead.The velocity of the event is an artifical measurement for relative comparisons of wheel activity. It is affected by some non-browser factors, including choice of input hardware and mouse acceleration settings. The sign of the velocity measurement agrees with the screen coordinate system; negative values are towards the origin and positive values are away from the origin. Standard scrolling speed is approximately ten units per event.
evt
- the event to be examined.@Deprecated public static boolean eventGetRepeat(Event evt)
evt
- the event to be testedtrue
if this key event was an auto-repeat@Deprecated public static int eventGetScreenX(Event evt)
NativeEvent.getScreenX()
instead.evt
- the event to be tested@Deprecated public static int eventGetScreenY(Event evt)
NativeEvent.getScreenY()
instead.evt
- the event to be tested@Deprecated public static boolean eventGetShiftKey(Event evt)
NativeEvent.getShiftKey()
instead.evt
- the event to be testedtrue
if shift was depressed when the event occurredpublic static Element eventGetTarget(Event evt)
evt
- the event to be testedpublic static Element eventGetToElement(Event evt)
Event.ONMOUSEOUT
and Event.ONMOUSEOVER
).evt
- the event to be testedpublic static int eventGetType(Event evt)
Event
).evt
- the event to be tested@Deprecated public static String eventGetTypeString(Event evt)
NativeEvent.getType()
instead.evt
- the event to be tested@Deprecated public static void eventPreventDefault(Event evt)
NativeEvent.preventDefault()
instead.evt
- the event whose default action is to be prevented@Deprecated public static void eventSetKeyCode(Event evt, char key)
evt
- the event whose key code is to be setkey
- the new key code@Deprecated public static String eventToString(Event evt)
NativeEvent.getString()
instead.evt
- the event to stringize@Deprecated public static int getAbsoluteLeft(Element elem)
Element.getAbsoluteLeft()
instead.elem
- the element to be measured@Deprecated public static int getAbsoluteLeft(Element elem)
Element.getAbsoluteLeft()
instead.elem
- the element to be measured@Deprecated public static int getAbsoluteTop(Element elem)
Element.getAbsoluteTop()
instead.elem
- the element to be measured@Deprecated public static int getAbsoluteTop(Element elem)
Element.getAbsoluteTop()
instead.elem
- the element to be measured@Deprecated public static String getAttribute(Element elem, String attr)
Element.getPropertyString(String)
instead.elem
- the element whose property is to be retrievedattr
- the name of the property@Deprecated public static boolean getBooleanAttribute(Element elem, String attr)
Element.getPropertyBoolean(String)
instead.elem
- the element whose property is to be setattr
- the name of the property to be setpublic static Element getCaptureElement()
null
if none
exists@Deprecated public static Element getChild(Element parent, int index)
parent
- the element whose child is to be retrievedindex
- the index of the child elementpublic static Element getChild(Element parent, int index)
parent
- the element whose child is to be retrievedindex
- the index of the child element@Deprecated public static int getChildCount(Element parent)
parent
- the element whose children are to be countedpublic static int getChildCount(Element parent)
parent
- the element whose children are to be counted@Deprecated public static int getChildIndex(Element parent, Element child)
parent
- the parent elementchild
- the child element-1
if it is
not a child of the given parentpublic static int getChildIndex(Element parent, Element child)
parent
- the parent elementchild
- the child element-1
if it is
not a child of the given parent@Deprecated public static String getElementAttribute(Element elem, String attr)
Element.getAttribute(String)
instead.elem
- the element whose property is to be retrievedattr
- the name of the attribute@Deprecated public static String getElementAttribute(Element elem, String attr)
Element.getAttribute(String)
instead.elem
- the element whose property is to be retrievedattr
- the name of the attributepublic static Element getElementById(String id)
id
- the id whose associated element is to be retrievednull
if none is found@Deprecated public static String getElementProperty(Element elem, String prop)
Element#getProperty(String)
instead.elem
- the element whose property is to be retrievedprop
- the name of the property@Deprecated public static String getElementProperty(Element elem, String prop)
Element#getProperty(String)
instead.elem
- the element whose property is to be retrievedprop
- the name of the property@Deprecated public static boolean getElementPropertyBoolean(Element elem, String prop)
Element.getPropertyBoolean(String)
instead.elem
- the element whose property is to be retrievedprop
- the name of the property@Deprecated public static int getElementPropertyInt(Element elem, String prop)
Element.getPropertyInt(String)
instead.elem
- the element whose property is to be retrievedprop
- the name of the propertypublic static EventListener getEventListener(Element elem)
EventListener
that will receive events for the given
element. Only one such listener may exist for a single element.elem
- the element whose listener is to be setpublic static int getEventsSunk(Element elem)
elem
- the element whose events are to be retrievedEvent
)public static Element getFirstChild(Element elem)
elem
- the element whose child is to be retrievedpublic static String getImgSrc(Element img)
setImgSrc(Element, String)
so that it always returns the correct
url.img
- a non-null img whose src attribute is to be read.@Deprecated public static String getInnerHTML(Element elem)
Element.getInnerHTML()
instead.elem
- the element whose HTML is to be retrieved@Deprecated public static String getInnerHTML(Element elem)
Element.getInnerHTML()
instead.elem
- the element whose HTML is to be retrieved@Deprecated public static String getInnerText(Element elem)
Element.getInnerText()
instead.elem
- the element whose inner text is to be retrieved@Deprecated public static String getInnerText(Element elem)
Element.getInnerText()
instead.elem
- the element whose inner text is to be retrieved@Deprecated public static int getIntAttribute(Element elem, String attr)
Element.getPropertyInt(String)
instead.elem
- the element whose property is to be retrievedattr
- the name of the property to be retrieved@Deprecated public static int getIntAttribute(Element elem, String attr)
Element.getPropertyInt(String)
instead.elem
- the element whose property is to be retrievedattr
- the name of the property to be retrievedpublic static int getIntStyleAttribute(Element elem, String attr)
elem
- the element whose style attribute is to be retrievedattr
- the name of the attribute to be retrievedpublic static Element getNextSibling(Element elem)
elem
- the element whose sibling is to be retrieved@Deprecated public static Element getParent(Element elem)
elem
- the element whose parent is to be retrievedpublic static Element getParent(Element elem)
elem
- the element whose parent is to be retrieved@Deprecated public static String getStyleAttribute(Element elem, String attr)
Element.getStyle()
and
Style#getProperty(String)
instead.elem
- the element whose style attribute is to be retrievedattr
- the name of the style attribute to be retrieved@Deprecated public static String getStyleAttribute(Element elem, String attr)
Element.getStyle()
and
Style#getProperty(String)
instead.elem
- the element whose style attribute is to be retrievedattr
- the name of the style attribute to be retrievedpublic static void insertBefore(Element parent, Element child, Element before)
If the child element is a PotentialElement
, it is first
resolved.
parent
- the parent elementchild
- the child element to add to parent
before
- an existing child element of parent
before which
child
will be insertedPotentialElement.resolve(Element)
@Deprecated public static void insertChild(Element parent, Element child, int index)
If the child element is a PotentialElement
, it is first
resolved.
parent
- the parent elementchild
- the child element to add to parent
index
- the index before which the child will be inserted (any value
greater than the number of existing children will cause the child
to be appended)PotentialElement.resolve(Element)
public static void insertChild(Element parent, Element child, int index)
If the child element is a PotentialElement
, it is first
resolved.
parent
- the parent elementchild
- the child element to add to parent
index
- the index before which the child will be inserted (any value
greater than the number of existing children will cause the child
to be appended)PotentialElement.resolve(Element)
public static void insertListItem(Element selectElem, String item, String value, int index)
<option>
element and inserts it as a child of
the specified <select>
element. If the index is less
than zero, or greater than or equal to the length of the list, then the
option element will be appended to the end of the list.selectElem
- the <select>
elementitem
- the text of the new item; cannot be null
value
- the value
attribute for the new
<option>
; cannot be null
index
- the index at which to insert the child@Deprecated public static boolean isOrHasChild(Element parent, Element child)
Element#isOrHasChild(Element)
instead.parent
- the potential parent elementchild
- the potential child elementtrue
if the relationship holdspublic static void releaseCapture(Element elem)
elem
- the element to release capturesetCapture(Element)
@Deprecated public static void removeChild(Element parent, Element child)
Element#removeChild(Element)
instead.parent
- the parent elementchild
- the child element to be removed@Deprecated public static void removeChild(Element parent, Element child)
Element#removeChild(Element)
instead.parent
- the parent elementchild
- the child element to be removed@Deprecated public static void removeElementAttribute(Element elem, String attr)
Element.removeAttribute(String)
instead.elem
- the element whose attribute is to be removedattr
- the name of the element to remove@Deprecated public static void removeEventPreview(EventPreview preview)
HandlerRegistration
returned from
Event.addNativePreviewHandler(Event.NativePreviewHandler)
preview
- the event preview to be removed from the stack@Deprecated public static void scrollIntoView(Element elem)
Element.scrollIntoView()
instead.This method crawls up the DOM hierarchy, adjusting the scrollLeft and scrollTop properties of each scrollable element to ensure that the specified element is completely in view. It adjusts each scroll position by the minimum amount necessary.
elem
- the element to be made visible@Deprecated public static void setAttribute(Element elem, String attr, String value)
Element.setPropertyString(String, String)
instead.elem
- the element whose property is to be setattr
- the name of the property to be setvalue
- the new property value@Deprecated public static void setBooleanAttribute(Element elem, String attr, boolean value)
Element.setPropertyBoolean(String, boolean)
instead.elem
- the element whose property is to be setattr
- the name of the property to be setvalue
- the property's new boolean valuepublic static void setCapture(Element elem)
releaseCapture(Element)
is
called on it.elem
- the element on which to set mouse/touch/gesture capture@Deprecated public static void setElementAttribute(Element elem, String attr, String value)
Element.setAttribute(String, String)
instead.elem
- element whose attribute is to be setattr
- the name of the attributevalue
- the value to which the attribute should be set@Deprecated public static void setElementProperty(Element elem, String prop, String value)
Element.setPropertyString(String, String)
instead.elem
- the element whose property is to be setprop
- the name of the property to be setvalue
- the new property value@Deprecated public static void setElementProperty(Element elem, String prop, String value)
Element.setPropertyString(String, String)
instead.elem
- the element whose property is to be setprop
- the name of the property to be setvalue
- the new property value@Deprecated public static void setElementPropertyBoolean(Element elem, String prop, boolean value)
Element.setPropertyBoolean(String, boolean)
instead.elem
- the element whose property is to be setprop
- the name of the property to be setvalue
- the new property value as a boolean@Deprecated public static void setElementPropertyInt(Element elem, String prop, int value)
Element.setPropertyInt(String, int)
instead.elem
- the element whose property is to be setprop
- the name of the property to be setvalue
- the new property value as an intpublic static void setEventListener(Element elem, EventListener listener)
EventListener
to receive events for the given element.
Only one such listener may exist for a single element.elem
- the element whose listener is to be setlistener
- the listener to receive events
public static void setImgSrc(Element img, String src)
img
- a non-null img whose src attribute will be set.src
- a non-null url for the img@Deprecated public static void setInnerHTML(Element elem, String html)
Element.setInnerHTML(String)
instead.elem
- the element whose inner HTML is to be sethtml
- the new html@Deprecated public static void setInnerText(Element elem, String text)
Element.setInnerText(String)
instead.elem
- the element whose inner text is to be settext
- the new text@Deprecated public static void setIntAttribute(Element elem, String attr, int value)
Element.setPropertyInt(String, int)
instead.elem
- the element whose property is to be setattr
- the name of the property to be setvalue
- the property's new integer valuepublic static void setIntStyleAttribute(Element elem, String attr, int value)
elem
- the element whose style attribute is to be setattr
- the name of the style attribute to be setvalue
- the style attribute's new integer valuepublic static void setOptionText(Element select, String text, int index)
select
- the select object whose option text is being settext
- the text to setindex
- the index of the option whose text should be set@Deprecated public static void setStyleAttribute(Element elem, String attr, String value)
Element.getStyle()
and
Style#setProperty(String, String)
instead.elem
- the element whose style attribute is to be setattr
- the name of the style attribute to be setvalue
- the style attribute's new value@Deprecated public static void setStyleAttribute(Element elem, String attr, String value)
Element.getStyle()
and
Style#setProperty(String, String)
instead.elem
- the element whose style attribute is to be setattr
- the name of the style attribute to be setvalue
- the style attribute's new valuepublic static void sinkBitlessEvent(Element elem, String eventTypeName)
EventListener
specified on any of the element's parents.elem
- the element whose events are to be retrievedeventTypeName
- name of the event to sink on this elementpublic static void sinkEvents(Element elem, int eventBits)
EventListener
specified on any of the
element's parents.elem
- the element whose events are to be retrievedeventBits
- a bitfield describing the events sunk on this element (its
possible values are described in Event
)@Deprecated public static String toString(Element elem)
Element.getString()
instead.elem
- the element to stringize@Deprecated public static String toString(Element elem)
Element.getString()
instead.elem
- the element to stringize@Deprecated public static int windowGetClientHeight()
Window.getClientHeight()
@Deprecated public static int windowGetClientWidth()
Window.getClientWidth()
public static void dispatchEvent(Event evt, Element elem, EventListener listener)
evt
- the handle to the event being fired.elem
- the handle to the element that received the event.listener
- the listener associated with the element that received the
event.public static boolean dispatchEvent(Event evt, Element elem)
dispatchEvent(Event, Element, EventListener)
but only
dispatches if an event listener is set to element.evt
- the handle to the event being fired.elem
- the handle to the element that received the event.true
if the event was dispatchedpublic static boolean previewEvent(Event evt)
evt
- a handle to the event being previewedfalse
to cancel the eventpublic static Element asOld(Element elem)
Element
to Element
.
For easier upgrades in the future, it's recommended that this function
only be called within a return
statement.
Does not throw a NullPointerException
if elem is null.
Copyright © 2018. All rights reserved.