|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.NodeImpl
com.gargoylesoftware.htmlunit.javascript.host.HTMLElement
public class HTMLElement
The javascript object "HTMLElement" which is the base class for all HTML
objects. This will typically wrap an instance of HtmlElement
.
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
HTMLElement()
Create an instance. |
Method Summary | |
---|---|
void |
addComponentRequest(java.lang.String id,
java.lang.String idType,
java.lang.String minVersion)
Adds the specified component to the queue of components to be installed. |
void |
clearComponentRequest()
Clears the component install queue of all component requests. |
int |
compareVersions(java.lang.String v1,
java.lang.String v2)
Compares the two specified version numbers. |
boolean |
doComponentRequest()
Downloads all the components queued via addComponentRequest(String, String, String) . |
int |
getAvailHeight()
Returns the screen's available height. |
int |
getAvailWidth()
Returns the screen's available width. |
int |
getBufferDepth()
Returns the screen's buffer depth. |
int |
getColorDepth()
Returns the screen's color depth. |
java.lang.String |
getComponentVersion(java.lang.String id,
java.lang.String idType)
Returns the version of the specified component. |
java.lang.String |
getConnectionType()
Returns the connection type being used. |
boolean |
getCookieEnabled()
Returns true if cookies are enabled. |
java.lang.String |
getCpuClass()
Returns the type of CPU used. |
int |
getHeight()
Returns the screen's height. |
boolean |
getJavaEnabled()
Returns true if Java is enabled. |
java.lang.String |
getPlatform()
Returns the platform used. |
java.lang.String |
getSystemLanguage()
Returns the system language. |
java.lang.String |
getUserLanguage()
Returns the user language. |
int |
getWidth()
Returns the screen's width. |
java.lang.Object |
getWithFallback(java.lang.String name)
Looks at attributes with the given name Fallback called when no configured property is found with the given name on the Scriptable object. |
boolean |
isComponentInstalled(java.lang.String id,
java.lang.String idType,
java.lang.String minVersion)
Returns true if the specified component is installed. |
boolean |
isHomePage(java.lang.String url)
Returns true if the specified URL is the web client's current homepage and the document calling the method is on the same domain as the user's homepage. |
int |
jsxFunction_addBehavior(java.lang.String behavior)
Adds the specified behavior to this HTML element. |
java.lang.String |
jsxFunction_getAttribute(java.lang.String attributeName)
Gets the specified property. |
java.lang.Object |
jsxFunction_getAttributeNode(java.lang.String attributeName)
Gets the attribute node for the specified attribute. |
TextRectangle |
jsxFunction_getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
java.lang.Object |
jsxFunction_getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. |
java.lang.Object |
jsxFunction_getElementsByTagName(java.lang.String tagName)
Returns all the descendant elements with the specified tag name. |
java.lang.Object |
jsxFunction_insertAdjacentElement(java.lang.String where,
java.lang.Object object)
Inserts the given element into the element at the location. |
void |
jsxFunction_insertAdjacentHTML(java.lang.String where,
java.lang.String text)
Inserts the given HTML text into the element at the location. |
void |
jsxFunction_removeAttribute(java.lang.String name)
Remove an attribute. |
void |
jsxFunction_removeBehavior(int id)
Removes the behavior corresponding to the specified identifier from this element. |
void |
jsxFunction_scrollIntoView()
Implement the scrollIntoView() javascript function but don't actually do anything. |
void |
jsxFunction_setAttribute(java.lang.String name,
java.lang.String value)
Set an attribute. |
Attribute |
jsxFunction_setAttributeNode(Attribute newAtt)
Sets the attribute node for the specified attribute. |
HTMLCollection |
jsxGet_all()
Return the value of the "all" property. |
java.lang.Object |
jsxGet_children()
Get the children of the current node. |
java.lang.Object |
jsxGet_className()
Return the class defined for this element |
java.lang.Object |
jsxGet_currentStyle()
Returns the current style object for this element. |
boolean |
jsxGet_disabled()
Return true if this element is disabled. |
java.lang.String |
jsxGet_id()
Return the element ID. |
java.lang.String |
jsxGet_innerHTML()
Get the innerHTML attribute |
java.lang.String |
jsxGet_innerText()
Get the innerText attribute |
java.lang.String |
jsxGet_localName()
Returns The local name (without prefix). |
java.lang.String |
jsxGet_namespaceURI()
Returns The URI that identifies an XML namespace. |
int |
jsxGet_offsetHeight()
Get the offsetHeight for this element. |
int |
jsxGet_offsetLeft()
Get the offsetLeft for this element. |
java.lang.Object |
jsxGet_offsetParent()
Get the offsetParent for this element |
int |
jsxGet_offsetTop()
Get the offsetTop for this element. |
int |
jsxGet_offsetWidth()
Get the offsetWidth for this element. |
java.lang.Object |
jsxGet_onblur()
Get the onblur event handler for this element. |
java.lang.Object |
jsxGet_onclick()
Get the onclick event handler for this element. |
java.lang.Object |
jsxGet_oncontextmenu()
Get the oncontextmenu event handler for this element. |
java.lang.Object |
jsxGet_ondblclick()
Get the ondblclick event handler for this element. |
java.lang.Object |
jsxGet_onfocus()
Get the onfocus event handler for this element. |
java.lang.Object |
jsxGet_onkeydown()
Get the onkeydown event handler for this element. |
java.lang.Object |
jsxGet_onkeypress()
Get the onkeypress event handler for this element. |
java.lang.Object |
jsxGet_onkeyup()
Get the onkeyup event handler for this element. |
java.lang.Object |
jsxGet_onmousedown()
Get the onmousedown event handler for this element. |
java.lang.Object |
jsxGet_onmousemove()
Get the onmousemove event handler for this element. |
java.lang.Object |
jsxGet_onmouseout()
Get the onmouseout event handler for this element. |
java.lang.Object |
jsxGet_onmouseover()
Get the onmouseover event handler for this element. |
java.lang.Object |
jsxGet_onmouseup()
Get the onmouseup event handler for this element. |
java.lang.Object |
jsxGet_onresize()
Get the onresize event handler for this element. |
java.lang.String |
jsxGet_outerHTML()
Gets the outerHTML of the node. |
java.lang.Object |
jsxGet_ownerDocument()
Return the owner document |
java.lang.Object |
jsxGet_parentElement()
Get the JavaScript property "parentElement". |
java.lang.String |
jsxGet_prefix()
Returns The Namespace prefix |
java.lang.Object |
jsxGet_runtimeStyle()
Returns the runtime style object for this element. |
int |
jsxGet_scrollHeight()
Get the scrollHeight for this element. |
int |
jsxGet_scrollLeft()
Get the scrollLeft for this element. |
int |
jsxGet_scrollTop()
Get the scrollTop for this element. |
int |
jsxGet_scrollWidth()
Get the scrollWidth for this element. |
java.lang.Object |
jsxGet_style()
Return the style object for this element. |
java.lang.String |
jsxGet_tagName()
Return the tag name of this element. |
java.lang.String |
jsxGet_title()
Return the element title. |
void |
jsxSet_className(java.lang.String className)
Set the class attribute for this element. |
void |
jsxSet_disabled(boolean disabled)
Set whether or not to disable this element |
void |
jsxSet_id(java.lang.String newId)
Set the identifier this element. |
void |
jsxSet_innerHTML(java.lang.Object value)
Replace all children elements of this element with the supplied value. |
void |
jsxSet_innerText(java.lang.String value)
Replace all children elements of this element with the supplied value. |
void |
jsxSet_onblur(java.lang.Object handler)
Set the onblur event handler for this element. |
void |
jsxSet_onclick(java.lang.Object handler)
Set the onclick event handler for this element. |
void |
jsxSet_oncontextmenu(java.lang.Object handler)
Set the oncontextmenu event handler for this element. |
void |
jsxSet_ondblclick(java.lang.Object handler)
Set the ondblclick event handler for this element. |
void |
jsxSet_onfocus(java.lang.Object handler)
Set the onfocus event handler for this element. |
void |
jsxSet_onkeydown(java.lang.Object handler)
Set the onkeydown event handler for this element. |
void |
jsxSet_onkeypress(java.lang.Object handler)
Set the onkeypress event handler for this element. |
void |
jsxSet_onkeyup(java.lang.Object handler)
Set the onkeyup event handler for this element. |
void |
jsxSet_onmousedown(java.lang.Object handler)
Set the onmousedown event handler for this element. |
void |
jsxSet_onmousemove(java.lang.Object handler)
Set the onmousemove event handler for this element. |
void |
jsxSet_onmouseout(java.lang.Object handler)
Set the onmouseout event handler for this element. |
void |
jsxSet_onmouseover(java.lang.Object handler)
Set the onmouseover event handler for this element. |
void |
jsxSet_onmouseup(java.lang.Object handler)
Set the onmouseup event handler for this element. |
void |
jsxSet_onresize(java.lang.Object handler)
Set the onresize event handler for this element. |
void |
jsxSet_outerHTML(java.lang.String value)
Replace all children elements of this element with the supplied value. |
void |
jsxSet_scrollLeft(int scroll)
Set the scrollLeft for this element. |
void |
jsxSet_scrollTop(int scroll)
Set the scrollTop for this element. |
void |
jsxSet_title(java.lang.String newTitle)
Set the title of this element. |
void |
navigateHomePage()
Causes the web client to navigate to the current home page. |
void |
setDomNode(DomNode domNode)
Set the DOM node that corresponds to this javascript object |
void |
setHomePage(java.lang.String url)
Sets the web client's current homepage. |
void |
startDownload(java.lang.String uri,
org.mozilla.javascript.Function callback)
Implementation of the IE behavior #default#download |
java.lang.String |
toString()
Just for debug purposes. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.NodeImpl |
---|
executeEvent, fireEvent, getEventHandler, jsxFunction_addEventListener, jsxFunction_appendChild, jsxFunction_attachEvent, jsxFunction_cloneNode, jsxFunction_detachEvent, jsxFunction_hasChildNodes, jsxFunction_insertBefore, jsxFunction_isSameNode, jsxFunction_removeChild, jsxFunction_removeEventListener, jsxFunction_replaceChild, jsxGet_childNodes, jsxGet_firstChild, jsxGet_lastChild, jsxGet_nextSibling, jsxGet_nodeName, jsxGet_nodeType, jsxGet_nodeValue, jsxGet_parentNode, jsxGet_previousSibling, jsxSet_nodeValue, setEventHandler |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getHtmlElementOrDie, getHtmlElementOrNull, getIntArg, getObjectArg, getStringArg, makeScriptableFor, setHtmlElement |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mozilla.javascript.Scriptable |
---|
delete, delete, get, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype |
Constructor Detail |
---|
public HTMLElement()
Method Detail |
---|
public void addComponentRequest(java.lang.String id, java.lang.String idType, java.lang.String minVersion)
id
- the identifier for the component to installidType
- the type of identifier specifiedminVersion
- the minimum version of the component to installpublic void clearComponentRequest()
public int compareVersions(java.lang.String v1, java.lang.String v2)
v1
- the first of the two version numbers to comparev2
- the second of the two version numbers to compare
public boolean doComponentRequest()
addComponentRequest(String, String, String)
.
false
public int getAvailHeight()
public int getAvailWidth()
public int getBufferDepth()
public int getColorDepth()
public java.lang.String getComponentVersion(java.lang.String id, java.lang.String idType)
id
- the identifier for the component whose version is to be returnedidType
- the type of identifier specified
public java.lang.String getConnectionType()
public boolean getCookieEnabled()
public java.lang.String getCpuClass()
public int getHeight()
public boolean getJavaEnabled()
public java.lang.String getPlatform()
public java.lang.String getSystemLanguage()
public java.lang.String getUserLanguage()
public int getWidth()
public java.lang.Object getWithFallback(java.lang.String name)
Scriptable
object.
getWithFallback
in interface ScriptableWithFallbackGetter
name
- the name of the requested property
Scriptable.NOT_FOUND
if nothing is foundpublic boolean isComponentInstalled(java.lang.String id, java.lang.String idType, java.lang.String minVersion)
id
- the identifier for the component to check foridType
- the type of id specifiedminVersion
- the minimum version to check for
public boolean isHomePage(java.lang.String url)
url
- the URL to check
public int jsxFunction_addBehavior(java.lang.String behavior)
behavior
- the URL of the behavior to add, or a default behavior name
public java.lang.String jsxFunction_getAttribute(java.lang.String attributeName)
attributeName
- attribute name.
null
if the attribute is not definedpublic java.lang.Object jsxFunction_getAttributeNode(java.lang.String attributeName)
attributeName
- the name of the attribute to retrieve
public TextRectangle jsxFunction_getBoundingClientRect()
public java.lang.Object jsxFunction_getClientRects()
public java.lang.Object jsxFunction_getElementsByTagName(java.lang.String tagName)
tagName
- the name to search for
public java.lang.Object jsxFunction_insertAdjacentElement(java.lang.String where, java.lang.Object object)
where
- specifies where to insert the element, using one of the following value:
beforeBegin, afterBegin, beforeEnd, afterEndobject
- the element to insert
public void jsxFunction_insertAdjacentHTML(java.lang.String where, java.lang.String text)
where
- specifies where to insert the HTML text, using one of the following value:
beforeBegin, afterBegin, beforeEnd, afterEndtext
- the HTML text to insertpublic void jsxFunction_removeAttribute(java.lang.String name)
name
- Name of the attribute to removepublic void jsxFunction_removeBehavior(int id)
id
- the identifier for the behavior to removepublic void jsxFunction_scrollIntoView()
public void jsxFunction_setAttribute(java.lang.String name, java.lang.String value)
name
- Name of the attribute to setvalue
- Value to set the attribute topublic Attribute jsxFunction_setAttributeNode(Attribute newAtt)
newAtt
- the attribute to set.
public HTMLCollection jsxGet_all()
public java.lang.Object jsxGet_children()
public java.lang.Object jsxGet_className()
public java.lang.Object jsxGet_currentStyle()
public boolean jsxGet_disabled()
public java.lang.String jsxGet_id()
public java.lang.String jsxGet_innerHTML()
public java.lang.String jsxGet_innerText()
public java.lang.String jsxGet_localName()
public java.lang.String jsxGet_namespaceURI()
public int jsxGet_offsetHeight()
public int jsxGet_offsetLeft()
public java.lang.Object jsxGet_offsetParent()
public int jsxGet_offsetTop()
public int jsxGet_offsetWidth()
public java.lang.Object jsxGet_onblur()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onclick()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_oncontextmenu()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_ondblclick()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onfocus()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onkeydown()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onkeypress()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onkeyup()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onmousedown()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onmousemove()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onmouseout()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onmouseover()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onmouseup()
org.mozilla.javascript.Function
public java.lang.Object jsxGet_onresize()
org.mozilla.javascript.Function
public java.lang.String jsxGet_outerHTML()
public java.lang.Object jsxGet_ownerDocument()
public java.lang.Object jsxGet_parentElement()
It is identical to NodeImpl.jsxGet_parentNode()
with the exception of HTML, which has a null parent element.
NodeImpl.jsxGet_parentNode()
public java.lang.String jsxGet_prefix()
public java.lang.Object jsxGet_runtimeStyle()
public int jsxGet_scrollHeight()
public int jsxGet_scrollLeft()
public int jsxGet_scrollTop()
public int jsxGet_scrollWidth()
public java.lang.Object jsxGet_style()
public java.lang.String jsxGet_tagName()
public java.lang.String jsxGet_title()
public void jsxSet_className(java.lang.String className)
className
- - the new class namepublic void jsxSet_disabled(boolean disabled)
disabled
- True if this is to be disabled.public void jsxSet_id(java.lang.String newId)
newId
- The new identifier of this element.public void jsxSet_innerHTML(java.lang.Object value)
value
- - the new value for the contents of this nodepublic void jsxSet_innerText(java.lang.String value)
value
- - the new value for the contents of this nodepublic void jsxSet_onblur(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onclick(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_oncontextmenu(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_ondblclick(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onfocus(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onkeydown(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onkeypress(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onkeyup(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onmousedown(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onmousemove(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onmouseout(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onmouseover(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onmouseup(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_onresize(java.lang.Object handler)
handler
- the new handlerpublic void jsxSet_outerHTML(java.lang.String value)
value
- - the new value for replacing this nodepublic void jsxSet_scrollLeft(int scroll)
scroll
- the new valuepublic void jsxSet_scrollTop(int scroll)
scroll
- the new valuepublic void jsxSet_title(java.lang.String newTitle)
newTitle
- The new identifier of this element.public void navigateHomePage() throws java.io.IOException
java.io.IOException
- if loading home page failspublic void setDomNode(DomNode domNode)
setDomNode
in class SimpleScriptable
domNode
- The DOM nodepublic void setHomePage(java.lang.String url)
url
- the new homepage URLpublic void startDownload(java.lang.String uri, org.mozilla.javascript.Function callback) throws java.net.MalformedURLException
uri
- The URI of the download sourcecallback
- the method which should be called when the download is finished
java.net.MalformedURLException
- If the url cannot be createdpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |