Class HTMLElementImpl

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

public class HTMLElementImpl extends ElementImpl implements HTMLElement, CSS2PropertiesContext
  • Constructor Details

    • HTMLElementImpl

      public HTMLElementImpl(String name, boolean noStyleSheet)
    • HTMLElementImpl

      public HTMLElementImpl(String name)
  • Method Details

    • forgetLocalStyle

      protected final void forgetLocalStyle()
    • forgetStyle

      protected final void forgetStyle(boolean deep)
    • 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.
    • 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.
    • createDefaultStyleSheet

      protected AbstractCSS2Properties createDefaultStyleSheet()
    • getComputedStyle

      public AbstractCSS2Properties getComputedStyle(String pseudoElement)
    • setStyle

      public void setStyle(Object value)
    • setCurrentStyle

      public void setCurrentStyle(Object value)
    • getClassName

      public String getClassName()
      Description copied from interface: HTMLElement
      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
    • setClassName

      public void setClassName(String className)
      Description copied from interface: HTMLElement
      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
    • getCharset

      public String getCharset()
    • setCharset

      public void setCharset(String charset)
    • warn

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

      public void warn(String message)
      Overrides:
      warn in class NodeImpl
    • getAttributeAsInt

      protected int getAttributeAsInt(String name, int defaultValue)
    • getAttributeAsBoolean

      public boolean getAttributeAsBoolean(String name)
    • assignAttributeField

      protected void assignAttributeField(String normalName, String value)
      Overrides:
      assignAttributeField in class ElementImpl
    • getCssInputSourceForDecl

      protected final InputSource getCssInputSourceForDecl(String text)
    • 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 -
    • setMouseOver

      public void setMouseOver(boolean mouseOver)
    • 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.
    • findStyleDeclarations

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

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

      public void informInvalidAttibute(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(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.
    • getParentWithClass

      public HTMLElementImpl getParentWithClass(String elementTL, String classTL)
    • getPreceedingSiblingElement

      public HTMLElementImpl getPreceedingSiblingElement()
    • getPreceedingSiblingWithClass

      public HTMLElementImpl getPreceedingSiblingWithClass(String elementTL, String classTL)
    • getAncestorWithId

      public HTMLElementImpl getAncestorWithId(String elementTL, String idTL)
    • getParentWithId

      public HTMLElementImpl getParentWithId(String elementTL, String idTL)
    • getPreceedingSiblingWithId

      public HTMLElementImpl getPreceedingSiblingWithId(String elementTL, String idTL)
    • getAncestor

      public HTMLElementImpl getAncestor(String elementTL)
    • getParent

      public HTMLElementImpl getParent(String elementTL)
    • getPreceedingSibling

      public HTMLElementImpl getPreceedingSibling(String elementTL)
    • getAncestorForJavaClass

      protected Object getAncestorForJavaClass(Class javaClass)
    • setInnerHTML

      public void setInnerHTML(String newHtml)
    • getOuterHTML

      public String getOuterHTML()
    • appendOuterHTMLImpl

      protected void appendOuterHTMLImpl(StringBuffer buffer)
    • createRenderState

      protected RenderState createRenderState(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 AbstractCSS2Properties getParentStyle()
      Specified by:
      getParentStyle in interface CSS2PropertiesContext
    • getDocumentBaseURI

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

      public String toString()
      Overrides:
      toString in class ElementImpl