org.lobobrowser.html.domimpl
Class HTMLElementImpl

java.lang.Object
  extended by org.lobobrowser.js.AbstractScriptableDelegate
      extended by org.lobobrowser.html.domimpl.NodeImpl
          extended by org.lobobrowser.html.domimpl.ElementImpl
              extended by org.lobobrowser.html.domimpl.HTMLElementImpl
All Implemented Interfaces:
ModelNode, org.lobobrowser.html.style.CSS2PropertiesContext, org.lobobrowser.js.ScriptableDelegate, org.w3c.dom.Element, org.w3c.dom.html2.HTMLElement, org.w3c.dom.Node
Direct Known Subclasses:
HTMLAbstractUIElement, HTMLBaseElementImpl, HTMLBRElementImpl, HTMLFrameElementImpl, HTMLFrameSetElementImpl, HTMLHtmlElementImpl, HTMLNonStandardElement, HTMLOptionElementImpl, HTMLScriptElementImpl, HTMLStyleElementImpl, HTMLTableRowElementImpl, HTMLTitleElementImpl

public class HTMLElementImpl
extends ElementImpl
implements org.w3c.dom.html2.HTMLElement, org.lobobrowser.html.style.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
 
Fields inherited from interface org.w3c.dom.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, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
HTMLElementImpl(java.lang.String name)
           
HTMLElementImpl(java.lang.String name, boolean noStyleSheet)
           
 
Method Summary
protected  org.lobobrowser.html.style.AbstractCSS2Properties addStyleSheetDeclarations(org.lobobrowser.html.style.AbstractCSS2Properties style, java.util.Set pseudoNames)
          Adds style sheet declarations applicable to this element.
protected  void appendOuterHTMLImpl(java.lang.StringBuffer buffer)
           
protected  void assignAttributeField(java.lang.String normalName, java.lang.String value)
           
protected  org.lobobrowser.html.style.AbstractCSS2Properties createDefaultStyleSheet()
           
protected  org.lobobrowser.html.style.RenderState createRenderState(org.lobobrowser.html.style.RenderState prevRenderState)
           
protected  java.util.Collection findStyleDeclarations(java.lang.String elementName, java.lang.String id, java.lang.String className, java.util.Set pseudoNames)
           
protected  void forgetLocalStyle()
           
protected  void forgetStyle(boolean deep)
           
 HTMLElementImpl getAncestor(java.lang.String elementTL)
           
protected  java.lang.Object getAncestorForJavaClass(java.lang.Class javaClass)
           
 HTMLElementImpl getAncestorWithClass(java.lang.String elementTL, java.lang.String classTL)
          Get an ancestor that matches the element tag name given and the style class given.
 HTMLElementImpl getAncestorWithId(java.lang.String elementTL, java.lang.String idTL)
           
 boolean getAttributeAsBoolean(java.lang.String name)
           
protected  int getAttributeAsInt(java.lang.String name, int defaultValue)
           
 java.lang.String getCharset()
           
 java.lang.String getClassName()
           
 org.lobobrowser.html.style.AbstractCSS2Properties getComputedStyle(java.lang.String pseudoElement)
           
protected  org.w3c.css.sac.InputSource getCssInputSourceForDecl(java.lang.String text)
           
 org.lobobrowser.html.style.AbstractCSS2Properties getCurrentStyle()
          Gets the style object associated with the element.
 java.lang.String getDocumentBaseURI()
           
protected  FormInput[] getFormInputs()
          Gets form input due to the current element.
 int getOffsetHeight()
           
 int getOffsetLeft()
           
 int getOffsetTop()
           
 int getOffsetWidth()
           
 java.lang.String getOuterHTML()
           
 HTMLElementImpl getParent(java.lang.String elementTL)
           
 org.lobobrowser.html.style.AbstractCSS2Properties getParentStyle()
           
 HTMLElementImpl getParentWithClass(java.lang.String elementTL, java.lang.String classTL)
           
 HTMLElementImpl getParentWithId(java.lang.String elementTL, java.lang.String idTL)
           
 HTMLElementImpl getPreceedingSibling(java.lang.String elementTL)
           
 HTMLElementImpl getPreceedingSiblingElement()
           
 HTMLElementImpl getPreceedingSiblingWithClass(java.lang.String elementTL, java.lang.String classTL)
           
 HTMLElementImpl getPreceedingSiblingWithId(java.lang.String elementTL, java.lang.String idTL)
           
 java.util.Set getPseudoNames()
          Gets the pseudo-element lowercase names currently applicable to this element.
 org.lobobrowser.html.style.AbstractCSS2Properties getStyle()
          Gets the local style object associated with the element.
 void informInvalid()
           
 void informInvalidAttibute(java.lang.String normalName)
           
 void setCharset(java.lang.String charset)
           
 void setClassName(java.lang.String className)
           
 void setCurrentStyle(java.lang.Object value)
           
 void setInnerHTML(java.lang.String newHtml)
           
 void setMouseOver(boolean mouseOver)
           
 void setStyle(java.lang.Object value)
           
 java.lang.String toString()
           
 void warn(java.lang.String message)
           
 void warn(java.lang.String message, java.lang.Throwable err)
           
 
Methods inherited from class org.lobobrowser.html.domimpl.ElementImpl
createSimilarNode, equalAttributes, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDir, getElementsByTagName, getElementsByTagNameNS, getId, getLang, getLocalName, getNodeName, getNodeType, getNodeValue, getRawInnerText, getSchemaTypeInfo, getTagName, getTitle, hasAttribute, hasAttributeNS, hasAttributes, htmlEncodeChildText, isTagName, normalizeAttributeName, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeImpl, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDir, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInnerText, setLang, setNodeValue, setTitle
 
Methods inherited from class org.lobobrowser.html.domimpl.NodeImpl
appendChild, appendInnerHTMLImpl, appendInnerTextImpl, cloneNode, compareDocumentPosition, findUINode, forgetRenderState, getAlignmentX, getAlignmentY, getBaseURI, getChildNodes, getChildren, getChildrenArray, getDescendents, getDocumentItem, getDocumentURL, getFeature, getFirstChild, getFullURL, getHtmlRendererContext, getInnerHTML, getInnerText, getLastChild, getNamespaceURI, getNextSibling, getNodeList, getOwnerDocument, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousSibling, getRenderState, getTextContent, getUINode, getUserAgentContext, getUserData, hasChildNodes, informDocumentInvalid, informExternalScriptLoading, 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, setPrefix, setTextContent, setUINode, setUserData
 
Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate
getScriptable, setScriptable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.html2.HTMLElement
getDir, getId, getLang, getTitle, setDir, setId, setLang, setTitle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.lobobrowser.html.style.CSS2PropertiesContext
informLayoutInvalid, informLookInvalid, informPositionInvalid, informSizeInvalid
 

Constructor Detail

HTMLElementImpl

public HTMLElementImpl(java.lang.String name,
                       boolean noStyleSheet)

HTMLElementImpl

public HTMLElementImpl(java.lang.String name)
Method Detail

forgetLocalStyle

protected final void forgetLocalStyle()

forgetStyle

protected final void forgetStyle(boolean deep)

getCurrentStyle

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


getStyle

public org.lobobrowser.html.style.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.


createDefaultStyleSheet

protected org.lobobrowser.html.style.AbstractCSS2Properties createDefaultStyleSheet()

getComputedStyle

public org.lobobrowser.html.style.AbstractCSS2Properties getComputedStyle(java.lang.String pseudoElement)

setStyle

public void setStyle(java.lang.Object value)

setCurrentStyle

public void setCurrentStyle(java.lang.Object value)

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.w3c.dom.html2.HTMLElement

setClassName

public void setClassName(java.lang.String className)
Specified by:
setClassName in interface org.w3c.dom.html2.HTMLElement

getCharset

public java.lang.String getCharset()

setCharset

public void setCharset(java.lang.String charset)

warn

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

warn

public void warn(java.lang.String message)
Overrides:
warn in class NodeImpl

getAttributeAsInt

protected int getAttributeAsInt(java.lang.String name,
                                int defaultValue)

getAttributeAsBoolean

public boolean getAttributeAsBoolean(java.lang.String name)

assignAttributeField

protected void assignAttributeField(java.lang.String normalName,
                                    java.lang.String value)
Overrides:
assignAttributeField in class ElementImpl

getCssInputSourceForDecl

protected final org.w3c.css.sac.InputSource getCssInputSourceForDecl(java.lang.String text)

addStyleSheetDeclarations

protected final org.lobobrowser.html.style.AbstractCSS2Properties addStyleSheetDeclarations(org.lobobrowser.html.style.AbstractCSS2Properties style,
                                                                                            java.util.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 -

setMouseOver

public void setMouseOver(boolean mouseOver)

getPseudoNames

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


findStyleDeclarations

protected final java.util.Collection findStyleDeclarations(java.lang.String elementName,
                                                           java.lang.String id,
                                                           java.lang.String className,
                                                           java.util.Set pseudoNames)

informInvalid

public void informInvalid()
Specified by:
informInvalid in interface org.lobobrowser.html.style.CSS2PropertiesContext
Overrides:
informInvalid in class NodeImpl

informInvalidAttibute

public void informInvalidAttibute(java.lang.String normalName)

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.


getAncestorWithClass

public HTMLElementImpl getAncestorWithClass(java.lang.String elementTL,
                                            java.lang.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.

getParentWithClass

public HTMLElementImpl getParentWithClass(java.lang.String elementTL,
                                          java.lang.String classTL)

getPreceedingSiblingElement

public HTMLElementImpl getPreceedingSiblingElement()

getPreceedingSiblingWithClass

public HTMLElementImpl getPreceedingSiblingWithClass(java.lang.String elementTL,
                                                     java.lang.String classTL)

getAncestorWithId

public HTMLElementImpl getAncestorWithId(java.lang.String elementTL,
                                         java.lang.String idTL)

getParentWithId

public HTMLElementImpl getParentWithId(java.lang.String elementTL,
                                       java.lang.String idTL)

getPreceedingSiblingWithId

public HTMLElementImpl getPreceedingSiblingWithId(java.lang.String elementTL,
                                                  java.lang.String idTL)

getAncestor

public HTMLElementImpl getAncestor(java.lang.String elementTL)

getParent

public HTMLElementImpl getParent(java.lang.String elementTL)

getPreceedingSibling

public HTMLElementImpl getPreceedingSibling(java.lang.String elementTL)

getAncestorForJavaClass

protected java.lang.Object getAncestorForJavaClass(java.lang.Class javaClass)

setInnerHTML

public void setInnerHTML(java.lang.String newHtml)

getOuterHTML

public java.lang.String getOuterHTML()

appendOuterHTMLImpl

protected void appendOuterHTMLImpl(java.lang.StringBuffer buffer)

createRenderState

protected org.lobobrowser.html.style.RenderState createRenderState(org.lobobrowser.html.style.RenderState prevRenderState)
Overrides:
createRenderState in class NodeImpl

getOffsetTop

public int getOffsetTop()

getOffsetLeft

public int getOffsetLeft()

getOffsetWidth

public int getOffsetWidth()

getOffsetHeight

public int getOffsetHeight()

getParentStyle

public org.lobobrowser.html.style.AbstractCSS2Properties getParentStyle()
Specified by:
getParentStyle in interface org.lobobrowser.html.style.CSS2PropertiesContext

getDocumentBaseURI

public java.lang.String getDocumentBaseURI()
Specified by:
getDocumentBaseURI in interface org.lobobrowser.html.style.CSS2PropertiesContext

toString

public java.lang.String toString()
Overrides:
toString in class ElementImpl


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Cobra Project Home]