com.webrenderer.se.dom
Interface IElement


public interface IElement

Stores an Element in the dom tree.


Method Summary
 void click()
          Simulates a click by causing the onclick event to fire.
 boolean contains(IElement e)
          Checks whether the given element is nested within this element.
 boolean equals(IElement element)
          Compares another IElement with this one for equality.
 IElementCollection filters()
          Retrieves a collection of filters for an element.
 java.lang.String getAttribute(java.lang.String name, long flags)
          Retrieves the value of the specified attribute.
 java.lang.String[] getAttributes()
          Returns an array of all the attributes of this object in the form of "name=value"
 IElementCollection getChildElements()
          Returns an Element Collection of all the Elements Child Nodes
 java.lang.String getClassName()
          Retrieves the class attribute of the Element.
 java.lang.String getId()
          Retrieves the string identifying the Element.
 java.lang.String getInnerHTML()
          Retrieves the HTML between the start and end tags of the object.
 java.lang.String getInnerText()
          Retrieves the text between the start and end tags of the object.
 java.lang.String getLang()
          Retrieves the language to use.
 java.lang.String getLanguage()
          Retrieves the language in which the current script is written.
 long getOffsetHeight()
          Retrieves the height of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.
 long getOffsetLeft()
          Retrieves the calculated left position of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.
 IElement getOffsetParent()
          Retrieves a reference to the container object that defines the Element::offsetTop and Element::offsetLeft properties of the object.
 long getOffsetTop()
          Retrieves the calculated top position of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.
 long getOffsetWidth()
          Retrieves the width of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.
 java.lang.String getOuterHTML()
          Retrieves the object and its content in HTML.
 IElement getParentElement()
          Retrieves the parent object in the object hierarchy.
 long getSourceIndex()
          Retrieves the ordinal position of the object, in source order, as the object appears in the document's all collection.
 java.lang.String getTagName()
          Retrieves the tag name of the object.
 java.lang.String getTextNodeText()
          Returns the contents of a text node or null if the element is not a textnode.
 java.lang.String getTitle()
          Retrieves advisory information (a ToolTip) for the object.
 java.lang.String getValue()
          Returns the value of an element if it is an INPUT element.
 long getX()
          Returns the X position of the element in pixels.
 long getY()
          Returns the Y position of the element in pixels.
 void insertAdjacentHTML(java.lang.String loc, java.lang.String html)
          Inserts the given HTML text into the element at the location.
 boolean isTextNode()
          Returns true if the Element is a simple text node (only contains text, has no html tag)
 void putClassName(java.lang.String name)
          Sets the class attribute of the Element.
 void putId(java.lang.String id)
          Sets the string which identifies the Element.
 void putInnerHTML(java.lang.String ih)
          Sets the HTML between the start and end tags of the object.
 void putInnerText(java.lang.String it)
          Sets the text between the start and end tags of the object.
 void putLang(java.lang.String lang)
          Sets the language to use.
 void putLanguage(java.lang.String lang)
          Sets the language in which the current script is written.
 void putOuterHTML(java.lang.String html)
          Sets the object and its content in HTML This applies to an IEBrowserCanvas
 void putTitle(java.lang.String t)
          Sets advisory information (a ToolTip) for the object.
 boolean removeAttribute(java.lang.String name, long flags)
          Removes the given attribute from the Element.
 void setAttribute(java.lang.String name, java.lang.Object value, long flags)
          Sets the value of the specified attribute.
 void setValue(java.lang.String value)
          Sets the value of an element if it is an INPUT element.
 java.lang.String toString()
          Retrieves a string representation of the object.
 

Method Detail

getClassName

java.lang.String getClassName()
Retrieves the class attribute of the Element.


putClassName

void putClassName(java.lang.String name)
Sets the class attribute of the Element.


click

void click()
Simulates a click by causing the onclick event to fire. This applies to Elements of type INPUT on a MozillaBrowserCanvas


contains

boolean contains(IElement e)
Checks whether the given element is nested within this element.


filters

IElementCollection filters()
Retrieves a collection of filters for an element. This applies to an IEBrowserCanvas


getAttribute

java.lang.String getAttribute(java.lang.String name,
                              long flags)
Retrieves the value of the specified attribute.

Parameters:
name - of the attribute
flags - 0-case insensitive, 1- case sensitive (unused if called from a IMozillaBrowserCanvas)
Returns:
the attributes value

getId

java.lang.String getId()
Retrieves the string identifying the Element.


putId

void putId(java.lang.String id)
Sets the string which identifies the Element.


getInnerHTML

java.lang.String getInnerHTML()
Retrieves the HTML between the start and end tags of the object.


putInnerHTML

void putInnerHTML(java.lang.String ih)
Sets the HTML between the start and end tags of the object.


getInnerText

java.lang.String getInnerText()
Retrieves the text between the start and end tags of the object. This applies to an IEBrowserCanvas


putInnerText

void putInnerText(java.lang.String it)
Sets the text between the start and end tags of the object. This applies to an IEBrowserCanvas


insertAdjacentHTML

void insertAdjacentHTML(java.lang.String loc,
                        java.lang.String html)
Inserts the given HTML text into the element at the location.

The location can be one of the following:

Parameters:
loc - location to put the html code relative to this element
html - code to add

getLang

java.lang.String getLang()
Retrieves the language to use. The language specifies the base language of an element's attribute values and text content. (see http://www.w3.org/TR/REC-html40/references.html#ref-RFC1766)


putLang

void putLang(java.lang.String lang)
Sets the language to use. The language specifies the base language of an element's attribute values and text content. (see http://www.w3.org/TR/REC-html40/references.html#ref-RFC1766)


getLanguage

java.lang.String getLanguage()
Retrieves the language in which the current script is written. STATUS: Not Implemented in Linux


putLanguage

void putLanguage(java.lang.String lang)
Sets the language in which the current script is written. STATUS: Not Implemented in Linux


getOffsetHeight

long getOffsetHeight()
Retrieves the height of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.


getOffsetLeft

long getOffsetLeft()
Retrieves the calculated left position of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.


getX

long getX()
Returns the X position of the element in pixels.


getY

long getY()
Returns the Y position of the element in pixels.


getOffsetParent

IElement getOffsetParent()
Retrieves a reference to the container object that defines the Element::offsetTop and Element::offsetLeft properties of the object.


getOffsetTop

long getOffsetTop()
Retrieves the calculated top position of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.


getOffsetWidth

long getOffsetWidth()
Retrieves the width of the object relative to the layout or coordinate parent, as specified by the Element::offsetParent property.


getOuterHTML

java.lang.String getOuterHTML()
Retrieves the object and its content in HTML.


putOuterHTML

void putOuterHTML(java.lang.String html)
Sets the object and its content in HTML This applies to an IEBrowserCanvas


getParentElement

IElement getParentElement()
Retrieves the parent object in the object hierarchy.


removeAttribute

boolean removeAttribute(java.lang.String name,
                        long flags)
Removes the given attribute from the Element. The flags are only used by an IEBrowserCanvas


setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value,
                  long flags)
Sets the value of the specified attribute. If the attribute does not exist, then it is created.

Parameters:
name - name of attribute
value - value to set attribute to
flags - 0-case insensitive, 1- case sensitive (unused if called from a IMozillaBrowserCanvas)

getSourceIndex

long getSourceIndex()
Retrieves the ordinal position of the object, in source order, as the object appears in the document's all collection.


getTagName

java.lang.String getTagName()
Retrieves the tag name of the object.


getTitle

java.lang.String getTitle()
Retrieves advisory information (a ToolTip) for the object.


putTitle

void putTitle(java.lang.String t)
Sets advisory information (a ToolTip) for the object.


getChildElements

IElementCollection getChildElements()
Returns an Element Collection of all the Elements Child Nodes


isTextNode

boolean isTextNode()
Returns true if the Element is a simple text node (only contains text, has no html tag)


getTextNodeText

java.lang.String getTextNodeText()
Returns the contents of a text node or null if the element is not a textnode.


getValue

java.lang.String getValue()
Returns the value of an element if it is an INPUT element.


setValue

void setValue(java.lang.String value)
Sets the value of an element if it is an INPUT element.

Parameters:
value -

toString

java.lang.String toString()
Retrieves a string representation of the object.

Overrides:
toString in class java.lang.Object

getAttributes

java.lang.String[] getAttributes()
Returns an array of all the attributes of this object in the form of "name=value"


equals

boolean equals(IElement element)
Compares another IElement with this one for equality.