| java.lang.Object com.gargoylesoftware.htmlunit.html.DomNode com.gargoylesoftware.htmlunit.html.DomNamespaceNode com.gargoylesoftware.htmlunit.html.DomElement com.gargoylesoftware.htmlunit.html.HtmlElement
All known Subclasses: com.gargoylesoftware.htmlunit.html.HtmlHtml, com.gargoylesoftware.htmlunit.html.HtmlHead, com.gargoylesoftware.htmlunit.html.HtmlTitle, com.gargoylesoftware.htmlunit.html.StyledElement, com.gargoylesoftware.htmlunit.html.HtmlStyle, com.gargoylesoftware.htmlunit.html.HtmlParameter, com.gargoylesoftware.htmlunit.html.HtmlBaseFont, com.gargoylesoftware.htmlunit.html.HtmlBase, com.gargoylesoftware.htmlunit.html.HtmlScript, com.gargoylesoftware.htmlunit.html.HtmlMeta,
HtmlElement | abstract public class HtmlElement extends DomElement (Code) | | An abstract wrapper for html elements
version: $Revision: 2149 $ author: Mike Bowler author: Mike J. Bresnahan author: David K. Taylor author: Christian Sell author: David D. Kilzer author: Mike Gallaher author: Denis N. Antonioli author: Marc Guillemot author: Ahmed Ashour |
Inner Class :protected class ChildElementsIterator implements Iterator | |
Inner Class :public static class MapEntryWrappingIterator implements Iterator | |
Constructor Summary | |
protected | HtmlElement(String namespaceURI, String qualifiedName, HtmlPage htmlPage, Map attributes) Creates an instance.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: qualifiedName - The qualified name of the element type to instantiate Parameters: htmlPage - The page that contains this element Parameters: attributes - a map ready initialized with the attributes for this element, ornull . |
Method Summary | |
static HtmlAttr | addAttributeToMap(HtmlPage page, Map attributeMap, String namespaceURI, String qualifiedName, String value) Add an attribute to the attribute map. | public void | addHtmlAttributeChangeListener(HtmlAttributeChangeListener listener) Adds an HtmlAttributeChangeListener to the listener list. | final public HtmlElement | appendChildIfNoneExists(String tagName) Appends a child element to this HTML element with the specified tag name
if this HTML element does not already have a child with that tag name. | final protected void | assertNotEmpty(String description, String string) Assert that the specified string is not empty. | public void | blur() Remove focus from this element. | public DomNode | cloneDomNode(boolean deep) Overrides
DomNode.cloneDomNode(boolean) so clone gets its own Map of attributes. | public DomNode | cloneNode(boolean deep) Overrides
DomNode.cloneNode(boolean) so clone gets its own Map of attributes. | static Map | createAttributeMap(int attributeCount) Create an attribute map as needed by HtmlElement. | public ScriptResult | fireEvent(String eventType) Shortcut for
HtmlElement.fireEvent(Event) .
Parameters: eventType - the event type (like "load", "click") the execution result. | public ScriptResult | fireEvent(Event event) Fire the event on the element. | protected void | fireHtmlAttributeAdded(HtmlAttributeChangeEvent event) Support for reporting HTML attribute changes. | protected void | fireHtmlAttributeRemoved(HtmlAttributeChangeEvent event) Support for reporting html attribute changes. | protected void | fireHtmlAttributeReplaced(HtmlAttributeChangeEvent event) Support for reporting html attribute changes. | public void | focus() Set the focus to this element. | final public String | getAttribute(String attributeName) Return the value of the attribute specified by name or an empty string. | public Iterator | getAttributeEntriesIterator() an iterator over the HtmlAttr objects representing theattributes of this element. | final public String | getAttributeNS(String namespaceURI, String localName) Return the value of the attribute specified by namespace and local name or an empty
string. | final public String | getAttributeValue(String attributeName) Return the value of the specified attribute or an empty string. | final public Iterator | getChildElementsIterator() an iterator over the HtmlElement children of this object, i.e. | public HtmlElement | getEnclosingElement(String tagName) Return the element with the given name that enclosed this element or null if this element is
no such element is found. | public HtmlForm | getEnclosingForm() Return the form that enclosed this element or null if this element is not within a form. | public HtmlForm | getEnclosingFormOrDie() Return the form that enclosed this element or throw an exception if this element is not within a form. | final public Function | getEventHandler(String eventName) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return a Function to be executed when a given event occurs.
Parameters: eventName - Name of event such as "onclick" or "onblur", etc. | public HtmlElement | getHtmlElementById(String id) Return the html element with the specified id. | final public List | getHtmlElementsByAttribute(String elementName, String attributeName, String attributeValue) | final public List | getHtmlElementsByTagName(String tagName) | final public List | getHtmlElementsByTagNames(List acceptableTagNames) Given a list of tag names, return the html elements that correspond to any matching element
Parameters: acceptableTagNames - The list of tag names to search by. | final public String | getId() | public String | getNodeName() | public short | getNodeType() | final public HtmlElement | getOneHtmlElementByAttribute(String elementName, String attributeName, String attributeValue) | public Short | getTabIndex() Returns this element's tab index, if it has one. | public String | getTagName() Return the tag name of this element. | final public boolean | hasAttribute(String attributeName) Return whether the attribute specified by name has a value. | final public boolean | hasAttributeNS(String namespaceURI, String localName) Return whether the attribute specified by namespace and local name has a value.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: localName - The name within the namespace. | public boolean | hasAttributes() | public boolean | hasHtmlElementWithId(String id) Return true if there is a element with the specified id. | public boolean | isAttributeDefined(String attributeName) Return true if the specified attribute has been defined. | protected boolean | isEmptyXmlTagExpanded() Indicates if a node without children should be written in expanded form as xml
(i.e. | protected boolean | isSubmittableByEnter() Returns true if clicking Enter (ASCII 10, or '\n') should submit the enclosed form (if any). | public void | keyDown(int keyCode) | public void | keyDown(int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey) | public Page | mouseDown() Simulate clicking the mouse in this element. | public Page | mouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button) Simulate clicking the mouse in this element. | public Page | mouseMove() Simulate moving the mouse inside this element. | public Page | mouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button) Simulate moving the mouse inside this element. | public Page | mouseOut() Simulate moving the mouse out of this element. | public Page | mouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button) Simulate moving the mouse out of this element. | public Page | mouseOver() Simulate moving the mouse over this element. | public Page | mouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button) Simulate moving the mouse over this element. | public Page | mouseUp() Simulate releasing the mouse click in this element. | public Page | mouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button) Simulate releasing the mouse click in this element. | final protected void | notImplemented() Throw an exception. | protected void | preventDefault() This method is called if the current fired event is canceled by preventDefault() in FireFox,
or by returning false in Internet Explorer. | protected void | printOpeningTagContentAsXml(PrintWriter printWriter) Prints the content between "<" and ">" (or "/>") in the output of the tag name
and its attributes in xml format. | protected void | printXml(String indent, PrintWriter printWriter) | final public void | removeAttribute(String attributeName) Removes an attribute specified by name from this element. | final public void | removeAttributeNS(String namespaceURI, String localName) Removes an attribute specified by namespace and local name from this element. | final public void | removeChild(String tagName, int i) Removes the ith child element with the specified tag name
from all relationships, if possible. | final public void | removeEventHandler(String eventName) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes the specified event handler. | public void | removeHtmlAttributeChangeListener(HtmlAttributeChangeListener listener) Removes an HtmlAttributeChangeListener from the listener list. | public Page | rightClick() Simulate right clicking the mouse in this element. | public Page | rightClick(boolean shiftKey, boolean ctrlKey, boolean altKey) Simulate right clicking the mouse in this element. | final public void | setAttribute(String attributeName, String attributeValue) Set the value of the attribute specified by name. | final public void | setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue) Set the value of the attribute specified by namespace and qualified name. | final public void | setAttributeValue(String attributeName, String attributeValue) Set the value of the specified attribute. | public void | setAttributeValue(String namespaceURI, String qualifiedName, String attributeValue) Set the value of the specified attribute. | final public void | setEventHandler(String eventName, Function eventHandler) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a Function as an event handler. | final public void | setEventHandler(String eventName, String jsSnippet) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a snippet of javascript code as an event handler. | final public void | setId(String newId) Set the identifier this element. | public String | toString() | public void | type(String text) Simulates typing the specified text while this element has focus. | public void | type(String text, boolean shiftKey, boolean ctrlKey, boolean altKey) Simulates typing the specified text while this element has focus. | public Page | type(char c) Simulates typing the specified character while this element has focus. | public Page | type(char c, boolean shiftKey, boolean ctrlKey, boolean altKey) Simulates typing the specified character while this element has focus. |
ATTRIBUTE_NOT_DEFINED | final public static String ATTRIBUTE_NOT_DEFINED(Code) | | Constant meaning that the specified attribute was not defined.
|
ATTRIBUTE_VALUE_EMPTY | final public static String ATTRIBUTE_VALUE_EMPTY(Code) | | Constant meaning that the specified attribute was found but its value was empty.
|
TAB_INDEX_OUT_OF_BOUNDS | final public static Short TAB_INDEX_OUT_OF_BOUNDS(Code) | | Constant indicating that a tab index value is out of bounds (less than 0 or greater
than 32767).
See Also: HtmlElement.getTabIndex() |
HtmlElement | protected HtmlElement(String namespaceURI, String qualifiedName, HtmlPage htmlPage, Map attributes)(Code) | | Creates an instance.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: qualifiedName - The qualified name of the element type to instantiate Parameters: htmlPage - The page that contains this element Parameters: attributes - a map ready initialized with the attributes for this element, ornull . The map will be stored as is, not copied. |
addAttributeToMap | static HtmlAttr addAttributeToMap(HtmlPage page, Map attributeMap, String namespaceURI, String qualifiedName, String value)(Code) | | Add an attribute to the attribute map. This is just used by the element factories.
Parameters: attributeMap - the attribute map where the attribute will be added. Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: qualifiedName - The qualified name of the attribute Parameters: value - The value of the attribute |
appendChildIfNoneExists | final public HtmlElement appendChildIfNoneExists(String tagName)(Code) | | Appends a child element to this HTML element with the specified tag name
if this HTML element does not already have a child with that tag name.
Returns the appended child element, or the first existent child element
with the specified tag name if none was appended.
Parameters: tagName - the tag name of the child to append the added child, or the first existing child if none was added |
assertNotEmpty | final protected void assertNotEmpty(String description, String string) throws IllegalArgumentException(Code) | | Assert that the specified string is not empty. Throw an exception if it is.
Parameters: description - The description to pass into the exception if this string is empty Parameters: string - The string to check throws: IllegalArgumentException - If the string is empty |
blur | public void blur()(Code) | | Remove focus from this element.
|
createAttributeMap | static Map createAttributeMap(int attributeCount)(Code) | | Create an attribute map as needed by HtmlElement. This is just used by the element factories.
Parameters: attributeCount - the initial number of attributes to be added to the map. the attribute map. |
fireEvent | public ScriptResult fireEvent(Event event)(Code) | | Fire the event on the element. Nothing is done if JavaScript is disabled
Parameters: event - the event to fire. the execution result. null if nothing is executed. |
fireHtmlAttributeAdded | protected void fireHtmlAttributeAdded(HtmlAttributeChangeEvent event)(Code) | | Support for reporting HTML attribute changes.
This method can be called when an attribute has been added and it will send the
appropriate HtmlAttributeChangeEvent to any registered HtmlAttributeChangeListener.
Note that this methods recursively calls this parent fireHtmlAttributeAdded.
Parameters: event - The event. |
fireHtmlAttributeRemoved | protected void fireHtmlAttributeRemoved(HtmlAttributeChangeEvent event)(Code) | | Support for reporting html attribute changes.
This method can be called when an attribute has been removed and it will send the
appropriate HtmlAttributeChangeEvent to any registered HtmlAttributeChangeListener.
Note that this methods recursively calls this parent fireHtmlAttributeRemoved.
Parameters: event - The event. |
fireHtmlAttributeReplaced | protected void fireHtmlAttributeReplaced(HtmlAttributeChangeEvent event)(Code) | | Support for reporting html attribute changes.
This method can be called when an attribute has been replaced and it will send the
appropriate HtmlAttributeChangeEvent to any registered HtmlAttributeChangeListener.
Note that this methods recursively calls this parent fireHtmlAttributeReplaced.
Parameters: event - The event. |
focus | public void focus()(Code) | | Set the focus to this element.
|
getAttributeEntriesIterator | public Iterator getAttributeEntriesIterator()(Code) | | an iterator over the HtmlAttr objects representing theattributes of this element. Each entry holds a string key and a string value.The elements are ordered as found in the html source code. |
getChildElementsIterator | final public Iterator getChildElementsIterator()(Code) | | an iterator over the HtmlElement children of this object, i.e. excluding thenon-element nodes |
getEnclosingElement | public HtmlElement getEnclosingElement(String tagName)(Code) | | Return the element with the given name that enclosed this element or null if this element is
no such element is found.
Parameters: tagName - the name of the tag searched (case insensitive) See above |
getEnclosingForm | public HtmlForm getEnclosingForm()(Code) | | Return the form that enclosed this element or null if this element is not within a form.
See above |
getEventHandler | final public Function getEventHandler(String eventName)(Code) | | INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return a Function to be executed when a given event occurs.
Parameters: eventName - Name of event such as "onclick" or "onblur", etc. A rhino javascript executable Function, or null if no eventhandler has been defined |
getHtmlElementById | public HtmlElement getHtmlElementById(String id) throws ElementNotFoundException(Code) | | Return the html element with the specified id. If more than one element
has this id (not allowed by the html spec) then return the first one.
Parameters: id - The id value to search by The html element found exception: ElementNotFoundException - If no element was found that matches the id |
getHtmlElementsByAttribute | final public List getHtmlElementsByAttribute(String elementName, String attributeName, String attributeValue)(Code) | | Search by the specified criteria and return all the HtmlElement that are found
Parameters: elementName - The name of the element Parameters: attributeName - The name of the attribute Parameters: attributeValue - The value of the attribute A list of HtmlElements |
getHtmlElementsByTagName | final public List getHtmlElementsByTagName(String tagName)(Code) | | Given a list of tag names, return the html elements that correspond to any matching element
Parameters: tagName - the tag name to match The list of tag names |
getHtmlElementsByTagNames | final public List getHtmlElementsByTagNames(List acceptableTagNames)(Code) | | Given a list of tag names, return the html elements that correspond to any matching element
Parameters: acceptableTagNames - The list of tag names to search by. The list of tag names |
getId | final public String getId()(Code) | | the identifier of this element. |
getNodeType | public short getNodeType()(Code) | | the node type |
getOneHtmlElementByAttribute | final public HtmlElement getOneHtmlElementByAttribute(String elementName, String attributeName, String attributeValue) throws ElementNotFoundException(Code) | | Search by the specified criteria and return the first HtmlElement that is found
Parameters: elementName - The name of the element Parameters: attributeName - The name of the attribute Parameters: attributeValue - The value of the attribute The HtmlElement exception: ElementNotFoundException - If a particular xml element could not be found in the dom model |
getTabIndex | public Short getTabIndex()(Code) | | Returns this element's tab index, if it has one. If the tab index is outside of the
valid range (less than 0 or greater than 32767), this method
returns
HtmlElement.TAB_INDEX_OUT_OF_BOUNDS . If this element does not have
a tab index, or its tab index is otherwise invalid, this method returns null.
this element's tab index |
getTagName | public String getTagName()(Code) | | Return the tag name of this element. The tag name is the actual html name. For example
the tag name for HtmlAnchor is "a" and the tag name for HtmlTable is "table".
This tag name will always be in lowercase, no matter what case was used in the original
document, when no namespace is defined.
the tag name of this element. |
hasAttribute | final public boolean hasAttribute(String attributeName)(Code) | | Return whether the attribute specified by name has a value.
Parameters: attributeName - the name of the attribute true if an attribute with the given name is specified on this element or has adefault value, false otherwise. |
hasAttributeNS | final public boolean hasAttributeNS(String namespaceURI, String localName)(Code) | | Return whether the attribute specified by namespace and local name has a value.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: localName - The name within the namespace. true if an attribute with the given name is specified on this element or has adefault value, false otherwise. |
hasAttributes | public boolean hasAttributes()(Code) | | |
hasHtmlElementWithId | public boolean hasHtmlElementWithId(String id)(Code) | | Return true if there is a element with the specified id. This method
is intended for situations where it is enough to know whether a specific
element is present in the document.
Implementation note: This method calls getHtmlElementById() internally
so writing code like the following would be extremely inefficient.
if (hasHtmlElementWithId(id)) {
HtmlElement element = getHtmlElementWithId(id)
...
}
Parameters: id - The id to search by true if an element was found with the specified id. |
isAttributeDefined | public boolean isAttributeDefined(String attributeName)(Code) | | Return true if the specified attribute has been defined. This is neccessary
in order to distinguish between an attribute that is set to an empty string
and one that was not defined at all.
Parameters: attributeName - The attribute to check true if the attribute is defined |
isEmptyXmlTagExpanded | protected boolean isEmptyXmlTagExpanded()(Code) | | Indicates if a node without children should be written in expanded form as xml
(i.e. with closing tag rather than with "/>")
false |
isSubmittableByEnter | protected boolean isSubmittableByEnter()(Code) | | Returns true if clicking Enter (ASCII 10, or '\n') should submit the enclosed form (if any).
Default implementation is false.
true if clicking Enter should submit the enclosed form (if any). |
keyDown | public void keyDown(int keyCode)(Code) | | Simulate pressing a key on this element
Parameters: keyCode - the key you wish to pressHtmlElement.type(char) |
keyDown | public void keyDown(int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)(Code) | | Simulate pressing a key on this element
Parameters: keyCode - the key you wish to press Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed type(char, boolean, boolean, boolean) |
mouseDown | public Page mouseDown()(Code) | | Simulate clicking the mouse in this element.
The page that occupies this window after the mouse is clicked in this element.It may be the same window or it may be a freshly loaded one. |
mouseDown | public Page mouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)(Code) | | Simulate clicking the mouse in this element.
Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed Parameters: button - the button code, must be MouseEvent.BUTTON_LEFT, MouseEvent.BUTTON_MIDDLEor MouseEvent.BUTTON_RIGHT The page that occupies this window after the mouse is clicked in this element.It may be the same window or it may be a freshly loaded one. |
mouseMove | public Page mouseMove()(Code) | | Simulate moving the mouse inside this element.
The page that occupies this window after the mouse moves inside this element.It may be the same window or it may be a freshly loaded one. |
mouseMove | public Page mouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)(Code) | | Simulate moving the mouse inside this element.
Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed Parameters: button - the button code, must be MouseEvent.BUTTON_LEFT, MouseEvent.BUTTON_MIDDLEor MouseEvent.BUTTON_RIGHT The page that occupies this window after the mouse moves inside this element.It may be the same window or it may be a freshly loaded one. |
mouseOut | public Page mouseOut()(Code) | | Simulate moving the mouse out of this element.
The page that occupies this window after the mouse moves out of this element.It may be the same window or it may be a freshly loaded one. |
mouseOut | public Page mouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)(Code) | | Simulate moving the mouse out of this element.
Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed Parameters: button - the button code, must be MouseEvent.BUTTON_LEFT, MouseEvent.BUTTON_MIDDLEor MouseEvent.BUTTON_RIGHT The page that occupies this window after the mouse moves out of this element.It may be the same window or it may be a freshly loaded one. |
mouseOver | public Page mouseOver()(Code) | | Simulate moving the mouse over this element.
The page that occupies this window after the mouse moves over this element.It may be the same window or it may be a freshly loaded one. |
mouseOver | public Page mouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)(Code) | | Simulate moving the mouse over this element.
Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed Parameters: button - the button code, must be MouseEvent.BUTTON_LEFT, MouseEvent.BUTTON_MIDDLEor MouseEvent.BUTTON_RIGHT The page that occupies this window after the mouse moves over this element.It may be the same window or it may be a freshly loaded one. |
mouseUp | public Page mouseUp()(Code) | | Simulate releasing the mouse click in this element.
The page that occupies this window after the mouse click is released in this element.It may be the same window or it may be a freshly loaded one. |
mouseUp | public Page mouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)(Code) | | Simulate releasing the mouse click in this element.
Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed Parameters: button - the button code, must be MouseEvent.BUTTON_LEFT, MouseEvent.BUTTON_MIDDLEor MouseEvent.BUTTON_RIGHT The page that occupies this window after the mouse click is released in this element.It may be the same window or it may be a freshly loaded one. |
notImplemented | final protected void notImplemented()(Code) | | Throw an exception. This is a convenience during development only - it
will likely be removed in the future.
|
preventDefault | protected void preventDefault()(Code) | | This method is called if the current fired event is canceled by preventDefault() in FireFox,
or by returning false in Internet Explorer.
The default implementation does nothing.
|
printOpeningTagContentAsXml | protected void printOpeningTagContentAsXml(PrintWriter printWriter)(Code) | | Prints the content between "<" and ">" (or "/>") in the output of the tag name
and its attributes in xml format.
Parameters: printWriter - the writer to print in |
printXml | protected void printXml(String indent, PrintWriter printWriter)(Code) | | recursively write the XML data for the node tree starting at node
Parameters: indent - white space to indent child nodes Parameters: printWriter - writer where child nodes are written |
removeAttribute | final public void removeAttribute(String attributeName)(Code) | | Removes an attribute specified by name from this element.
Parameters: attributeName - the attribute attributeName |
removeAttributeNS | final public void removeAttributeNS(String namespaceURI, String localName)(Code) | | Removes an attribute specified by namespace and local name from this element.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: localName - The name within the namespace. |
removeChild | final public void removeChild(String tagName, int i)(Code) | | Removes the ith child element with the specified tag name
from all relationships, if possible.
Parameters: tagName - the tag name of the child to remove Parameters: i - the index of the child to remove |
removeEventHandler | final public void removeEventHandler(String eventName)(Code) | | INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes the specified event handler.
Parameters: eventName - Name of the event such as "onclick" or "onblur", etc. |
rightClick | public Page rightClick()(Code) | | Simulate right clicking the mouse in this element.
The page that occupies this window after the mouse is right clicked in this element.It may be the same window or it may be a freshly loaded one. |
rightClick | public Page rightClick(boolean shiftKey, boolean ctrlKey, boolean altKey)(Code) | | Simulate right clicking the mouse in this element.
This is equivalent to calling
HtmlElement.mouseDown(boolean,boolean,boolean,int) ,
then
HtmlElement.mouseUp(boolean,boolean,boolean,int) Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed The page that occupies this window after the mouse is right clicked in this element.It may be the same window or it may be a freshly loaded one. |
setAttribute | final public void setAttribute(String attributeName, String attributeValue)(Code) | | Set the value of the attribute specified by name.
Parameters: attributeName - the name of the attribute Parameters: attributeValue - The value of the attribute |
setAttributeNS | final public void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)(Code) | | Set the value of the attribute specified by namespace and qualified name.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: qualifiedName - The qualified name (prefix:local) of the attribute. Parameters: attributeValue - The value of the attribute |
setAttributeValue | final public void setAttributeValue(String attributeName, String attributeValue)(Code) | | Set the value of the specified attribute.
Parameters: attributeName - the name of the attribute Parameters: attributeValue - The value of the attribute |
setAttributeValue | public void setAttributeValue(String namespaceURI, String qualifiedName, String attributeValue)(Code) | | Set the value of the specified attribute.
Parameters: namespaceURI - the URI that identifies an XML namespace. Parameters: qualifiedName - The qualified name of the attribute Parameters: attributeValue - The value of the attribute |
setEventHandler | final public void setEventHandler(String eventName, Function eventHandler)(Code) | | INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a Function as an event handler.
Parameters: eventName - Name of event such as "onclick" or "onblur", etc. Parameters: eventHandler - A rhino javascript executable Function |
setEventHandler | final public void setEventHandler(String eventName, String jsSnippet)(Code) | | INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a snippet of javascript code as an event handler. The javascript code will
be wrapped inside a unique function declaration which provides one argument named
"event"
Parameters: eventName - Name of event such as "onclick" or "onblur", etc. Parameters: jsSnippet - executable javascript code |
setId | final public void setId(String newId)(Code) | | Set the identifier this element.
Parameters: newId - The new identifier of this element. |
toString | public String toString()(Code) | | Return a string representation of this object
See above |
type | public void type(String text) throws IOException(Code) | | Simulates typing the specified text while this element has focus.
Parameters: text - the text you with to simulate typing exception: IOException - If an IO error occurs |
type | public void type(String text, boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException(Code) | | Simulates typing the specified text while this element has focus.
Parameters: text - the text you with to simulate typing Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed exception: IOException - If an IO error occurs |
type | public Page type(char c) throws IOException(Code) | | Simulates typing the specified character while this element has focus.
Parameters: c - the character you with to simulate typing The page that occupies this window after typing.It may be the same window or it may be a freshly loaded one. exception: IOException - If an IO error occurs |
type | public Page type(char c, boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException(Code) | | Simulates typing the specified character while this element has focus.
Note that for some elements, typing '\n' submits the enclosed form.
Parameters: c - the character you with to simulate typing Parameters: shiftKey - true if SHIFT is pressed Parameters: ctrlKey - true if CTRL is pressed Parameters: altKey - true if ALT is pressed The page that occupies this window after typing.It may be the same window or it may be a freshly loaded one. exception: IOException - If an IO error occurs |
Methods inherited from com.gargoylesoftware.htmlunit.html.DomNode | public void addDomChangeListener(DomChangeListener listener)(Code)(Java Doc) final public synchronized void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public DomNode appendChild(DomNode node)(Code)(Java Doc) public DomNode appendDomChild(DomNode node)(Code)(Java Doc) public String asText()(Code)(Java Doc) public String asXml()(Code)(Java Doc) public DomNode cloneDomNode(boolean deep)(Code)(Java Doc) public DomNode cloneNode(boolean deep)(Code)(Java Doc) protected void fireNodeAdded(DomNode parentNode, DomNode addedNode)(Code)(Java Doc) protected void fireNodeDeleted(DomNode parentNode, DomNode deletedNode)(Code)(Java Doc) final protected synchronized void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code)(Java Doc) public Iterator getAllHtmlChildElements()(Code)(Java Doc) public List getByXPath(String xpathExpr) throws JaxenException(Code)(Java Doc) public Iterator getChildIterator()(Code)(Java Doc) final protected String getChildrenAsText()(Code)(Java Doc) public int getEndColumnNumber()(Code)(Java Doc) public int getEndLineNumber()(Code)(Java Doc) public Function getEventHandler(String eventName)(Code)(Java Doc) public Object getFirstByXPath(String xpathExpr) throws JaxenException(Code)(Java Doc) public DomNode getFirstChild()(Code)(Java Doc) public DomNode getFirstDomChild()(Code)(Java Doc) public DomNode getLastChild()(Code)(Java Doc) public DomNode getLastDomChild()(Code)(Java Doc) public String getLocalName()(Code)(Java Doc) final protected Log getLog()(Code)(Java Doc) public String getNamespaceURI()(Code)(Java Doc) public Page getNativePage()(Code)(Java Doc) public DomNode getNextDomSibling()(Code)(Java Doc) public DomNode getNextSibling()(Code)(Java Doc) abstract public String getNodeName()(Code)(Java Doc) abstract public short getNodeType()(Code)(Java Doc) public String getNodeValue()(Code)(Java Doc) public HtmlPage getPage()(Code)(Java Doc) public DomNode getParentDomNode()(Code)(Java Doc) public DomNode getParentNode()(Code)(Java Doc) public String getPrefix()(Code)(Java Doc) public DomNode getPreviousDomSibling()(Code)(Java Doc) public DomNode getPreviousSibling()(Code)(Java Doc) public String getReadyState()(Code)(Java Doc) public ScriptableObject getScriptObject()(Code)(Java Doc) public int getStartColumnNumber()(Code)(Java Doc) public int getStartLineNumber()(Code)(Java Doc) public boolean hasAttributes()(Code)(Java Doc) public void insertBefore(DomNode newNode) throws IllegalStateException(Code)(Java Doc) public boolean isAncestorOf(DomNode node)(Code)(Java Doc) protected boolean isRenderedVisible()(Code)(Java Doc) protected boolean isTrimmedText()(Code)(Java Doc) protected void notifyIncorrectness(String message)(Code)(Java Doc) protected void onAddedToPage()(Code)(Java Doc) protected void onAllChildrenAddedToPage()(Code)(Java Doc) protected void printChildrenAsXml(String indent, PrintWriter printWriter)(Code)(Java Doc) protected void printXml(String indent, PrintWriter printWriter)(Code)(Java Doc) protected static String reduceWhitespace(String text)(Code)(Java Doc) public void remove() throws IllegalStateException(Code)(Java Doc) public void removeAllChildren()(Code)(Java Doc) public void removeDomChangeListener(DomChangeListener listener)(Code)(Java Doc) public void removeEventHandler(String eventName)(Code)(Java Doc) final public synchronized void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void replace(DomNode newNode) throws IllegalStateException(Code)(Java Doc) void setEndLocation(int endLineNumber, int endColumnNumber)(Code)(Java Doc) public void setEventHandler(String eventName, Function eventHandler)(Code)(Java Doc) public void setEventHandler(String eventName, String jsSnippet)(Code)(Java Doc) protected void setNextSibling(DomNode next)(Code)(Java Doc) public void setNodeValue(String x)(Code)(Java Doc) protected void setParentNode(DomNode parent)(Code)(Java Doc) public void setPrefix(String prefix)(Code)(Java Doc) protected void setPreviousSibling(DomNode previous)(Code)(Java Doc) public void setReadyState(String state)(Code)(Java Doc) public void setScriptObject(ScriptableObject scriptObject)(Code)(Java Doc) void setStartLocation(int startLineNumber, int startColumnNumber)(Code)(Java Doc)
|
|
|