Java Doc for HtmlPage.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.SgmlPage
         com.gargoylesoftware.htmlunit.html.HtmlPage

HtmlPage
final public class HtmlPage extends SgmlPage implements Cloneable(Code)
A representation of an HTML page returned from a server. This class is the DOM Document implementation.
version:
   $Revision: 2155 $
author:
   Mike Bowler
author:
   Alex Nikiforoff
author:
   Noboru Sinohara
author:
   David K. Taylor
author:
   Andreas Hangler
author:
   Christian Sell
author:
   Chris Erskine
author:
   Marc Guillemot
author:
   Ahmed Ashour



Constructor Summary
public  HtmlPage(URL originatingUrl, WebResponse webResponse, WebWindow webWindow)
    

Method Summary
public  voidaddHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)
     Adds an HtmlAttributeChangeListener to the listener list.
 voidaddMappedElement(HtmlElement element)
     Adds an element to the ID and name maps, if necessary.
 voidaddMappedElement(HtmlElement element, boolean recurse)
     Adds an element to the ID and name maps, if necessary.
public  StringasXml()
    
public  voidassertAllAccessKeyAttributesUnique()
     Many html components can have an "accesskey" attribute which defines a hot key for keyboard navigation.
public  voidassertAllIdAttributesUnique()
     Each html element can have an id attribute and by definition, all ids must be unique within the document.
public  voidassertAllTabIndexAttributesSet()
     Many html elements are "tabbable" and can have a "tabindex" attribute that determines the order in which the components are navigated when pressing the tab key.
public  voidcleanUp()
     Clean up this page.
protected  Objectclone()
     Creates a clone of this instance, and clears cached state to be not shared with the original.
public  DomNodecloneNode(boolean deep)
     Override cloneNode to add cloned elements to the clone, not to the original.
public  HtmlElementcreateElement(String tagName)
     Create a new HTML element with the given tag name.
public  HtmlElementcreateElementNS(String namespaceURI, String qualifiedName)
     Create a new HTML element with the given namespace and qualified name.
public  HtmlElementcreateHtmlElement(String tagName)
     Create a new HTML element with the given tag name.
public  HtmlElementcreateHtmlElementNS(String namespaceURI, String qualifiedName)
     Create a new HtmlElement with the given namespace and qualified name.
public  voidderegisterFramesIfNeeded()
     Deregister frames that are no longer in use.
public  ScriptResultexecuteJavaScript(String sourceCode)
     Execute the specified javascript within the page. The usage would be similar to what can be achieved to execute javascript in the current page by entering a "javascript:...some js code..." in the url field of a "normal" browser.

Note: the provided code won't be executed if JavaScript has been disabled on the WebClient (see WebClient.isJavaScriptEnabled .
Parameters:
  sourceCode - The javascript code to execute.

public  ScriptResultexecuteJavaScriptFunctionIfPossible(Function function, Scriptable thisObject, Object[] args, DomNode htmlElementScope)
     INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Execute a Function in the given context.
Parameters:
  function - The javascript Function to call.
Parameters:
  thisObject - The "this" object to be used during invocation.
Parameters:
  args - The arguments to pass into the call.
Parameters:
  htmlElementScope - The html element for which this script is being executed.This element will be the context during the javascript execution.
public  ScriptResultexecuteJavaScriptIfPossible(String sourceCode, String sourceName, HtmlElement htmlElement)
    

Execute the specified javascript if a javascript engine was successfully instantiated.

public  ScriptResultexecuteJavaScriptIfPossible(String sourceCode, String sourceName, int startLine)
     INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Execute the specified javascript if a javascript engine was successfully instantiated.

 voidfireHtmlAttributeAdded(HtmlAttributeChangeEvent event)
     Notifies all registered listeners for the given event to add an attribute.
 voidfireHtmlAttributeRemoved(HtmlAttributeChangeEvent event)
     Notifies all registered listeners for the given event to remove an attribute.
 voidfireHtmlAttributeReplaced(HtmlAttributeChangeEvent event)
     Notifies all registered listeners for the given event to replace an attribute.
public  HtmlAnchorgetAnchorByHref(String href)
    
public  HtmlAnchorgetAnchorByName(String name)
    
public  ListgetAnchors()
     Return a list of all anchors contained in this page.
public  HtmlElementgetDocumentElement()
     Get the root element of this document.
public  HtmlElementgetDocumentHtmlElement()
     Get the root HtmlElement of this document.
public  HtmlElementgetElementWithFocus()
     Return the element with the focus or null if no element has the focus.
public  HtmlAnchorgetFirstAnchorByText(String text)
     Return the first anchor that contains the specified text.
public  HtmlFormgetFormByName(String name)
    
public  ListgetForms()
     Return a list of all the forms in the page.
public  FrameWindowgetFrameByName(String name)
     Returns the first frame contained in this page with the specified name.
public  ListgetFrames()
     Return a list containing all the frames (from frame and iframe tags) in this page.
public  URLgetFullyQualifiedUrl(String relativeUrl)
    
public  HtmlElementgetHtmlElementByAccessKey(char accessKey)
     Returns the HTML element that is assigned to the specified access key.
public  HtmlElementgetHtmlElementById(String id)
     Returns the HTML element with the specified ID.
public  ListgetHtmlElementsByAccessKey(char accessKey)
     Returns all the HTML elements that are assigned to the specified access key.
public  ListgetHtmlElementsByIdAndOrName(String idAndOrName)
     Returns the HTML elements with the specified string for their name or ID.
public  ListgetHtmlElementsByName(String name)
     Returns the HTML elements with the specified name attribute.
protected  LoggetJsLog()
     Return the log object for this element.
protected  ListgetMetaTags(String httpEquiv)
     Gets the meta tag for a given http-equiv value.
public  HtmlPagegetPage()
    
public  StringgetPageEncoding()
     Return the charset used in the page.
public  StringgetResolvedTarget(String elementTarget)
     Given a target attribute value, resolve the target using a base target for the page.
Parameters:
  elementTarget - The target specified as an attribute of the element.
public  ListgetTabbableElementIds()
     Return a list of ids (strings) that correspond to the tabbable elements in this page.
public  ListgetTabbableElements()
     Returns a list of all elements that are tabbable in the order that will be used for tabbing.

The rules for determining tab order are as follows:

  1. Those elements that support the tabindex attribute and assign a positive value to it are navigated first.
public  StringgetTitleText()
     Return the title of this page or an empty string if the title wasn't specified.
public  voidinitialize()
     Initialize this page.
public static  booleanisJavaScript(String typeAttribute, String languageAttribute)
     INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return true if a script with the specified type and language attributes is actually JavaScript. According to W3C recommendation are content types case insensitive.
Parameters:
  typeAttribute - The type attribute specified in the script tag.
Parameters:
  languageAttribute - The language attribute specified in the script tag.
public  booleanisOnbeforeunloadAccepted()
    
 voidloadExternalJavaScriptFile(String srcAttribute, String charset)
    
 voidloadFrames()
     Loads the content of the contained frames.
public  booleanmoveFocusToElement(HtmlElement newElement)
     Move the focus to the specified component.
 voidnotifyNodeAdded(DomNode node)
    
 voidnotifyNodeRemoved(DomNode node)
    
public  HtmlElementpressAccessKey(char accessKey)
     Simulate pressing an access key.
public  voidremoveHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)
     Removes an HtmlAttributeChangeListener from the listener list.
 voidremoveMappedElement(HtmlElement element)
     Removes an element from the ID and name maps, if necessary.
 voidremoveMappedElement(HtmlElement element, boolean recurse, boolean descendant)
     Removes an element and optionally its children from the ID and name maps, if necessary.
 voidsetCheckedRadioButton(HtmlRadioButtonInput radioButtonInput)
     Select the specified radio button in the page (outside any <form>).
public  voidsetTitleText(String message)
     Set the text for the title of this page.
public  HtmlElementtabToNextElement()
     Move the focus to the next element in the tab order.
public  HtmlElementtabToPreviousElement()
     Move the focus to the previous element in the tab order.
public  StringtoString()
    


Constructor Detail
HtmlPage
public HtmlPage(URL originatingUrl, WebResponse webResponse, WebWindow webWindow)(Code)
Create an instance of HtmlPage
Parameters:
  originatingUrl - The url that was used to load this page.
Parameters:
  webResponse - The web response that was used to create this page
Parameters:
  webWindow - The window that this page is being loaded into.




Method Detail
addHtmlAttributeChangeListener
public void addHtmlAttributeChangeListener(HtmlAttributeChangeListener listener)(Code)
Adds an HtmlAttributeChangeListener to the listener list. The listener is registered for all attributes of all HtmlElements contained in this page.
Parameters:
  listener - the attribute change listener to be added.
See Also:   HtmlPage.removeHtmlAttributeChangeListener(HtmlAttributeChangeListener)



addMappedElement
void addMappedElement(HtmlElement element)(Code)
Adds an element to the ID and name maps, if necessary.
Parameters:
  element - the element to be added to the ID and name maps



addMappedElement
void addMappedElement(HtmlElement element, boolean recurse)(Code)
Adds an element to the ID and name maps, if necessary.
Parameters:
  element - the element to be added to the ID and name maps
Parameters:
  recurse - indicates if children must be added too



asXml
public String asXml()(Code)



assertAllAccessKeyAttributesUnique
public void assertAllAccessKeyAttributesUnique()(Code)
Many html components can have an "accesskey" attribute which defines a hot key for keyboard navigation. Assert that all access keys (mnemonics) in this page are unique. If they aren't then throw an exception as per WebClient.assertionFailed(String)
See Also:   WebAssert.assertAllAccessKeyAttributesUnique(HtmlPage)



assertAllIdAttributesUnique
public void assertAllIdAttributesUnique()(Code)
Each html element can have an id attribute and by definition, all ids must be unique within the document.

Assert that all ids in this page are unique. If they aren't then throw an exception as per WebClient.assertionFailed(String)
See Also:   WebAssert.assertAllIdAttributesUnique(HtmlPage)




assertAllTabIndexAttributesSet
public void assertAllTabIndexAttributesSet()(Code)
Many html elements are "tabbable" and can have a "tabindex" attribute that determines the order in which the components are navigated when pressing the tab key. To ensure good usability for keyboard navigation, all tabbable elements should have the tabindex attribute set.

Assert that all tabbable elements have a valid value set for "tabindex". If they don't then throw an exception as per WebClient.assertionFailed(String)
See Also:   WebAssert.assertAllTabIndexAttributesSet(HtmlPage)




cleanUp
public void cleanUp() throws IOException(Code)
Clean up this page.
throws:
  IOException - If an IO problem occurs.



clone
protected Object clone()(Code)
Creates a clone of this instance, and clears cached state to be not shared with the original. a clone of this instance.



cloneNode
public DomNode cloneNode(boolean deep)(Code)
Override cloneNode to add cloned elements to the clone, not to the original.



createElement
public HtmlElement createElement(String tagName)(Code)
Create a new HTML element with the given tag name.
Parameters:
  tagName - The tag name, preferably in lowercase the new HTML element.



createElementNS
public HtmlElement createElementNS(String namespaceURI, String qualifiedName)(Code)
Create a new HTML element with the given namespace and qualified name.
Parameters:
  namespaceURI - the URI that identifies an XML namespace.
Parameters:
  qualifiedName - The qualified name of the element type to instantiate the new HTML element.



createHtmlElement
public HtmlElement createHtmlElement(String tagName)(Code)
Create a new HTML element with the given tag name.
Parameters:
  tagName - The tag name, preferably in lowercase the new HTML element.



createHtmlElementNS
public HtmlElement createHtmlElementNS(String namespaceURI, String qualifiedName)(Code)
Create a new HtmlElement with the given namespace and qualified name.
Parameters:
  namespaceURI - the URI that identifies an XML namespace.
Parameters:
  qualifiedName - The qualified name of the element type to instantiate the new HTML element.



deregisterFramesIfNeeded
public void deregisterFramesIfNeeded()(Code)
Deregister frames that are no longer in use.



executeJavaScript
public ScriptResult executeJavaScript(String sourceCode)(Code)
Execute the specified javascript within the page. The usage would be similar to what can be achieved to execute javascript in the current page by entering a "javascript:...some js code..." in the url field of a "normal" browser.

Note: the provided code won't be executed if JavaScript has been disabled on the WebClient (see WebClient.isJavaScriptEnabled .
Parameters:
  sourceCode - The javascript code to execute. A ScriptResult which will contain both the current page (which may be different thanthe previous page) and a javascript result object.




executeJavaScriptFunctionIfPossible
public ScriptResult executeJavaScriptFunctionIfPossible(Function function, Scriptable thisObject, Object[] args, DomNode htmlElementScope)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Execute a Function in the given context.
Parameters:
  function - The javascript Function to call.
Parameters:
  thisObject - The "this" object to be used during invocation.
Parameters:
  args - The arguments to pass into the call.
Parameters:
  htmlElementScope - The html element for which this script is being executed.This element will be the context during the javascript execution. If null,the context will default to the page. A ScriptResult which will contain both the current page (which may be different thanthe previous page and a javascript result object.



executeJavaScriptIfPossible
public ScriptResult executeJavaScriptIfPossible(String sourceCode, String sourceName, HtmlElement htmlElement)(Code)

Execute the specified javascript if a javascript engine was successfully instantiated. If this javascript causes the current page to be reloaded (through location="" or form.submit()) then return the new page. Otherwise return the current page.

Please note: Although this method is public, it is not intended for general execution of javascript. Users of HtmlUnit should interact with the pages as a user would by clicking on buttons or links and having the javascript event handlers execute as needed..


Parameters:
  sourceCode - The javascript code to execute.
Parameters:
  sourceName - The name for this chunk of code. This name will be displayedin any error messages.
Parameters:
  htmlElement - The html element for which this script is being executed.This element will be the context during the javascript execution. If null,the context will default to the window. A ScriptResult which will contain both the current page (which may be different thanthe previous page and a javascript result object.HtmlPage.executeJavaScript(String)



executeJavaScriptIfPossible
public ScriptResult executeJavaScriptIfPossible(String sourceCode, String sourceName, int startLine)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Execute the specified javascript if a javascript engine was successfully instantiated. If this javascript causes the current page to be reloaded (through location="" or form.submit()) then return the new page. Otherwise return the current page.

Please note: Although this method is public, it is not intended for general execution of javascript. Users of HtmlUnit should interact with the pages as a user would by clicking on buttons or links and having the javascript event handlers execute as needed..


Parameters:
  sourceCode - The javascript code to execute.
Parameters:
  sourceName - The name for this chunk of code. This name will be displayedin any error messages.
Parameters:
  startLine - the line at which the script source starts A ScriptResult which will contain both the current page (which may be different thanthe previous page and a javascript result object.



fireHtmlAttributeAdded
void fireHtmlAttributeAdded(HtmlAttributeChangeEvent event)(Code)
Notifies all registered listeners for the given event to add an attribute.
Parameters:
  event - the event to fire



fireHtmlAttributeRemoved
void fireHtmlAttributeRemoved(HtmlAttributeChangeEvent event)(Code)
Notifies all registered listeners for the given event to remove an attribute.
Parameters:
  event - the event to fire



fireHtmlAttributeReplaced
void fireHtmlAttributeReplaced(HtmlAttributeChangeEvent event)(Code)
Notifies all registered listeners for the given event to replace an attribute.
Parameters:
  event - the event to fire



getAnchorByHref
public HtmlAnchor getAnchorByHref(String href) throws ElementNotFoundException(Code)
Return the HtmlAnchor with the specified href
Parameters:
  href - The string to search by The HtmlAnchor
throws:
  ElementNotFoundException - If the anchor could not be found.



getAnchorByName
public HtmlAnchor getAnchorByName(String name) throws ElementNotFoundException(Code)
Return the HtmlAnchor with the specified name
Parameters:
  name - The name to search by See above
throws:
  ElementNotFoundException - If the anchor could not be found.



getAnchors
public List getAnchors()(Code)
Return a list of all anchors contained in this page. the list of HtmlAnchor in this page.



getDocumentElement
public HtmlElement getDocumentElement()(Code)
Get the root element of this document. The root element



getDocumentHtmlElement
public HtmlElement getDocumentHtmlElement()(Code)
Get the root HtmlElement of this document. The root element



getElementWithFocus
public HtmlElement getElementWithFocus()(Code)
Return the element with the focus or null if no element has the focus. The element with focus or null.
See Also:   HtmlPage.moveFocusToElement(HtmlElement)



getFirstAnchorByText
public HtmlAnchor getFirstAnchorByText(String text) throws ElementNotFoundException(Code)
Return the first anchor that contains the specified text.
Parameters:
  text - The text to search for The first anchor that was found.
throws:
  ElementNotFoundException - If no anchors are found with the specified text



getFormByName
public HtmlForm getFormByName(String name) throws ElementNotFoundException(Code)
Return the first form that matches the specified name
Parameters:
  name - The name to search for The first form.
exception:
  ElementNotFoundException - If no forms match the specified result.



getForms
public List getForms()(Code)
Return a list of all the forms in the page. All the forms.



getFrameByName
public FrameWindow getFrameByName(String name) throws ElementNotFoundException(Code)
Returns the first frame contained in this page with the specified name.
Parameters:
  name - The name to search for The first frame found.
exception:
  ElementNotFoundException - If no frame exist in this page with the specified name.



getFrames
public List getFrames()(Code)
Return a list containing all the frames (from frame and iframe tags) in this page. a list of FrameWindow



getFullyQualifiedUrl
public URL getFullyQualifiedUrl(String relativeUrl) throws MalformedURLException(Code)
Given a relative url (ie /foo), return a fully qualified url based on the url that was used to load this page
Parameters:
  relativeUrl - The relative url See above
exception:
  MalformedURLException - If an error occurred when creating a URL object



getHtmlElementByAccessKey
public HtmlElement getHtmlElementByAccessKey(char accessKey)(Code)
Returns the HTML element that is assigned to the specified access key. An access key (aka mnemonic key) is used for keyboard navigation of the page.

Only the following HTML elements may have accesskeys defined: A, AREA, BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA.
Parameters:
  accessKey - The key to look for The HTML element that is assigned to the specified key or nullif no elements can be found that match the specified key.




getHtmlElementById
public HtmlElement getHtmlElementById(String id) throws ElementNotFoundException(Code)
Returns the HTML element with the specified ID. If more than one element has this ID (not allowed by the HTML spec), then this method returns the first one.
Parameters:
  id - the ID value to search by the HTML element with the specified ID
throws:
  ElementNotFoundException - if no element was found that matches the id



getHtmlElementsByAccessKey
public List getHtmlElementsByAccessKey(char accessKey)(Code)
Returns all the HTML elements that are assigned to the specified access key. An access key (aka mnemonic key) is used for keyboard navigation of the page.

The HTML specification seems to indicate that one accesskey cannot be used for multiple elements however Internet Explorer does seem to support this. It's worth noting that Mozilla does not support multiple elements with one access key so you are making your html browser specific if you rely on this feature.

Only the following html elements may have accesskeys defined: A, AREA, BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA.
Parameters:
  accessKey - The key to look for A list of HTML elements that are assigned to the specified accesskey.




getHtmlElementsByIdAndOrName
public List getHtmlElementsByIdAndOrName(String idAndOrName)(Code)
Returns the HTML elements with the specified string for their name or ID. If there are no elements with the specified name or ID, this method returns an empty list. Please note that lists returned by this method are immutable.
Parameters:
  idAndOrName - the value to search for the HTML elements with the specified string for their name or ID



getHtmlElementsByName
public List getHtmlElementsByName(String name)(Code)
Returns the HTML elements with the specified name attribute. If there are no elements with the specified name, this method returns an empty list. Please note that the lists returned by this method are immutable.
Parameters:
  name - the name value to search by the HTML elements with the specified name attribute



getJsLog
protected Log getJsLog()(Code)
Return the log object for this element. The log object for this element.



getMetaTags
protected List getMetaTags(String httpEquiv)(Code)
Gets the meta tag for a given http-equiv value.
Parameters:
  httpEquiv - the http-equiv value a list of HtmlMeta



getPage
public HtmlPage getPage()(Code)
this page



getPageEncoding
public String getPageEncoding()(Code)
Return the charset used in the page. The sources of this information are from 1).meta element which http-equiv attribute value is 'content-type', or if not from the response header. the value of charset.



getResolvedTarget
public String getResolvedTarget(String elementTarget)(Code)
Given a target attribute value, resolve the target using a base target for the page.
Parameters:
  elementTarget - The target specified as an attribute of the element. The resolved target to use for the element.



getTabbableElementIds
public List getTabbableElementIds()(Code)
Return a list of ids (strings) that correspond to the tabbable elements in this page. Return them in the same order specified in HtmlPage.getTabbableElements The list of id's



getTabbableElements
public List getTabbableElements()(Code)
Returns a list of all elements that are tabbable in the order that will be used for tabbing.

The rules for determining tab order are as follows:

  1. Those elements that support the tabindex attribute and assign a positive value to it are navigated first. Navigation proceeds from the element with the lowest tabindex value to the element with the highest value. Values need not be sequential nor must they begin with any particular value. Elements that have identical tabindex values should be navigated in the order they appear in the character stream.
  2. Those elements that do not support the tabindex attribute or support it and assign it a value of "0" are navigated next. These elements are navigated in the order they appear in the character stream.
  3. Elements that are disabled do not participate in the tabbing order.
Additionally, the value of tabindex must be within 0 and 32767. Any values outside this range will be ignored.

The following elements support the tabindex attribute: A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA.

A list containing all the tabbable elements in proper tab order.




getTitleText
public String getTitleText()(Code)
Return the title of this page or an empty string if the title wasn't specified. the title of this page or an empty string if the title wasn't specified.



initialize
public void initialize() throws IOException, FailingHttpStatusCodeException(Code)
Initialize this page.
throws:
  IOException - If an IO problem occurs.
throws:
  FailingHttpStatusCodeException - If the server returns a failing status code AND the propertyWebClient.setThrowExceptionOnFailingStatusCode(boolean) is set to true.



isJavaScript
public static boolean isJavaScript(String typeAttribute, String languageAttribute)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return true if a script with the specified type and language attributes is actually JavaScript. According to W3C recommendation are content types case insensitive.
Parameters:
  typeAttribute - The type attribute specified in the script tag.
Parameters:
  languageAttribute - The language attribute specified in the script tag. true if the script is javascript



isOnbeforeunloadAccepted
public boolean isOnbeforeunloadAccepted()(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
true if the OnbeforeunloadHandler has accepted to change the page.



loadExternalJavaScriptFile
void loadExternalJavaScriptFile(String srcAttribute, String charset)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Parameters:
  srcAttribute - The source attribute from the script tag.
Parameters:
  charset - The charset attribute from the script tag.



loadFrames
void loadFrames() throws FailingHttpStatusCodeException(Code)
Loads the content of the contained frames. This is done after the page is completely loaded to allow script contained in the frames to reference elements from the page located after the closing tag.
throws:
  FailingHttpStatusCodeException - If the server returns a failing status code AND the propertyWebClient.setThrowExceptionOnFailingStatusCode(boolean) is set to true.



moveFocusToElement
public boolean moveFocusToElement(HtmlElement newElement)(Code)
Move the focus to the specified component. This will trigger any relevant javascript event handlers.
Parameters:
  newElement - The element that will receive the focus, use null to remove focus from any element true if the specified element now has the focus.
See Also:   HtmlPage.getElementWithFocus()
See Also:   HtmlPage.tabToNextElement()
See Also:   HtmlPage.tabToPreviousElement()
See Also:   HtmlPage.pressAccessKey(char)
See Also:   HtmlPage.assertAllTabIndexAttributesSet()



notifyNodeAdded
void notifyNodeAdded(DomNode node)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Parameters:
  node - the node that has just been added to the document.



notifyNodeRemoved
void notifyNodeRemoved(DomNode node)(Code)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Parameters:
  node - the node that has just been removed from the tree



pressAccessKey
public HtmlElement pressAccessKey(char accessKey) throws IOException(Code)
Simulate pressing an access key. This may change the focus, may click buttons and may invoke javascript.
Parameters:
  accessKey - The key that will be pressed. The element that has the focus after pressing this access key or null if no elementhas the focus.
throws:
  IOException - If an io error occurs during the processing of this access key. Thiswould only happen if the access key triggered a button which in turn caused a page load.



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 all HtmlElements contained in this page.
Parameters:
  listener - the attribute change listener to be removed.
See Also:   HtmlPage.addHtmlAttributeChangeListener(HtmlAttributeChangeListener)



removeMappedElement
void removeMappedElement(HtmlElement element)(Code)
Removes an element from the ID and name maps, if necessary.
Parameters:
  element - the element to be removed from the ID and name maps



removeMappedElement
void removeMappedElement(HtmlElement element, boolean recurse, boolean descendant)(Code)
Removes an element and optionally its children from the ID and name maps, if necessary.
Parameters:
  element - the element to be removed from the ID and name maps
Parameters:
  recurse - indicates if children must be removed too
Parameters:
  descendant - indicates of the element was descendant of this HtmlPage, but now its parent might be null.



setCheckedRadioButton
void setCheckedRadioButton(HtmlRadioButtonInput radioButtonInput)(Code)
Select the specified radio button in the page (outside any <form>).
Parameters:
  radioButtonInput - The radio Button



setTitleText
public void setTitleText(String message)(Code)
Set the text for the title of this page. If there is not a title element on this page, then one has to be generated.
Parameters:
  message - The new text



tabToNextElement
public HtmlElement tabToNextElement()(Code)
Move the focus to the next element in the tab order. To determine the specified tab order, refer to HtmlPage.getTabbableElements The element that has focus after calling this method.



tabToPreviousElement
public HtmlElement tabToPreviousElement()(Code)
Move the focus to the previous element in the tab order. To determine the specified tab order, refer to HtmlPage.getTabbableElements The element that has focus after calling this method.



toString
public String toString()(Code)
Gives a basic representation for debugging purposes a basic representation



Methods inherited from com.gargoylesoftware.htmlunit.SgmlPage
public void cleanUp() throws IOException(Code)(Java Doc)
public DomDocumentFragment createDomDocumentFragment()(Code)(Java Doc)
public WebWindow getEnclosingWindow()(Code)(Java Doc)
public Page getNativePage()(Code)(Java Doc)
public String getNodeName()(Code)(Java Doc)
public short getNodeType()(Code)(Java Doc)
public WebClient getWebClient()(Code)(Java Doc)
public WebResponse getWebResponse()(Code)(Java Doc)
public void initialize() throws IOException(Code)(Java Doc)
public void setEnclosingWindow(WebWindow window)(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.