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 IsJSType
Represents 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 protected
BaseHtmlElement()
To avoid any instantiation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blur()
Removes keyboard focus from the current element.void
focus()
Sets focus on the specified element, if it can be focused.double
getAbsoluteLeft()
Returns an element's absolute left coordinate in the document's coordinate system.double
getAbsoluteTop()
Returns an element's absolute top coordinate in the document's coordinate system.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.int
getOffsetHeight()
Returns a number containing the height of an element, relative to the layout.int
getOffsetLeft()
Returns a number, the distance from this element's left border to its offsetParent's left border.BaseElement
getOffsetParent()
Returns a element that is the element from which all offset calculations are currently computed.int
getOffsetTop()
Returns a number, the distance from this element's top border to its offsetParent's top border.int
getOffsetWidth()
Returns a number containing the width of an element, relative to the layout.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
.BaseElement
getScrollingElement()
Returns the scrolling element of the document, if there is, or the document element.BaseStyleProperties
getStyle()
Returns an object representing the declarations of an element's style attributes.int
getTabIndex()
Returns a number representing the position of the element in the tabbing order.void
removeFromParent()
Removes this node from its parent node if it is attached to one.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.void
setTabIndex(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, getBoundingClientRect, getChildElementCount, getClientHeight, getClientLeft, getClientTop, getClientWidth, getElementsByTagName, getFirstElementChild, getId, getInnerHTML, getLastElementChild, getNextElementSibling, getOuterHTML, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTagName, hasAttributes, hasPointerCapture, releasePointerCapture, remove, setId, setInnerHTML, setPointerCapture
-
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, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, 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
-
focus
@JsMethod public final void focus()
Sets focus on the specified element, if it can be focused. The focused element is the element that will receive keyboard and similar events by default.
-
blur
@JsMethod public final void blur()
Removes keyboard focus from the current element.
-
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
-
-