Package org.loboevolution.html.node
Interface Element
- All Superinterfaces:
EventTarget,InnerHTML,ModelNode,Node,NonDocumentTypeChildNode,ParentNode
- All Known Subinterfaces:
HTMLAnchorElement,HTMLAppletElement,HTMLAreaElement,HTMLBaseElement,HTMLBaseFontElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement,HTMLCanvasElement,HTMLDataElement,HTMLDataListElement,HTMLDetailsElement,HTMLDialogElement,HTMLDirectoryElement,HTMLDivElement,HTMLDListElement,HTMLElement,HTMLEmbedElement,HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLHeadElement,HTMLHeadingElement,HTMLHRElement,HTMLHtmlElement,HTMLIFrameElement,HTMLImageElement,HTMLInputElement,HTMLLabelElement,HTMLLegendElement,HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMarqueeElement,HTMLMenuElement,HTMLMetaElement,HTMLMeterElement,HTMLModElement,HTMLObjectElement,HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLOutputElement,HTMLParagraphElement,HTMLParamElement,HTMLPictureElement,HTMLPreElement,HTMLProgressElement,HTMLQuoteElement,HTMLScriptElement,HTMLSelectElement,HTMLSlotElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableCaptionElement,HTMLTableCellElement,HTMLTableColElement,HTMLTableDataCellElement,HTMLTableElement,HTMLTableHeaderCellElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement,HTMLTimeElement,HTMLTitleElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement,SMILAnimateColorElement,SMILAnimateElement,SMILAnimateMotionElement,SMILAnimation,SMILElement,SMILLayoutElement,SMILMediaElement,SMILRefElement,SMILRegionElement,SMILRootLayoutElement,SMILSetElement,SMILSwitchElement,SMILTopLayoutElement,SVGAElement,SVGAltGlyphDefElement,SVGAltGlyphElement,SVGAltGlyphItemElement,SVGAnimateElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGAnimationElement,SVGCircleElement,SVGClipPathElement,SVGColorProfileElement,SVGComponentTransferFunctionElement,SVGCursorElement,SVGDefinitionSrcElement,SVGDefsElement,SVGDescElement,SVGElement,SVGEllipseElement,SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement,SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement,SVGFEDistantLightElement,SVGFEFloodElement,SVGFEFuncAElement,SVGFEFuncBElement,SVGFEFuncGElement,SVGFEFuncRElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement,SVGFEMergeNodeElement,SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement,SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGFilterElement,SVGFontElement,SVGFontFaceElement,SVGFontFaceFormatElement,SVGFontFaceNameElement,SVGFontFaceSrcElement,SVGFontFaceUriElement,SVGForeignObjectElement,SVGGElement,SVGGlyphElement,SVGGlyphRefElement,SVGGradientElement,SVGHKernElement,SVGImageElement,SVGLinearGradientElement,SVGLineElement,SVGMarkerElement,SVGMaskElement,SVGMetadataElement,SVGMissingGlyphElement,SVGMPathElement,SVGPathElement,SVGPatternElement,SVGPolygonElement,SVGPolylineElement,SVGRadialGradientElement,SVGRectElement,SVGScriptElement,SVGSetElement,SVGStopElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement,SVGTextContentElement,SVGTextElement,SVGTextPathElement,SVGTextPositioningElement,SVGTitleElement,SVGTRefElement,SVGTSpanElement,SVGUseElement,SVGViewElement,SVGVKernElement
- All Known Implementing Classes:
DTMNodeProxy,ElementImpl,HTMLAnchorElementImpl,HTMLBaseElementImpl,HTMLBasicInputElement,HTMLBodyElementImpl,HTMLBRElementImpl,HTMLButtonElementImpl,HTMLCanvasElementImpl,HTMLCenterElementImpl,HTMLDDElementImpl,HTMLDetailsElementImpl,HTMLDialogElementImpl,HTMLDirectoryElementImpl,HTMLDivElementImpl,HTMLDListElementImpl,HTMLElementImpl,HTMLEmElementImpl,HTMLFieldsetElementImpl,HTMLFigureElementImpl,HTMLFormElementImpl,HTMLGenericMarkupElement,HTMLHeadElementImpl,HTMLHeadingElementImpl,HTMLHRElementImpl,HTMLHtmlElementImpl,HTMLIFrameElementImpl,HTMLImageElementImpl,HTMLInputElementImpl,HTMLLabelElementImpl,HTMLLegendElementImpl,HTMLLIElementImpl,HTMLLinkElementImpl,HTMLMarqueeElementImpl,HTMLMeterElementImpl,HTMLMonospacedElementImpl,HTMLNonStandardElement,HTMLNoScriptElementImpl,HTMLObjectElementImpl,HTMLOListElementImpl,HTMLOptGroupElementImpl,HTMLOptionElementImpl,HTMLPElementImpl,HTMLPreElementImpl,HTMLProcessingInstruction,HTMLProgressElementImpl,HTMLQuoteElementImpl,HTMLScriptElementImpl,HTMLSelectElementImpl,HTMLSmallElementImpl,HTMLSpanElementImpl,HTMLStrikeElementImpl,HTMLStrongElementImpl,HTMLStyleElementImpl,HTMLSuperscriptElementImpl,HTMLTableCaptionElementImpl,HTMLTableCellElementImpl,HTMLTableColElementImpl,HTMLTableColGroupElementImpl,HTMLTableElementImpl,HTMLTableRowElementImpl,HTMLTableSectionElementImpl,HTMLTextAreaElementImpl,HTMLTitleElementImpl,HTMLUListElementImpl,HTMLUnderlineElementImpl,HTMLVideoElementImpl,RSSChanelElementImpl,RSSDescriptionElementImpl,RSSElement,RSSElementImpl,RSSItemElementImpl,RSSTitleElementImpl,SVGAElementImpl,SVGAnimateElementImpl,SVGAnimateTransformElementImpl,SVGAnimationElementImpl,SVGAnimationImpl,SVGCircleElementImpl,SVGClipPathElementImpl,SVGDefsElementImpl,SVGElementImpl,SVGElementWrapper,SVGEllipseElementImpl,SVGFontElementImpl,SVGFontFaceElementImpl,SVGGElementImpl,SVGGradientElementImpl,SVGGraphic,SVGImageElementImpl,SVGLinearGradientElementImpl,SVGLineElementImpl,SVGLocatableImpl,SVGPathElementImpl,SVGPolygonElementImpl,SVGPolylineElementImpl,SVGRadialGradientElementImpl,SVGRectElementImpl,SVGStopElementImpl,SVGStylableImpl,SVGSVGElementImpl,SVGSymbolElementImpl,SVGTextElementImpl,SVGTransformableImpl,SVGUseElementImpl
Element is the most general base class from which all objects in a Document inherit.
It only has methods and properties common to all kinds of elements.
More specific classes inherit from Element.
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Method Summary
Modifier and TypeMethodDescription<E extends Element>
EReturns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.getAttribute(String qualifiedName) Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.String[]Returns the qualified names of all element's attributes.getAttributeNode(String name) getAttributeNode.getAttributeNodeNS(String namespaceURI, String localName) getAttributeNodeNS.getAttributeNS(String namespace, String localName) Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.getBoundingClientRect.Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.Returns the value of element's class content attribute.intgetClientHeight.intgetClientLeft.getClientRects.intgetClientTop.getClientWidth.getElementsByClassName(String classNames) Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames.getElementsByTagName(String qualifiedName) getElementsByTagName.getElementsByTagNameNS(String namespaceURI, String localName) getElementsByTagNameNS.getId()Returns the value of element's id content attribute.getInnerHTML.getInnerText.Returns the local name.Returns the namespace.getOuterHTML.Returns the namespace prefix.getSchemaTypeInfo.doublegetScrollHeight.doublegetScrollLeft.doublegetScrollTop.doublegetScrollWidth.getSlot()Returns the value of element's slot content attribute.Returns the HTML-uppercased qualified name.booleanhasAttribute(String qualifiedName) Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.booleanhasAttributeNS(String namespace, String localName) Returns true if element has an attribute whose namespace is namespace and local name is localName.booleanhasPointerCapture(int pointerId) hasPointerCapture.insertAdjacentElement(String where, Node insertedElement) insertAdjacentElement.voidinsertAdjacentHTML(String position, String text) insertAdjacentHTML.booleanReturns true if matching selectors against element's root yields element, and false otherwise.voidreleasePointerCapture(int pointerId) releasePointerCapture.voidremoveAttribute(String qualifiedName) Removes element's first attribute whose qualified name is qualifiedName.removeAttributeNode(Attr attr) removeAttributeNode.voidremoveAttributeNS(String namespace, String localName) Removes element's attribute whose namespace is namespace and local name is localName.voidrequestPointerLock.voidscroll(int x, int y) scroll.voidscrollBy(int x, int y) scrollBy.voidscrollIntoView.voidscrollIntoView(boolean arg) scrollIntoView.voidscrollTo(int x, int y) scrollTo.voidsetAttribute(String qualifiedName, String value) Sets the value of element's first attribute whose qualified name is qualifiedName to value.setAttributeNode(Attr attr) setAttributeNode.setAttributeNodeNS(Attr attr) setAttributeNodeNS.voidsetAttributeNS(String namespace, String qualifiedName, String value) Sets the value of element's attribute whose namespace is namespace and local name is localName to value.voidsetClassName(String className) setClassName.voidsetId.voidsetIdAttribute(String name, boolean isId) setIdAttribute.voidsetIdAttributeNode(Attr idAttr, boolean isId) setIdAttributeNode.voidsetIdAttributeNS(String namespaceURI, String localName, boolean isId) setIdAttributeNode.voidsetOuterHTML(String outerHTML) setOuterHTML.voidsetPointerCapture(int pointerId) setPointerCapture.voidsetScrollLeft(double scrollLeft) setScrollLeft.voidsetScrollTop(double scrollTop) setScrollTop.voidsetSlot.booleantoggleAttribute(String qualifiedName) toggleAttribute.booleantoggleAttribute(String qualifiedName, boolean force) If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present.Methods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListenerMethods inherited from interface org.loboevolution.html.node.InnerHTML
setInnerHTMLMethods inherited from interface org.loboevolution.html.node.ModelNode
getDocumentItem, getFullURL, getParentModelNode, getRenderState, isEqualOrDescendentOf, setDocumentItem, warnMethods inherited from interface org.loboevolution.html.node.Node
appendChild, appendChildrenToCollectionImpl, cloneNode, cloneNode, compareDocumentPosition, contains, extractDescendentsArrayImpl, findUINode, forgetRenderState, getAttributes, getBaseURI, getChildNodes, getDocumentNode, getFeature, getFirstChild, getLastChild, getNextSibling, getNextTo, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getPreviousTo, getRootNode, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setOwnerDocument, setParentImpl, setPrefix, setTextContent, setUserData, visitMethods inherited from interface org.loboevolution.html.node.NonDocumentTypeChildNode
getNextElementSibling, getPreviousElementSiblingMethods inherited from interface org.loboevolution.html.node.ParentNode
getChildElementCount, getChildren, getFirstElementChild, getLastElementChild, querySelector, querySelectorAll
-
Method Details
-
getClassList
DOMTokenList getClassList()Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.- Returns:
- a
DOMTokenListobject.
-
getClassName
String getClassName()Returns the value of element's class content attribute. Can be set to change it.- Returns:
- a
Stringobject.
-
setClassName
setClassName.
- Parameters:
className- aStringobject.
-
getClientHeight
int getClientHeight()getClientHeight.
- Returns:
- a
Integerobject.
-
getClientLeft
int getClientLeft()getClientLeft.
- Returns:
- a
Integerobject.
-
getClientTop
int getClientTop()getClientTop.
- Returns:
- a
Integerobject.
-
getClientWidth
Integer getClientWidth()getClientWidth.
- Returns:
- a
Integerobject.
-
getId
String getId()Returns the value of element's id content attribute. Can be set to change it.- Returns:
- a
Stringobject.
-
setId
setId.
- Parameters:
id- aStringobject.
-
getLocalName
String getLocalName()Returns the local name.- Specified by:
getLocalNamein interfaceNode- Returns:
- a
Stringobject.
-
getNamespaceURI
String getNamespaceURI()Returns the namespace.- Specified by:
getNamespaceURIin interfaceNode- Returns:
- a
Stringobject.
-
getOuterHTML
String getOuterHTML()getOuterHTML.
- Returns:
- a
Stringobject.
-
getInnerHTML
String getInnerHTML()getInnerHTML.
- Specified by:
getInnerHTMLin interfaceInnerHTML- Returns:
- a
Stringobject.
-
getInnerText
String getInnerText()getInnerText.
- Returns:
- a
Stringobject.
-
getBoundingClientRect
DOMRect getBoundingClientRect()getBoundingClientRect.
- Returns:
- a
DOMRectobject.
-
getClientRects
DOMRectList getClientRects()getClientRects.
- Returns:
- a
DOMRectListobject.
-
getSchemaTypeInfo
TypeInfo getSchemaTypeInfo()getSchemaTypeInfo.
- Returns:
- a
TypeInfoobject.
-
setOuterHTML
setOuterHTML.
- Parameters:
outerHTML- aStringobject.
-
getPrefix
String getPrefix()Returns the namespace prefix. -
getScrollHeight
double getScrollHeight()getScrollHeight.
- Returns:
- a double.
-
getScrollLeft
double getScrollLeft()getScrollLeft.
- Returns:
- a double.
-
setScrollLeft
void setScrollLeft(double scrollLeft) setScrollLeft.
- Parameters:
scrollLeft- aIntegerobject.
-
getScrollTop
double getScrollTop()getScrollTop.
- Returns:
- a double.
-
setScrollTop
void setScrollTop(double scrollTop) setScrollTop.
- Parameters:
scrollTop- aIntegerobject.
-
getScrollWidth
double getScrollWidth()getScrollWidth.
- Returns:
- a double.
-
getSlot
String getSlot()Returns the value of element's slot content attribute. Can be set to change it.- Returns:
- a
Stringobject.
-
setSlot
setSlot.
- Parameters:
slot- aStringobject.
-
getTagName
String getTagName()Returns the HTML-uppercased qualified name.- Returns:
- a
Stringobject.
-
closest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.- Type Parameters:
E- a E object.- Parameters:
selector- aStringobject.- Returns:
- a E object.
-
getAttribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -
getAttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -
getAttributeNames
String[] getAttributeNames()Returns the qualified names of all element's attributes. Can contain duplicates.- Returns:
- an array of
Stringobjects.
-
getAttributeNode
getAttributeNode.
-
getAttributeNodeNS
getAttributeNodeNS.
-
getElementsByClassName
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.- Parameters:
classNames- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
getElementsByTagName
getElementsByTagName.
- Parameters:
qualifiedName- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
getElementsByTagNameNS
getElementsByTagNameNS.
- Parameters:
namespaceURI- aStringobject.localName- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
hasAttribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.- Parameters:
qualifiedName- aStringobject.- Returns:
- a boolean.
-
hasAttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName. -
hasPointerCapture
boolean hasPointerCapture(int pointerId) hasPointerCapture.
- Parameters:
pointerId- aIntegerobject.- Returns:
- a boolean.
-
matches
Returns true if matching selectors against element's root yields element, and false otherwise.- Parameters:
selectors- aStringobject.- Returns:
- a boolean.
-
releasePointerCapture
void releasePointerCapture(int pointerId) releasePointerCapture.
- Parameters:
pointerId- aIntegerobject.
-
removeAttribute
Removes element's first attribute whose qualified name is qualifiedName.- Parameters:
qualifiedName- aStringobject.
-
removeAttributeNS
Removes element's attribute whose namespace is namespace and local name is localName. -
removeAttributeNode
removeAttributeNode.
-
requestPointerLock
void requestPointerLock()requestPointerLock.
-
scroll
void scroll(int x, int y) scroll.
- Parameters:
x- a double.y- a double.
-
scrollBy
void scrollBy(int x, int y) scrollBy.
- Parameters:
x- a double.y- a double.
-
scrollIntoView
void scrollIntoView(boolean arg) scrollIntoView.
- Parameters:
arg- a boolean.
-
scrollIntoView
void scrollIntoView()scrollIntoView.
-
scrollTo
void scrollTo(int x, int y) scrollTo.
- Parameters:
x- a double.y- a double.
-
setAttribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value. -
setAttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -
setAttributeNode
setAttributeNode.
-
setAttributeNodeNS
setAttributeNodeNS.
-
setIdAttribute
setIdAttribute.
- Parameters:
name- aStringobject.isId- a boolean.
-
setIdAttributeNode
setIdAttributeNode.
- Parameters:
idAttr- aAttrobject.isId- a boolean.
-
setIdAttributeNS
setIdAttributeNode.
-
setPointerCapture
void setPointerCapture(int pointerId) setPointerCapture.
- Parameters:
pointerId- aIntegerobject.
-
toggleAttribute
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.Returns true if qualifiedName is now present, and false otherwise.
- Parameters:
qualifiedName- aStringobject.force- a boolean.- Returns:
- a boolean.
-
toggleAttribute
toggleAttribute.
- Parameters:
qualifiedName- aStringobject.- Returns:
- a boolean.
-
insertAdjacentElement
insertAdjacentElement.
-
insertAdjacentHTML
insertAdjacentHTML.
-