Package org.pepstock.charba.client.dom
Class BaseElement
- java.lang.Object
-
- org.pepstock.charba.client.dom.BaseEventTarget
-
- org.pepstock.charba.client.dom.BaseNode
-
- org.pepstock.charba.client.dom.BaseElement
-
- Direct Known Subclasses:
BaseHtmlElement
@JsType(isNative=true, name="Element", namespace="<global>") public abstract class BaseElement extends BaseNodeBase class from which all element objects (objects that represent elements) in a document inherit.
It only has methods and properties common to all kinds of elements.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.dom.BaseEventTarget
BaseEventTarget.EventListenerCallback
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedNodeMap<BaseAttribute>getAttributes()Returns a collection of all attribute nodes registered to the specified node.intgetChildElementCount()Returns the number of children of this element which are elements.intgetClientHeight()Returns a number representing the inner height of the element.intgetClientLeft()Returns a number representing the width of the left border of the element.intgetClientTop()Returns a number representing the width of the top border of the element.intgetClientWidth()Returns a number representing the inner width of the element.NodeList<BaseElement>getElementsByTagName(String tagname)Returns a list containing all descendant elements, of a particular tag name, from the current element.BaseElementgetFirstElementChild()Returns the first node which is both a child of this element and is also an element, ornullif there is none.StringgetId()Returns the unique id of the element.StringgetInnerHTML()Returns the markup of the element's content.BaseElementgetLastElementChild()Returns the last node which is both a child of this element and is an element, ornullif there is none.BaseElementgetNextElementSibling()Returns the element immediately following the given one in the tree, ornullif there's no sibling node.StringgetOuterHTML()Returns the serialized HTML fragment describing the element including its descendants.BaseElementgetPreviousElementSibling()Returns the element immediately preceding the given one in the tree, ornullif there is no sibling element.intgetScrollHeight()Returns a number representing the scroll view height of an element.doublegetScrollLeft()Returns a number representing the left scroll offset of the element.doublegetScrollTop()Returns a number representing number of pixels the top of the document is scrolled vertically.intgetScrollWidth()Returns a number representing the scroll view width of the element.StringgetTagName()Returns the name of the tag for the given element.booleanhasAttributes()Returns a boolean indicating whether the current element has any attributes or not.voidremove()Removes the element from the children list of its parent.voidsetId(String id)Sets the unique id of the element.voidsetInnerHTML(String innerHTML)Sets the markup of the element's content..-
Methods inherited from class org.pepstock.charba.client.dom.BaseNode
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getTextContent, hasChildNodes, insertBefore, removeAllChildren, removeChild, setNodeValue, setTextContent
-
Methods inherited from class org.pepstock.charba.client.dom.BaseEventTarget
addEventListener, removeEventListener
-
-
-
-
Method Detail
-
getChildElementCount
@JsProperty public final int getChildElementCount()
Returns the number of children of this element which are elements.- Returns:
- the number of children of this element which are elements
-
getClientHeight
@JsProperty public final int getClientHeight()
Returns a number representing the inner height of the element.- Returns:
- a number representing the inner height of the element
-
getClientLeft
@JsProperty public final int getClientLeft()
Returns a number representing the width of the left border of the element.- Returns:
- a number representing the width of the left border of the element
-
getClientTop
@JsProperty public final int getClientTop()
Returns a number representing the width of the top border of the element.- Returns:
- a number representing the width of the top border of the element
-
getClientWidth
@JsProperty public final int getClientWidth()
Returns a number representing the inner width of the element.- Returns:
- a number representing the inner width of the element
-
getFirstElementChild
@JsProperty public final BaseElement getFirstElementChild()
Returns the first node which is both a child of this element and is also an element, ornullif there is none.- Returns:
- the first node which is both a child of this element and is also an element, or
nullif there is none
-
getId
@JsProperty public final String getId()
Returns the unique id of the element.- Returns:
- the unique id of the element
-
setId
@JsProperty public final void setId(String id)
Sets the unique id of the element.- Parameters:
id- the unique id of the element
-
getInnerHTML
@JsProperty public final String getInnerHTML()
Returns the markup of the element's content.- Returns:
- the markup of the element's content
-
setInnerHTML
@JsProperty public final void setInnerHTML(String innerHTML)
Sets the markup of the element's content..- Parameters:
innerHTML- the markup of the element's content
-
getOuterHTML
@JsProperty public final String getOuterHTML()
Returns the serialized HTML fragment describing the element including its descendants.- Returns:
- the serialized HTML fragment describing the element including its descendants
-
getLastElementChild
@JsProperty public final BaseElement getLastElementChild()
Returns the last node which is both a child of this element and is an element, ornullif there is none.- Returns:
- the last node which is both a child of this element and is an element, or
nullif there is none
-
getNextElementSibling
@JsProperty public final BaseElement getNextElementSibling()
Returns the element immediately following the given one in the tree, ornullif there's no sibling node.- Returns:
- the element immediately following the given one in the tree, or
nullif there's no sibling node
-
getPreviousElementSibling
@JsProperty public final BaseElement getPreviousElementSibling()
Returns the element immediately preceding the given one in the tree, ornullif there is no sibling element.- Returns:
- the element immediately preceding the given one in the tree, or
nullif there is no sibling element
-
getScrollHeight
@JsProperty public final int getScrollHeight()
Returns a number representing the scroll view height of an element.- Returns:
- a number representing the scroll view height of an element
-
getScrollLeft
@JsProperty public final double getScrollLeft()
Returns a number representing the left scroll offset of the element.- Returns:
- a number representing the left scroll offset of the element
-
getScrollTop
@JsProperty public final double getScrollTop()
Returns a number representing number of pixels the top of the document is scrolled vertically.- Returns:
- a number representing number of pixels the top of the document is scrolled vertically
-
getScrollWidth
@JsProperty public final int getScrollWidth()
Returns a number representing the scroll view width of the element.- Returns:
- a number representing the scroll view width of the element
-
getTagName
@JsProperty public final String getTagName()
Returns the name of the tag for the given element.- Returns:
- the name of the tag for the given element
-
getAttributes
@JsProperty public NamedNodeMap<BaseAttribute> getAttributes()
Returns a collection of all attribute nodes registered to the specified node.- Returns:
- a collection of all attribute nodes registered to the specified node
-
getElementsByTagName
@JsMethod public final NodeList<BaseElement> getElementsByTagName(String tagname)
Returns a list containing all descendant elements, of a particular tag name, from the current element.- Parameters:
tagname- the qualified name to look for. The special string "*" represents all elements.- Returns:
- a list containing all descendant elements
-
remove
@JsMethod public final void remove()
Removes the element from the children list of its parent.
-
hasAttributes
@JsMethod public final boolean hasAttributes()
Returns a boolean indicating whether the current element has any attributes or not.- Returns:
truewhether the current element has any attributes
-
-