com.webrenderer.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 getImageSrc()
          Returns the src if this is an Image element, otherwise null.
 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.
 java.lang.String getOuterText()
          Retrieves the text of the object.
 IElement getParentElement()
          Retrieves the parent object in the object hierarchy.
 IElement getParentTextEdit()
          Retrieves the container object in the document hierarchy that can be used to create a TextRange containing the original object.
 long getSelectedIndex()
          For SELECT elements in IE will return the selected index.
 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.
 void insertAdjacentHTML(java.lang.String loc, java.lang.String html)
          Inserts the given HTML text into the element at the location.
 void insertAdjacentText(java.lang.String loc, java.lang.String txt)
          Inserts the given text into the element at the specified location.
 void insertElementAdjHTML(java.lang.String loc, java.lang.String html)
          Inserts the given HTML text into the element at the location.
 boolean isTextEdit()
          Retrieves whether a TextRange object can be created using the object.
 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 putOuterText(java.lang.String text)
          Sets the text of the object.
 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 scrollIntoView(boolean b)
          Causes the object to scroll into view, aligning it either at the top or bottom of the window.
 void setAttribute(java.lang.String name, java.lang.Object value, long flags)
          Sets the value of the specified attribute.
 void setSelectedIndex(long index)
          Set the selected index for SELECT elements in IE.
 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

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


putClassName

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


click

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


contains

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


filters

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


getAttribute

public 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

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


putId

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


getInnerHTML

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


putInnerHTML

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


getInnerText

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


putInnerText

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


insertElementAdjHTML

public void insertElementAdjHTML(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

insertAdjacentHTML

public 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

insertAdjacentText

public void insertAdjacentText(java.lang.String loc,
                               java.lang.String txt)
Inserts the given text into the element at the specified location. This applies to an IEBrowserCanvas


isTextEdit

public boolean isTextEdit()
Retrieves whether a TextRange object can be created using the object. STATUS: Not Implemented in Linux


getLang

public 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 Also:
http://www.w3.org/TR/REC-html40/references.html#ref-RFC1766

putLang

public 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 Also:
http://www.w3.org/TR/REC-html40/references.html#ref-RFC1766

getLanguage

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


putLanguage

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


getOffsetHeight

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


getOffsetLeft

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


getOffsetParent

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


getOffsetTop

public 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

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


getOuterHTML

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


putOuterHTML

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


getOuterText

public java.lang.String getOuterText()
Retrieves the text of the object. This applies to an IEBrowserCanvas


putOuterText

public void putOuterText(java.lang.String text)
Sets the text of the object. This applies to an IEBrowserCanvas


getParentElement

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


getParentTextEdit

public IElement getParentTextEdit()
Retrieves the container object in the document hierarchy that can be used to create a TextRange containing the original object. STATUS: Not Implemented in Linux


removeAttribute

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


scrollIntoView

public void scrollIntoView(boolean b)
Causes the object to scroll into view, aligning it either at the top or bottom of the window.

Parameters:
b - true to scroll element to top of screen, false to scroll to bottom

setAttribute

public 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, For IE this should be an isntance of String,Boolean, or Integer depending to the type of value that needs to be set.
flags - 0-case insensitive, 1- case sensitive (unused if called from a IMozillaBrowserCanvas)

getSourceIndex

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


getTagName

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


getTitle

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


putTitle

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


getChildElements

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


isTextNode

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


getTextNodeText

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


getValue

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


getSelectedIndex

public long getSelectedIndex()
For SELECT elements in IE will return the selected index.

Will return -1 if nothing is selected or is not a select tag.


setSelectedIndex

public void setSelectedIndex(long index)
Set the selected index for SELECT elements in IE.
This does nothing if it is not a SELECT element.

Parameters:
index -

setValue

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

Parameters:
value -

toString

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


getImageSrc

public java.lang.String getImageSrc()
Returns the src if this is an Image element, otherwise null.


getAttributes

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


equals

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