Java Doc for HtmlElement.java in  » Testing » htmlunit » com » gargoylesoftware » htmlunit » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » htmlunit » com.gargoylesoftware.htmlunit.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

Field Summary
final public static  StringATTRIBUTE_NOT_DEFINED
     Constant meaning that the specified attribute was not defined.
final public static  StringATTRIBUTE_VALUE_EMPTY
     Constant meaning that the specified attribute was found but its value was empty.
final public static  ShortTAB_INDEX_OUT_OF_BOUNDS
     Constant indicating that a tab index value is out of bounds (less than 0 or greater than 32767).

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  HtmlAttraddAttributeToMap(HtmlPage page, Map attributeMap, String namespaceURI, String qualifiedName, String value)
     Add an attribute to the attribute map.
public  voidaddHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)
     Adds an HtmlAttributeChangeListener to the listener list.
final public  HtmlElementappendChildIfNoneExists(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  voidassertNotEmpty(String description, String string)
     Assert that the specified string is not empty.
public  voidblur()
     Remove focus from this element.
public  DomNodecloneDomNode(boolean deep)
     Overrides DomNode.cloneDomNode(boolean) so clone gets its own Map of attributes.
public  DomNodecloneNode(boolean deep)
     Overrides DomNode.cloneNode(boolean) so clone gets its own Map of attributes.
static  MapcreateAttributeMap(int attributeCount)
     Create an attribute map as needed by HtmlElement.
public  ScriptResultfireEvent(String eventType)
     Shortcut for HtmlElement.fireEvent(Event) .
Parameters:
  eventType - the event type (like "load", "click") the execution result.
public  ScriptResultfireEvent(Event event)
     Fire the event on the element.
protected  voidfireHtmlAttributeAdded(HtmlAttributeChangeEvent event)
     Support for reporting HTML attribute changes.
protected  voidfireHtmlAttributeRemoved(HtmlAttributeChangeEvent event)
     Support for reporting html attribute changes.
protected  voidfireHtmlAttributeReplaced(HtmlAttributeChangeEvent event)
     Support for reporting html attribute changes.
public  voidfocus()
     Set the focus to this element.
final public  StringgetAttribute(String attributeName)
     Return the value of the attribute specified by name or an empty string.
public  IteratorgetAttributeEntriesIterator()
     an iterator over the HtmlAttr objects representing theattributes of this element.
final public  StringgetAttributeNS(String namespaceURI, String localName)
     Return the value of the attribute specified by namespace and local name or an empty string.
final public  StringgetAttributeValue(String attributeName)
     Return the value of the specified attribute or an empty string.
final public  IteratorgetChildElementsIterator()
     an iterator over the HtmlElement children of this object, i.e.
public  HtmlElementgetEnclosingElement(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  HtmlFormgetEnclosingForm()
     Return the form that enclosed this element or null if this element is not within a form.
public  HtmlFormgetEnclosingFormOrDie()
     Return the form that enclosed this element or throw an exception if this element is not within a form.
final public  FunctiongetEventHandler(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  HtmlElementgetHtmlElementById(String id)
     Return the html element with the specified id.
final public  ListgetHtmlElementsByAttribute(String elementName, String attributeName, String attributeValue)
    
final public  ListgetHtmlElementsByTagName(String tagName)
    
final public  ListgetHtmlElementsByTagNames(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  StringgetId()
    
public  StringgetNodeName()
    
public  shortgetNodeType()
    
final public  HtmlElementgetOneHtmlElementByAttribute(String elementName, String attributeName, String attributeValue)
    
public  ShortgetTabIndex()
     Returns this element's tab index, if it has one.
public  StringgetTagName()
     Return the tag name of this element.
final public  booleanhasAttribute(String attributeName)
     Return whether the attribute specified by name has a value.
final public  booleanhasAttributeNS(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  booleanhasAttributes()
    
public  booleanhasHtmlElementWithId(String id)
     Return true if there is a element with the specified id.
public  booleanisAttributeDefined(String attributeName)
     Return true if the specified attribute has been defined.
protected  booleanisEmptyXmlTagExpanded()
     Indicates if a node without children should be written in expanded form as xml (i.e.
protected  booleanisSubmittableByEnter()
     Returns true if clicking Enter (ASCII 10, or '\n') should submit the enclosed form (if any).
public  voidkeyDown(int keyCode)
    
public  voidkeyDown(int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)
    
public  PagemouseDown()
     Simulate clicking the mouse in this element.
public  PagemouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
     Simulate clicking the mouse in this element.
public  PagemouseMove()
     Simulate moving the mouse inside this element.
public  PagemouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
     Simulate moving the mouse inside this element.
public  PagemouseOut()
     Simulate moving the mouse out of this element.
public  PagemouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
     Simulate moving the mouse out of this element.
public  PagemouseOver()
     Simulate moving the mouse over this element.
public  PagemouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
     Simulate moving the mouse over this element.
public  PagemouseUp()
     Simulate releasing the mouse click in this element.
public  PagemouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
     Simulate releasing the mouse click in this element.
final protected  voidnotImplemented()
     Throw an exception.
protected  voidpreventDefault()
     This method is called if the current fired event is canceled by preventDefault() in FireFox, or by returning false in Internet Explorer.
protected  voidprintOpeningTagContentAsXml(PrintWriter printWriter)
     Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in xml format.
protected  voidprintXml(String indent, PrintWriter printWriter)
    
final public  voidremoveAttribute(String attributeName)
     Removes an attribute specified by name from this element.
final public  voidremoveAttributeNS(String namespaceURI, String localName)
     Removes an attribute specified by namespace and local name from this element.
final public  voidremoveChild(String tagName, int i)
     Removes the ith child element with the specified tag name from all relationships, if possible.
final public  voidremoveEventHandler(String eventName)
     INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes the specified event handler.
public  voidremoveHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)
     Removes an HtmlAttributeChangeListener from the listener list.
public  PagerightClick()
     Simulate right clicking the mouse in this element.
public  PagerightClick(boolean shiftKey, boolean ctrlKey, boolean altKey)
     Simulate right clicking the mouse in this element.
final public  voidsetAttribute(String attributeName, String attributeValue)
     Set the value of the attribute specified by name.
final public  voidsetAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
     Set the value of the attribute specified by namespace and qualified name.
final public  voidsetAttributeValue(String attributeName, String attributeValue)
     Set the value of the specified attribute.
public  voidsetAttributeValue(String namespaceURI, String qualifiedName, String attributeValue)
     Set the value of the specified attribute.
final public  voidsetEventHandler(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  voidsetEventHandler(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  voidsetId(String newId)
     Set the identifier this element.
public  StringtoString()
    
public  voidtype(String text)
     Simulates typing the specified text while this element has focus.
public  voidtype(String text, boolean shiftKey, boolean ctrlKey, boolean altKey)
     Simulates typing the specified text while this element has focus.
public  Pagetype(char c)
     Simulates typing the specified character while this element has focus.
public  Pagetype(char c, boolean shiftKey, boolean ctrlKey, boolean altKey)
     Simulates typing the specified character while this element has focus.

Field Detail
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()




Constructor Detail
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.




Method Detail
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



addHtmlAttributeChangeListener
public void addHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)(Code)
Adds an HtmlAttributeChangeListener to the listener list. The listener is registered for all attributes of this HtmlElement, as well as descendant elements.
Parameters:
  listener - the attribute change listener to be added.
See Also:   HtmlElement.removeHtmlAttributeChangeListener(HtmlAttributeChangeListener)



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.



cloneDomNode
public DomNode cloneDomNode(boolean deep)(Code)
Overrides DomNode.cloneDomNode(boolean) so clone gets its own Map of attributes.



cloneNode
public DomNode cloneNode(boolean deep)(Code)
Overrides DomNode.cloneNode(boolean) so clone gets its own Map of attributes. HtmlElement.cloneDomNode(boolean)



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(String eventType)(Code)
Shortcut for HtmlElement.fireEvent(Event) .
Parameters:
  eventType - the event type (like "load", "click") the execution result. null if nothing is executed.



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.



getAttribute
final public String getAttribute(String attributeName)(Code)
Return the value of the attribute specified by name or an empty string. If the result is an empty string then it will be either HtmlElement.ATTRIBUTE_NOT_DEFINED if the attribute wasn't specified or HtmlElement.ATTRIBUTE_VALUE_EMPTY if the attribute was specified but it was empty.
Parameters:
  attributeName - the name of the attribute The value of the attribute or HtmlElement.ATTRIBUTE_NOT_DEFINEDor HtmlElement.ATTRIBUTE_VALUE_EMPTY



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.



getAttributeNS
final public String getAttributeNS(String namespaceURI, String localName)(Code)
Return the value of the attribute specified by namespace and local name or an empty string. If the result is an empty string then it will be either HtmlElement.ATTRIBUTE_NOT_DEFINED if the attribute wasn't specified or HtmlElement.ATTRIBUTE_VALUE_EMPTY if the attribute was specified but it was empty.
Parameters:
  namespaceURI - the URI that identifies an XML namespace.
Parameters:
  localName - The name within the namespace. The value of the attribute or HtmlElement.ATTRIBUTE_NOT_DEFINEDor HtmlElement.ATTRIBUTE_VALUE_EMPTY



getAttributeValue
final public String getAttributeValue(String attributeName)(Code)
Return the value of the specified attribute or an empty string. If the result is an empty string then it will be either HtmlElement.ATTRIBUTE_NOT_DEFINED if the attribute wasn't specified or HtmlElement.ATTRIBUTE_VALUE_EMPTY if the attribute was specified but it was empty.
Parameters:
  attributeName - the name of the attribute The value of the attribute or HtmlElement.ATTRIBUTE_NOT_DEFINEDor HtmlElement.ATTRIBUTE_VALUE_EMPTY



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



getEnclosingFormOrDie
public HtmlForm getEnclosingFormOrDie() throws IllegalStateException(Code)
Return the form that enclosed this element or throw an exception if this element is not within a form. See above
throws:
  IllegalStateException - If the element is not within a form.



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.



getNodeName
public String getNodeName()(Code)
The same value as returned by HtmlElement.getTagName(),



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.



removeHtmlAttributeChangeListener
public void removeHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)(Code)
Removes an HtmlAttributeChangeListener from the listener list. This method should be used to remove HtmlAttributeChangeListener that were registered for all attributes of this HtmlElement, as well as descendant elements.
Parameters:
  listener - the attribute change listener to be removed.
See Also:   HtmlElement.addHtmlAttributeChangeListener(HtmlAttributeChangeListener)



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.DomNamespaceNode
public String getLocalName()(Code)(Java Doc)
public String getNamespaceURI()(Code)(Java Doc)
public String getPrefix()(Code)(Java Doc)
public String getQualifiedName()(Code)(Java Doc)
public void setPrefix(String prefix)(Code)(Java Doc)

Fields inherited from com.gargoylesoftware.htmlunit.html.DomNode
final public static short ATTRIBUTE_NODE(Code)(Java Doc)
final public static short COMMENT_NODE(Code)(Java Doc)
final public static short DOCUMENT_NODE(Code)(Java Doc)
final public static short ELEMENT_NODE(Code)(Java Doc)
final public static String PROPERTY_ELEMENT(Code)(Java Doc)
final public static String READY_STATE_COMPLETE(Code)(Java Doc)
final public static String READY_STATE_INTERACTIVE(Code)(Java Doc)
final public static String READY_STATE_LOADED(Code)(Java Doc)
final public static String READY_STATE_LOADING(Code)(Java Doc)
final public static String READY_STATE_UNINITIALIZED(Code)(Java Doc)
final public static short TEXT_NODE(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.