org.lobobrowser.html.domimpl

Class HTMLElementImpl

Implemented Interfaces:
Element, CSS2PropertiesContext, Element, HTMLElement, Node, ModelNode, ScriptableDelegate
Known Direct Subclasses:
HTMLAbstractUIElement, HTMLBaseElementImpl, HTMLBRElementImpl, HTMLFrameElementImpl, HTMLFrameSetElementImpl, HTMLHtmlElementImpl, HTMLNonStandardElement, HTMLOptionElementImpl, HTMLScriptElementImpl, HTMLStyleElementImpl, HTMLTableRowElementImpl, HTMLTitleElementImpl

public class HTMLElementImpl
extends ElementImpl
implements HTMLElement, CSS2PropertiesContext

Field Summary

Fields inherited from class org.lobobrowser.html.domimpl.ElementImpl

attributes

Fields inherited from class org.lobobrowser.html.domimpl.NodeImpl

document, logger, nodeList, notificationsSuspended, parentNode, treeLock, uiNode

Constructor Summary

HTMLElementImpl(String name)
HTMLElementImpl(String name, boolean noStyleSheet)

Method Summary

protected AbstractCSS2Properties
addStyleSheetDeclarations(AbstractCSS2Properties style, Set pseudoNames)
Adds style sheet declarations applicable to this element.
protected void
appendOuterHTMLImpl(StringBuffer buffer)
protected void
assignAttributeField(String normalName, String value)
protected RenderState
createRenderState(RenderState prevRenderState)
protected Collection
findStyleDeclarations(String elementName, String id, String className, Set pseudoNames)
protected void
forgetLocalStyle()
protected void
forgetStyle(boolean deep)
HTMLElementImpl
getAncestor(String elementTL)
protected Object
getAncestorForJavaClass(Class javaClass)
HTMLElementImpl
getAncestorWithClass(String elementTL, String classTL)
Get an ancestor that matches the element tag name given and the style class given.
HTMLElementImpl
getAncestorWithId(String elementTL, String idTL)
boolean
getAttributeAsBoolean(String name)
protected int
getAttributeAsInt(String name, int defaultValue)
String
getCharset()
String
getClassName()
The class attribute of the element.
AbstractCSS2Properties
getComputedStyle(String pseudoElement)
protected InputSource
getCssInputSourceForDecl(String text)
AbstractCSS2Properties
getCurrentStyle()
Gets the style object associated with the element.
String
getDocumentBaseURI()
protected FormInput[]
getFormInputs()
Gets form input due to the current element.
int
getOffsetHeight()
int
getOffsetLeft()
int
getOffsetTop()
int
getOffsetWidth()
String
getOuterHTML()
AbstractCSS2Properties
getParentStyle()
Set
getPseudoNames()
Gets the pseudo-element lowercase names currently applicable to this element.
AbstractCSS2Properties
getStyle()
Gets the local style object associated with the element.
void
informInvalid()
void
informInvalidAttibute(String normalName)
void
informLayoutInvalid()
void
setCharset(String charset)
void
setClassName(String className)
The class attribute of the element.
void
setCurrentStyle(Object value)
void
setInnerHTML(String newHtml)
void
setMouseOver(boolean mouseOver)
void
setStyle(Object value)
String
toString()
void
warn(String message)
void
warn(String message, Throwable err)

Methods inherited from class org.lobobrowser.html.domimpl.ElementImpl

appendInnerTextImpl, assignAttributeField, createSimilarNode, equalAttributes, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributes, getDir, getElementsByTagName, getElementsByTagNameNS, getId, getInnerText, getLang, getLocalName, getNodeName, getNodeType, getNodeValue, getRawInnerText, getSchemaTypeInfo, getTagName, getTitle, hasAttribute, hasAttributeNS, hasAttributes, isTagName, normalizeAttributeName, removeAttribute, removeAttributeNS, removeAttributeNode, setAttribute, setAttributeImpl, setAttributeNS, setAttributeNode, setAttributeNodeNS, setDir, setId, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setInnerText, setLang, setNodeValue, setTitle, toString

Methods inherited from class org.lobobrowser.html.domimpl.NodeImpl

appendChild, appendInnerHTMLImpl, cloneNode, compareDocumentPosition, createRenderState, createSimilarNode, equalAttributes, findUINode, forgetRenderState, getAlignmentX, getAlignmentY, getAttributes, getBaseURI, getChildNodes, getChildren, getChildrenArray, getDescendents, getDocumentItem, getDocumentURL, getFeature, getFirstChild, getFullURL, getHtmlRendererContext, getInnerHTML, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeList, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousSibling, getRenderState, getTextContent, getUINode, getUserAgentContext, getUserData, hasAttributes, hasChildNodes, informExternalScriptLoading, informInvalid, informLayoutInvalid, informLookInvalid, informNodeLoaded, informPositionInvalid, informSizeInvalid, informStructureInvalid, insertAfter, insertAt, insertBefore, isDefaultNamespace, isEqualNode, isEqualOrDescendentOf, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAllChildren, removeAllChildrenImpl, removeChild, removeChildAt, removeChildren, removeChildrenImpl, replaceAdjacentTextNodes, replaceAdjacentTextNodes, replaceChild, setDocumentItem, setNodeValue, setPrefix, setTextContent, setUINode, setUserData, toString, warn, warn

Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate

getScriptable, setScriptable

Constructor Details

HTMLElementImpl

public HTMLElementImpl(String name)

HTMLElementImpl

public HTMLElementImpl(String name,
                       boolean noStyleSheet)

Method Details

addStyleSheetDeclarations

protected final AbstractCSS2Properties addStyleSheetDeclarations(AbstractCSS2Properties style,
                                                                 Set pseudoNames)
Adds style sheet declarations applicable to this element. A properties object is created if necessary when the one passed is null.
Parameters:
style -

appendOuterHTMLImpl

protected void appendOuterHTMLImpl(StringBuffer buffer)

assignAttributeField

protected void assignAttributeField(String normalName,
                                    String value)
Overrides:
assignAttributeField in interface ElementImpl

createRenderState

protected RenderState createRenderState(RenderState prevRenderState)
Overrides:
createRenderState in interface NodeImpl

findStyleDeclarations

protected final Collection findStyleDeclarations(String elementName,
                                                 String id,
                                                 String className,
                                                 Set pseudoNames)

forgetLocalStyle

protected final void forgetLocalStyle()

forgetStyle

protected final void forgetStyle(boolean deep)

getAncestor

public HTMLElementImpl getAncestor(String elementTL)

getAncestorForJavaClass

protected Object getAncestorForJavaClass(Class javaClass)

getAncestorWithClass

public HTMLElementImpl getAncestorWithClass(String elementTL,
                                            String classTL)
Get an ancestor that matches the element tag name given and the style class given.
Parameters:
elementTL - An tag name in lowercase or an asterisk (*).
classTL - A class name in lowercase.

getAncestorWithId

public HTMLElementImpl getAncestorWithId(String elementTL,
                                         String idTL)

getAttributeAsBoolean

public boolean getAttributeAsBoolean(String name)

getAttributeAsInt

protected int getAttributeAsInt(String name,
                                int defaultValue)

getCharset

public String getCharset()

getClassName

public String getClassName()
The class attribute of the element. This attribute has been renamed due to conflicts with the "class" keyword exposed by many languages. See the class attribute definition in HTML 4.01.
Specified by:
getClassName in interface HTMLElement

getComputedStyle

public AbstractCSS2Properties getComputedStyle(String pseudoElement)

getCssInputSourceForDecl

protected final InputSource getCssInputSourceForDecl(String text)

getCurrentStyle

public AbstractCSS2Properties getCurrentStyle()
Gets the style object associated with the element. It may return null only if the type of element does not handle stylesheets.

getDocumentBaseURI

public String getDocumentBaseURI()
Specified by:
getDocumentBaseURI in interface CSS2PropertiesContext

getFormInputs

protected FormInput[] getFormInputs()
Gets form input due to the current element. It should return null except when the element is a form input element.

getOffsetHeight

public int getOffsetHeight()

getOffsetLeft

public int getOffsetLeft()

getOffsetTop

public int getOffsetTop()

getOffsetWidth

public int getOffsetWidth()

getOuterHTML

public String getOuterHTML()

getParentStyle

public AbstractCSS2Properties getParentStyle()
Specified by:
getParentStyle in interface CSS2PropertiesContext

getPseudoNames

public Set getPseudoNames()
Gets the pseudo-element lowercase names currently applicable to this element. Method must return null if there are no such pseudo-elements.

getStyle

public AbstractCSS2Properties getStyle()
Gets the local style object associated with the element. The properties object returned only includes properties from the local style attribute. It may return null only if the type of element does not handle stylesheets.

informInvalid

public void informInvalid()
Specified by:
informInvalid in interface CSS2PropertiesContext
Overrides:
informInvalid in interface NodeImpl

informInvalidAttibute

public void informInvalidAttibute(String normalName)

informLayoutInvalid

public void informLayoutInvalid()
Specified by:
informLayoutInvalid in interface CSS2PropertiesContext
Overrides:
informLayoutInvalid in interface NodeImpl

setCharset

public void setCharset(String charset)

setClassName

public void setClassName(String className)
The class attribute of the element. This attribute has been renamed due to conflicts with the "class" keyword exposed by many languages. See the class attribute definition in HTML 4.01.
Specified by:
setClassName in interface HTMLElement

setCurrentStyle

public void setCurrentStyle(Object value)

setInnerHTML

public void setInnerHTML(String newHtml)

setMouseOver

public void setMouseOver(boolean mouseOver)

setStyle

public void setStyle(Object value)

toString

public String toString()
Overrides:
toString in interface ElementImpl

warn

public void warn(String message)
Overrides:
warn in interface NodeImpl

warn

public void warn(String message,
                 Throwable err)
Specified by:
warn in interface ModelNode
Overrides:
warn in interface NodeImpl