jaxcent
Class JaxcentHtmlElement

java.lang.Object
  extended byjaxcent.JaxcentObject
      extended byjaxcent.JaxcentHtmlElement
Direct Known Subclasses:
HtmlAnchor, HtmlArea, HtmlBody, HtmlBold, HtmlButton, HtmlDiv, HtmlElement, HtmlForm, HtmlImage, HtmlInputButton, HtmlInputCheckbox, HtmlInputHidden, HtmlInputPassword, HtmlInputRadio, HtmlInputReset, HtmlInputSubmit, HtmlInputText, HtmlItalic, HtmlListElement, HtmlNumberedList, HtmlOption, HtmlPara, HtmlRule, HtmlSelect, HtmlTable, HtmlTableCell, HtmlTableRow, HtmlTextArea, HtmlUnnumberedList

public class JaxcentHtmlElement
extends JaxcentObject

This is the base class in Jaxcent for all HTML elements. It provides basic features common to all HTML elements.


Constructor Summary
JaxcentHtmlElement(JaxcentPage page, SearchType searchType, java.lang.String str)
          Search for HTML element on page by specified search type and search string.
JaxcentHtmlElement(JaxcentPage page, SearchType searchType, java.lang.String str, int index)
          Search for HTML Element on page by specified search type and search string, and search index.
JaxcentHtmlElement(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String text)
          Create new HTML Element on page using the specified tag.
JaxcentHtmlElement(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String[] attributes, java.lang.String[] values)
          Create new HTML element on page using the specified attributes and values.
JaxcentHtmlElement(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String text, java.lang.String[] attributes, java.lang.String[] values)
          Create new HTML element on page using the specified text and attributes and values.
JaxcentHtmlElement(JaxcentPage page, java.lang.String id)
          Search for HTML element on page by specified ID
 
Method Summary
 java.lang.String getAttribute(java.lang.String attrName)
          Retrieve the specified attribute.
 java.lang.String getID()
          Returns the ID of the HTML element if specified, or null;
 java.lang.String getInnerText()
          Returns the inner text of the element.
 java.lang.String getStyle(java.lang.String styleName)
          Retrieve the specified style element.
 java.lang.String getTag()
          Returns the tag of the HTML element.
 void hide()
          Shortcut for setStyle( "display", "none" );
 void insertAfter(JaxcentHtmlElement targetElement)
          Insert element just after target element.
 void insertAtBeginning()
          Insert element at document beginning.
 void insertAtBeginning(JaxcentHtmlElement targetElement)
          Insert element inside target element, at beginning.
 void insertAtEnd()
          Insert element at document end.
 void insertAtEnd(JaxcentHtmlElement targetElement)
          Insert element inside target element, at end.
 void insertBefore(JaxcentHtmlElement targetElement)
          Insert element just before target element.
 void setAttribute(java.lang.String attrName, java.lang.String value)
          Set the specified attribute.
 void setInnerText(java.lang.String text)
          Sets the inner text of the element.
 void setStyle(java.lang.String styleName, boolean value)
          Set the specified boolean style element.
 void setStyle(java.lang.String styleName, java.awt.Color value)
          Set the specified style element from a java.awt.Color value.
 void setStyle(java.lang.String styleName, int value)
          Set the specified style element from an int.
 void setStyle(java.lang.String styleName, java.lang.String value)
          Set the specified style element.
 void setVisible(boolean visible)
          Shortcut for setStyle( "visibility", "visible" or "hidden" );
 void show()
          Shortcut for setStyle( "display", "block" );
 
Methods inherited from class jaxcent.JaxcentObject
addJavaScriptVerification, getId, getProperty, setId, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          java.lang.String id)
Search for HTML element on page by specified ID


JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          SearchType searchType,
                          java.lang.String str)
Search for HTML element on page by specified search type and search string. If the search returns multiple objects, use the first one. searchType can be createNew, in which case the string parameter is the tag instead. The surrounding less than and greater than characters must not be a part of the tag.


JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          SearchType searchType,
                          java.lang.String str,
                          int index)
Search for HTML Element on page by specified search type and search string, and search index. The search is expected to return multiple results. The search index is 0-based, and specifies the index in the multiple results. This constructor is not for use with createNew.


JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          SearchType searchType,
                          java.lang.String tag,
                          java.lang.String text)
                   throws Jaxception
Create new HTML Element on page using the specified tag. Search type must be createNew. If text is non null, the new element is populated with that text.


JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          SearchType searchType,
                          java.lang.String tag,
                          java.lang.String[] attributes,
                          java.lang.String[] values)
                   throws Jaxception
Create new HTML element on page using the specified attributes and values. Search type must be createNew. Attributes and values arrays must have the same length.


JaxcentHtmlElement

public JaxcentHtmlElement(JaxcentPage page,
                          SearchType searchType,
                          java.lang.String tag,
                          java.lang.String text,
                          java.lang.String[] attributes,
                          java.lang.String[] values)
                   throws Jaxception
Create new HTML element on page using the specified text and attributes and values. Search type must be createNew. Attributes and values arrays must have the same length.

Method Detail

hide

public void hide()
          throws Jaxception
Shortcut for setStyle( "display", "none" );

Throws:
Jaxception

show

public void show()
          throws Jaxception
Shortcut for setStyle( "display", "block" );

Throws:
Jaxception

setVisible

public void setVisible(boolean visible)
                throws Jaxception
Shortcut for setStyle( "visibility", "visible" or "hidden" );

Throws:
Jaxception

setAttribute

public void setAttribute(java.lang.String attrName,
                         java.lang.String value)
                  throws Jaxception
Set the specified attribute.

Throws:
Jaxception

getAttribute

public java.lang.String getAttribute(java.lang.String attrName)
                              throws Jaxception
Retrieve the specified attribute.

Throws:
Jaxception

setStyle

public void setStyle(java.lang.String styleName,
                     java.lang.String value)
              throws Jaxception
Set the specified style element.

Throws:
Jaxception

setStyle

public void setStyle(java.lang.String styleName,
                     int value)
              throws Jaxception
Set the specified style element from an int.

Throws:
Jaxception

setStyle

public void setStyle(java.lang.String styleName,
                     java.awt.Color value)
              throws Jaxception
Set the specified style element from a java.awt.Color value.

Throws:
Jaxception

setStyle

public void setStyle(java.lang.String styleName,
                     boolean value)
              throws Jaxception
Set the specified boolean style element.

Throws:
Jaxception

getStyle

public java.lang.String getStyle(java.lang.String styleName)
                          throws Jaxception
Retrieve the specified style element.

Throws:
Jaxception

getTag

public java.lang.String getTag()
                        throws Jaxception
Returns the tag of the HTML element. For instance "P" for para, "IMG" for images, "TABLE" for tables, "TD" for table cells, etc.

Throws:
Jaxception

getID

public java.lang.String getID()
                       throws Jaxception
Returns the ID of the HTML element if specified, or null;

Throws:
Jaxception

getInnerText

public java.lang.String getInnerText()
                              throws Jaxception
Returns the inner text of the element.

Throws:
Jaxception

setInnerText

public void setInnerText(java.lang.String text)
                  throws Jaxception
Sets the inner text of the element.

Throws:
Jaxception

insertAtBeginning

public void insertAtBeginning()
                       throws Jaxception
Insert element at document beginning. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception

insertAtEnd

public void insertAtEnd()
                 throws Jaxception
Insert element at document end. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception

insertBefore

public void insertBefore(JaxcentHtmlElement targetElement)
                  throws Jaxception
Insert element just before target element. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception

insertAfter

public void insertAfter(JaxcentHtmlElement targetElement)
                 throws Jaxception
Insert element just after target element. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception

insertAtBeginning

public void insertAtBeginning(JaxcentHtmlElement targetElement)
                       throws Jaxception
Insert element inside target element, at beginning. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception

insertAtEnd

public void insertAtEnd(JaxcentHtmlElement targetElement)
                 throws Jaxception
Insert element inside target element, at end. This element could have been constructed using createNew, or be an existing element.

Throws:
Jaxception