|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.google.gwt.dom.client.Node
com.google.gwt.dom.client.Element
public class Element
All HTML element interfaces derive from this class.
Field Summary |
---|
Fields inherited from class com.google.gwt.dom.client.Node |
---|
DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
protected |
Element()
|
Method Summary | |
---|---|
static Element |
as(Node node)
Assert that the given Node is of type Node.ELEMENT_NODE and
automatically typecast it. |
int |
getAbsoluteLeft()
Gets an element's absolute left coordinate in the document's coordinate system. |
int |
getAbsoluteTop()
Gets an element's absolute top coordinate in the document's coordinate system. |
java.lang.String |
getAttribute(java.lang.String name)
Retrieves an attribute value by name. |
java.lang.String |
getClassName()
The class attribute of the element. |
java.lang.String |
getDir()
Specifies the base direction of directionally neutral text and the directionality of tables. |
NodeList<Element> |
getElementsByTagName(java.lang.String name)
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a preorder traversal of this Element tree. |
Element |
getFirstChildElement()
The first child of element this element. |
java.lang.String |
getId()
The element's identifier. |
java.lang.String |
getInnerHTML()
All of the markup and content within a given element. |
java.lang.String |
getInnerText()
The text between the start and end tags of the object. |
java.lang.String |
getLang()
Language code defined in RFC 1766. |
Element |
getNextSiblingElement()
The element immediately following this element. |
int |
getOffsetHeight()
The height of an element relative to the layout. |
int |
getOffsetLeft()
The number of pixels that the upper left corner of the current element is offset to the left within the offsetParent node. |
Element |
getOffsetParent()
Returns a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element. |
int |
getOffsetTop()
The number of pixels that the upper top corner of the current element is offset to the top within the offsetParent node. |
int |
getOffsetWidth()
The width of an element relative to the layout. |
Element |
getParentElement()
The parent element of this element. |
boolean |
getPropertyBoolean(java.lang.String name)
Gets a boolean property from this element. |
double |
getPropertyDouble(java.lang.String name)
Gets a double property from this element. |
int |
getPropertyInt(java.lang.String name)
Gets an integer property from this element. |
java.lang.String |
getPropertyString(java.lang.String name)
Gets a property from this element. |
int |
getScrollHeight()
The height of the scroll view of an element. |
int |
getScrollLeft()
The number of pixels that an element's content is scrolled to the left. |
int |
getScrollTop()
The number of pixels that an element's content is scrolled to the top. |
int |
getScrollWidth()
The height of the scroll view of an element. |
java.lang.String |
getString()
Gets a string representation of this element (as outer HTML). |
Style |
getStyle()
Gets this element's Style object. |
java.lang.String |
getTagName()
The name of the element. |
java.lang.String |
getTitle()
The element's advisory title. |
boolean |
isOrHasChild(Element child)
Determine whether an element is equal to, or the child of, this element. |
void |
removeAttribute(java.lang.String name)
Removes an attribute by name. |
void |
scrollIntoView()
Scrolls this element into view. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Adds a new attribute. |
void |
setClassName(java.lang.String className)
The class attribute of the element. |
void |
setDir(java.lang.String dir)
Specifies the base direction of directionally neutral text and the directionality of tables. |
void |
setId(java.lang.String id)
The element's identifier. |
void |
setInnerHTML(java.lang.String html)
All of the markup and content within a given element. |
void |
setInnerText(java.lang.String text)
The text between the start and end tags of the object. |
void |
setLang(java.lang.String lang)
Language code defined in RFC 1766. |
void |
setPropertyBoolean(java.lang.String name,
boolean value)
Sets a boolean property on this element. |
void |
setPropertyDouble(java.lang.String name,
double value)
Sets a double property on this element. |
void |
setPropertyInt(java.lang.String name,
int value)
Sets an integer property on this element. |
void |
setPropertyString(java.lang.String name,
java.lang.String value)
Sets a property on this element. |
void |
setScrollLeft(int scrollLeft)
The number of pixels that an element's content is scrolled to the left. |
void |
setScrollTop(int scrollTop)
The number of pixels that an element's content is scrolled to the top. |
void |
setTitle(java.lang.String title)
The element's advisory title. |
Methods inherited from class com.google.gwt.dom.client.Node |
---|
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, createArray, createFunction, createObject, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Element()
Method Detail |
---|
public static Element as(Node node)
Node
is of type Node.ELEMENT_NODE
and
automatically typecast it.
public final int getAbsoluteLeft()
public final int getAbsoluteTop()
public final java.lang.String getAttribute(java.lang.String name)
name
- The name of the attribute to retrieve
public final java.lang.String getClassName()
public final java.lang.String getDir()
public final NodeList<Element> getElementsByTagName(java.lang.String name)
name
- The name of the tag to match on. The special value "*" matches
all tags
public final Element getFirstChildElement()
public final java.lang.String getId()
public final java.lang.String getInnerHTML()
public final java.lang.String getInnerText()
public final java.lang.String getLang()
public final Element getNextSiblingElement()
public final int getOffsetHeight()
public final int getOffsetLeft()
public final Element getOffsetParent()
public final int getOffsetTop()
public final int getOffsetWidth()
public final Element getParentElement()
public final boolean getPropertyBoolean(java.lang.String name)
name
- the name of the property to be retrieved
public final double getPropertyDouble(java.lang.String name)
name
- the name of the property to be retrieved
public final int getPropertyInt(java.lang.String name)
name
- the name of the property to be retrieved
public final java.lang.String getPropertyString(java.lang.String name)
name
- the name of the property to be retrieved
public final int getScrollHeight()
public final int getScrollLeft()
public final int getScrollTop()
public final int getScrollWidth()
public final java.lang.String getString()
JavaScriptObject.toString()
because it is final in
JavaScriptObject
.
public final Style getStyle()
Style
object.
public final java.lang.String getTagName()
public final java.lang.String getTitle()
public final boolean isOrHasChild(Element child)
child
- the potential child element
true
if the relationship holdspublic final void removeAttribute(java.lang.String name)
public final void scrollIntoView()
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.
public final void setAttribute(java.lang.String name, java.lang.String value)
name
- The name of the attribute to create or altervalue
- Value to set in string formpublic final void setClassName(java.lang.String className)
public final void setDir(java.lang.String dir)
public final void setId(java.lang.String id)
public final void setInnerHTML(java.lang.String html)
public final void setInnerText(java.lang.String text)
public final void setLang(java.lang.String lang)
public final void setPropertyBoolean(java.lang.String name, boolean value)
name
- the name of the property to be setvalue
- the new property valuepublic final void setPropertyDouble(java.lang.String name, double value)
name
- the name of the property to be setvalue
- the new property valuepublic final void setPropertyInt(java.lang.String name, int value)
name
- the name of the property to be setvalue
- the new property valuepublic final void setPropertyString(java.lang.String name, java.lang.String value)
name
- the name of the property to be setvalue
- the new property valuepublic final void setScrollLeft(int scrollLeft)
public final void setScrollTop(int scrollTop)
public final void setTitle(java.lang.String title)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |