Package org.pepstock.charba.client.dom
Class BaseHtmlElement
- java.lang.Object
-
- org.pepstock.charba.client.dom.BaseEventTarget
-
- org.pepstock.charba.client.dom.BaseNode
-
- org.pepstock.charba.client.dom.BaseElement
-
- org.pepstock.charba.client.dom.BaseHtmlElement
-
- All Implemented Interfaces:
IsJSType
- Direct Known Subclasses:
Body,Canvas,Context2dItem,Div,Head,Heading,Img,LineBreak,Meta,Script,Span,Style,Table,TableCell,TableRow
@JsType(isNative=true, name="HTMLElement", namespace="<global>") public class BaseHtmlElement extends BaseElement implements IsJSTypeRepresents any HTML element.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.dom.BaseEventTarget
BaseEventTarget.EventListenerCallback
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseHtmlElement()To avoid any instantiation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetAbsoluteLeft()Returns an element's absolute left coordinate in the document's coordinate system.doublegetAbsoluteTop()Returns an element's absolute top coordinate in the document's coordinate system.StringgetInnerText()Returns the "rendered" text content of a node and its descendants.
As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.intgetOffsetHeight()Returns a number containing the height of an element, relative to the layout.intgetOffsetLeft()Returns a number, the distance from this element's left border to its offsetParent's left border.BaseElementgetOffsetParent()Returns a element that is the element from which all offset calculations are currently computed.intgetOffsetTop()Returns a number, the distance from this element's top border to its offsetParent's top border.intgetOffsetWidth()Returns a number containing the width of an element, relative to the layout.BaseHtmlElementgetParentHtmlElement()Returns an HTML element that is the parent of this element.
If the element has no parent, or if that parent is not an element, returnsnull.BaseElementgetScrollingElement()Returns the scrolling element of the document, if there is, or the document element.BaseStylePropertiesgetStyle()Returns an object representing the declarations of an element's style attributes.intgetTabIndex()Returns a number representing the position of the element in the tabbing order.voidremoveFromParent()Removes this node from its parent node if it is attached to one.voidsetInnerText(String innerText)Sets the "rendered" text content of a node and its descendants.
As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.voidsetTabIndex(int tabIndex)Sets a number representing the position of the element in the tabbing order.-
Methods inherited from class org.pepstock.charba.client.dom.BaseElement
getAttributes, getChildElementCount, getClientHeight, getClientLeft, getClientTop, getClientWidth, getElementsByTagName, getFirstElementChild, getId, getInnerHTML, getLastElementChild, getNextElementSibling, getOuterHTML, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTagName, hasAttributes, remove, setId, setInnerHTML
-
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
-
getInnerText
@JsProperty public final String getInnerText()
Returns the "rendered" text content of a node and its descendants.
As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.- Returns:
- the "rendered" text content of a node and its descendants
-
setInnerText
@JsProperty public final void setInnerText(String innerText)
Sets the "rendered" text content of a node and its descendants.
As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.- Parameters:
innerText- the "rendered" text content of a node and its descendants
-
getOffsetHeight
@JsProperty public final int getOffsetHeight()
Returns a number containing the height of an element, relative to the layout.- Returns:
- a number containing the height of an element, relative to the layout
-
getOffsetLeft
@JsProperty public final int getOffsetLeft()
Returns a number, the distance from this element's left border to its offsetParent's left border.- Returns:
- a number, the distance from this element's left border to its offsetParent's left border
-
getOffsetParent
@JsProperty public final BaseElement getOffsetParent()
Returns a element that is the element from which all offset calculations are currently computed.- Returns:
- a element that is the element from which all offset calculations are currently computed
-
getOffsetTop
@JsProperty public final int getOffsetTop()
Returns a number, the distance from this element's top border to its offsetParent's top border.- Returns:
- a number, the distance from this element's top border to its offsetParent's top border
-
getOffsetWidth
@JsProperty public final int getOffsetWidth()
Returns a number containing the width of an element, relative to the layout.- Returns:
- a number containing the width of an element, relative to the layout
-
getStyle
@JsProperty public final BaseStyleProperties getStyle()
Returns an object representing the declarations of an element's style attributes.- Returns:
- an object representing the declarations of an element's style attributes
-
getTabIndex
@JsProperty public final int getTabIndex()
Returns a number representing the position of the element in the tabbing order.- Returns:
- a number representing the position of the element in the tabbing order
-
setTabIndex
@JsProperty public final void setTabIndex(int tabIndex)
Sets a number representing the position of the element in the tabbing order.- Parameters:
tabIndex- a number representing the position of the element in the tabbing order
-
getParentHtmlElement
@JsOverlay public final BaseHtmlElement getParentHtmlElement()
Returns an HTML element that is the parent of this element.
If the element has no parent, or if that parent is not an element, returnsnull.- Returns:
- an element that is the parent of this node
-
removeFromParent
@JsOverlay public final void removeFromParent()
Removes this node from its parent node if it is attached to one.
-
getAbsoluteTop
@JsOverlay public final double getAbsoluteTop()
Returns an element's absolute top coordinate in the document's coordinate system.- Returns:
- an element's absolute top coordinate in the document's coordinate system
-
getAbsoluteLeft
@JsOverlay public final double getAbsoluteLeft()
Returns an element's absolute left coordinate in the document's coordinate system.- Returns:
- an element's absolute left coordinate in the document's coordinate system
-
getScrollingElement
@JsOverlay public final BaseElement getScrollingElement()
Returns the scrolling element of the document, if there is, or the document element.- Returns:
- the scrolling element of the document, if there is, or the document element
-
-