com.gargoylesoftware.htmlunit.html
Class HtmlLabel

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomNamespaceNode
          extended by com.gargoylesoftware.htmlunit.html.DomElement
              extended by com.gargoylesoftware.htmlunit.html.HtmlElement
                  extended by com.gargoylesoftware.htmlunit.html.StyledElement
                      extended by com.gargoylesoftware.htmlunit.html.ClickableElement
                          extended by com.gargoylesoftware.htmlunit.html.HtmlLabel
All Implemented Interfaces:
Serializable, Cloneable

public class HtmlLabel
extends ClickableElement

Wrapper for the html element "label".

Version:
$Revision: 2132 $
Author:
Mike Bowler, David K. Taylor, Christian Sell, Marc Guillemot, Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
HtmlElement.ChildElementsIterator, HtmlElement.MapEntryWrappingIterator
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
static String TAG_NAME
          the HTML tag represented by this element
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY, TAB_INDEX_OUT_OF_BOUNDS
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
HtmlLabel(HtmlPage page, Map attributes)
          Deprecated. You should not directly construct HtmlLabel.
 
Method Summary
 void blur()
          Remove focus from this element.
 Page click()
          Clicks the label and propagates to the referenced element.
 void focus()
          Set the focus to this element.
 String getAccessKeyAttribute()
          Return the value of the attribute "accesskey".
 String getForAttribute()
          Return the value of the attribute "for".
 String getOnBlurAttribute()
          Return the value of the attribute "onblur".
 String getOnFocusAttribute()
          Return the value of the attribute "onfocus".
 ClickableElement getReferencedElement()
          Gets the element referenced by this label.
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.ClickableElement
click, click, dblClick, dblClick, doClickAction, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute, isStateUpdateFirst
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.StyledElement
getClassAttribute, getIdAttribute, getStyleAttribute, getTitleAttribute, isRenderedVisible
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement
addHtmlAttributeChangeListener, appendChildIfNoneExists, assertNotEmpty, cloneDomNode, cloneNode, fireEvent, fireEvent, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, getAttribute, getAttributeEntriesIterator, getAttributeNS, getAttributeValue, getChildElementsIterator, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getEventHandler, getHtmlElementById, getHtmlElementsByAttribute, getHtmlElementsByTagName, getHtmlElementsByTagNames, getId, getNodeName, getNodeType, getOneHtmlElementByAttribute, getTabIndex, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasHtmlElementWithId, isAttributeDefined, isEmptyXmlTagExpanded, isSubmittableByEnter, keyDown, keyDown, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, notImplemented, preventDefault, printOpeningTagContentAsXml, printXml, removeAttribute, removeAttributeNS, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, rightClick, rightClick, setAttribute, setAttributeNS, setAttributeValue, setAttributeValue, setEventHandler, setEventHandler, setId, toString, type, type, type, type
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asText, asXml, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, isAncestorOf, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removePropertyChangeListener, replace, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_NAME

public static final String TAG_NAME
the HTML tag represented by this element

See Also:
Constant Field Values
Constructor Detail

HtmlLabel

public HtmlLabel(HtmlPage page,
                 Map attributes)
Deprecated. You should not directly construct HtmlLabel.

Create an instance of HtmlLabel

Parameters:
page - The HtmlPage that contains this element.
attributes - the initial attributes
Method Detail

getForAttribute

public final String getForAttribute()
Return the value of the attribute "for". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "for" or an empty string if that attribute isn't defined.

getAccessKeyAttribute

public final String getAccessKeyAttribute()
Return the value of the attribute "accesskey". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "accesskey" or an empty string if that attribute isn't defined.

getOnFocusAttribute

public final String getOnFocusAttribute()
Return the value of the attribute "onfocus". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "onfocus" or an empty string if that attribute isn't defined.

getOnBlurAttribute

public final String getOnBlurAttribute()
Return the value of the attribute "onblur". Refer to the HTML 4.01 documentation for details on the use of this attribute.

Returns:
The value of the attribute "onblur" or an empty string if that attribute isn't defined.

blur

public void blur()
Remove focus from this element.

Overrides:
blur in class HtmlElement

focus

public void focus()
Set the focus to this element.

Overrides:
focus in class HtmlElement

getReferencedElement

public ClickableElement getReferencedElement()
Gets the element referenced by this label. That is the element in the page which id is equal to the value of the for attribute of this label.

Returns:
the element, null if not found

click

public Page click()
           throws IOException
Clicks the label and propagates to the referenced element. Simulate clicking this element.

Overrides:
click in class ClickableElement
Returns:
The page that occupies this window after this element is clicked. It may be the same window or it may be a freshly loaded one.
Throws:
IOException - If an IO error occurs


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.