com.pepper.guiutils.browser
Class FormElementManager

java.lang.Object
  extended by com.pepper.guiutils.browser.FormElementManager

public class FormElementManager
extends Object

Base class that provides access to org.w3.dom.Elements that represent html form elements in a page


Constructor Summary
FormElementManager(WebBrowserView view)
          Creates a new FormElementManager instance.
 
Method Summary
static String getAttrValue(Node theNode, String theAttrName)
          Get the value of the specified attribute
 Element getElement(String id)
          Find an element by id
 List getElementIds()
          Returns a List of Strings id's of the form elements on the page that have an xpath attribute associated with them..
 HashMap getElementsMap()
          Return a HashMap where key is Element and value is ElementInfo object.
 String getValue(Element node)
          Get the value for a particular Element
 String getValue(String id)
          Get the value of a particular Element named by id
 void init(Document theDoc)
          Initialize the elementsMap from the passed in Document
 void setModified(String id)
          Called by the Bridge to manually mark a particular element as modified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormElementManager

public FormElementManager(WebBrowserView view)
Creates a new FormElementManager instance.

Parameters:
view - a WebBrowserView value
Method Detail

init

public void init(Document theDoc)
Initialize the elementsMap from the passed in Document

Parameters:
theDoc - a Document value

getAttrValue

public static String getAttrValue(Node theNode,
                                  String theAttrName)
Get the value of the specified attribute

Parameters:
theNode - The Node to examine
theAttrName - The attribute to get the value of
Returns:
a String value

setModified

public void setModified(String id)
Called by the Bridge to manually mark a particular element as modified

Parameters:
id - The id of the element
Since:
3.2

getElementsMap

public HashMap getElementsMap()
Return a HashMap where key is Element and value is ElementInfo object. NOTE: callers of this method should synchronize on the returned map to ensure it doesn't get modified from underneath as it is "live" copy of the map.

Returns:
a HashMap value

getValue

public String getValue(Element node)
Get the value for a particular Element

Parameters:
node - a Element value
Returns:
a String value

getValue

public String getValue(String id)
Get the value of a particular Element named by id

Parameters:
id - a String value
Returns:
a String value

getElementIds

public List getElementIds()
Returns a List of Strings id's of the form elements on the page that have an xpath attribute associated with them..

Returns:
a List value

getElement

public Element getElement(String id)
Find an element by id

Parameters:
id - a String value
Returns:
a Element value


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.