public class HTMLElement extends Element implements ScriptableWithFallbackGetter
HtmlElement
.ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
HTMLElement()
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentRequest(String id,
String idType,
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(String v1,
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.
|
BoxObject |
getBoxObject()
Returns BoxObject for this element.
|
int |
getBufferDepth()
Returns the screen's buffer depth.
|
int |
getColorDepth()
Returns the screen's color depth.
|
String |
getComponentVersion(String id,
String idType)
Returns the version of the specified component.
|
String |
getConnectionType()
Returns the connection type being used.
|
boolean |
getCookieEnabled()
Returns true if cookies are enabled.
|
String |
getCpuClass()
Returns the type of CPU used.
|
int |
getHeight()
Returns the screen's height.
|
HtmlElement |
getHtmlElementOrDie()
Return the html element that corresponds to this javascript object or throw an exception
if one cannot be found.
|
HtmlElement |
getHtmlElementOrNull()
Return the html element that corresponds to this javascript object
or null if an element hasn't been set.
|
boolean |
getJavaEnabled()
Returns true if Java is enabled.
|
String |
getPlatform()
Returns the platform used.
|
String |
getSystemLanguage()
Returns the system language.
|
String |
getUserLanguage()
Returns the user language.
|
int |
getWidth()
Returns the screen's width.
|
Object |
getWithFallback(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(String id,
String idType,
String minVersion)
Returns true if the specified component is installed.
|
boolean |
isHomePage(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(String behavior)
Adds the specified behavior to this HTML element.
|
void |
jsxFunction_blur()
Remove focus from this element.
|
boolean |
jsxFunction_dispatchEvent(Event event)
Dispatches an event into the event system (standards-conformant browsers only).
|
static ScriptResult |
jsxFunction_fireEvent(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function f)
Fires a specified event on this element (IE only).
|
void |
jsxFunction_focus()
Set the focus to this element.
|
String |
jsxFunction_getAttribute(String attributeName)
Gets the specified attribute.
|
Object |
jsxFunction_getAttributeNode(String attributeName)
Gets the attribute node for the specified attribute.
|
String |
jsxFunction_getAttributeNS(String namespaceURI,
String localName)
Gets the specified attribute.
|
TextRectangle |
jsxFunction_getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects.
|
Object |
jsxFunction_getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object
or range within the client.
|
Object |
jsxFunction_getElementsByTagName(String tagName)
Returns all the descendant elements with the specified tag name.
|
boolean |
jsxFunction_hasAttribute(String name)
Test for attribute.
|
boolean |
jsxFunction_hasAttributeNS(String namespaceURI,
String localName)
Test for attribute.
|
Object |
jsxFunction_insertAdjacentElement(String where,
Object object)
Inserts the given element into the element at the location.
|
void |
jsxFunction_insertAdjacentHTML(String where,
String text)
Inserts the given HTML text into the element at the location.
|
void |
jsxFunction_removeAttribute(String name)
Remove an attribute.
|
void |
jsxFunction_removeBehavior(int id)
Removes the behavior corresponding to the specified identifier from this element.
|
boolean |
jsxFunction_removeExpression(String propertyName)
Removes the expression from the specified property.
|
void |
jsxFunction_scrollIntoView()
Implement the scrollIntoView() javascript function but don't actually do
anything.
|
void |
jsxFunction_setAttribute(String name,
String value)
Set an attribute.
|
Attribute |
jsxFunction_setAttributeNode(Attribute newAtt)
Sets the attribute node for the specified attribute.
|
void |
jsxFunction_setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Sets the specified attribute.
|
void |
jsxFunction_setExpression(String propertyName,
String expression,
String language)
Sets an expression for the specified HTMLElement.
|
HTMLCollection |
jsxGet_all()
Return the value of the "all" property.
|
NamedNodeMap |
jsxGet_attributes()
Returns a collection of the attributes of this element.
|
Object |
jsxGet_children()
Get the children of the current node.
|
Object |
jsxGet_className()
Return the class defined for this element
|
Object |
jsxGet_currentStyle()
Returns the current style object for this element.
|
boolean |
jsxGet_disabled()
Return true if this element is disabled.
|
String |
jsxGet_id()
Return the element ID.
|
String |
jsxGet_innerHTML()
Get the innerHTML attribute
|
String |
jsxGet_innerText()
Get the innerText attribute
|
String |
jsxGet_localName()
Returns The local name (without prefix).
|
String |
jsxGet_namespaceURI()
Returns The URI that identifies an XML namespace.
|
int |
jsxGet_offsetHeight()
Returns this element's offsetHeight, which is the element height plus the element's padding
plus the element's border.
|
int |
jsxGet_offsetLeft()
Returns this element's offsetLeft, which is the calculated left position of this
element relative to the offsetParent.
|
Object |
jsxGet_offsetParent()
Returns this element's offsetParent.
|
int |
jsxGet_offsetTop()
Returns this element's offsetTop, which is the calculated top position of this
element relative to the offsetParent.
|
int |
jsxGet_offsetWidth()
Returns this element's offsetWidth, which is the element width plus the element's padding
plus the element's border.
|
Object |
jsxGet_onblur()
Get the onblur event handler for this element.
|
Object |
jsxGet_onclick()
Get the onclick event handler for this element.
|
Object |
jsxGet_oncontextmenu()
Get the oncontextmenu event handler for this element.
|
Object |
jsxGet_ondblclick()
Get the ondblclick event handler for this element.
|
Object |
jsxGet_onfocus()
Get the onfocus event handler for this element.
|
Object |
jsxGet_onkeydown()
Get the onkeydown event handler for this element.
|
Object |
jsxGet_onkeypress()
Get the onkeypress event handler for this element.
|
Object |
jsxGet_onkeyup()
Get the onkeyup event handler for this element.
|
Object |
jsxGet_onmousedown()
Get the onmousedown event handler for this element.
|
Object |
jsxGet_onmousemove()
Get the onmousemove event handler for this element.
|
Object |
jsxGet_onmouseout()
Get the onmouseout event handler for this element.
|
Object |
jsxGet_onmouseover()
Get the onmouseover event handler for this element.
|
Object |
jsxGet_onmouseup()
Get the onmouseup event handler for this element.
|
Object |
jsxGet_onresize()
Get the onresize event handler for this element.
|
String |
jsxGet_outerHTML()
Gets the outerHTML of the node.
|
Object |
jsxGet_ownerDocument()
Return the owner document
|
Object |
jsxGet_parentElement()
Get the JavaScript property "parentElement".
|
String |
jsxGet_prefix()
Returns The Namespace prefix
|
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.
|
Object |
jsxGet_style()
Return the style object for this element.
|
String |
jsxGet_tagName()
Return the tag name of this element.
|
String |
jsxGet_title()
Return the element title.
|
String |
jsxGet_uniqueID()
Retrieves an auto-generated, unique identifier for the object.
|
void |
jsxSet_className(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(String newId)
Set the identifier this element.
|
void |
jsxSet_innerHTML(Object value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_innerText(String value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_onblur(Object handler)
Set the onblur event handler for this element.
|
void |
jsxSet_onclick(Object handler)
Set the onclick event handler for this element.
|
void |
jsxSet_oncontextmenu(Object handler)
Set the oncontextmenu event handler for this element.
|
void |
jsxSet_ondblclick(Object handler)
Set the ondblclick event handler for this element.
|
void |
jsxSet_onfocus(Object handler)
Set the onfocus event handler for this element.
|
void |
jsxSet_onkeydown(Object handler)
Set the onkeydown event handler for this element.
|
void |
jsxSet_onkeypress(Object handler)
Set the onkeypress event handler for this element.
|
void |
jsxSet_onkeyup(Object handler)
Set the onkeyup event handler for this element.
|
void |
jsxSet_onmousedown(Object handler)
Set the onmousedown event handler for this element.
|
void |
jsxSet_onmousemove(Object handler)
Set the onmousemove event handler for this element.
|
void |
jsxSet_onmouseout(Object handler)
Set the onmouseout event handler for this element.
|
void |
jsxSet_onmouseover(Object handler)
Set the onmouseover event handler for this element.
|
void |
jsxSet_onmouseup(Object handler)
Set the onmouseup event handler for this element.
|
void |
jsxSet_onresize(Object handler)
Set the onresize event handler for this element.
|
void |
jsxSet_outerHTML(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(String newTitle)
Set the title of this element.
|
void |
navigateHomePage()
Causes the web client to navigate to the current home page.
|
protected org.xml.sax.helpers.AttributesImpl |
readAttributes(HtmlElement element)
Gets the attributes of the element in the form of a
Attributes |
void |
setDomNode(DomNode domNode)
Set the DOM node that corresponds to this javascript object
|
void |
setHomePage(String url)
Sets the web client's current homepage.
|
void |
startDownload(String uri,
org.mozilla.javascript.Function callback)
Implementation of the IE behavior #default#download
|
String |
toString()
Just for debug purposes.
|
executeEvent, fireEvent, getEventHandler, getEventHandlerProp, getJavaScriptNode, 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, setEventHandlerProp
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, makeScriptableFor, setDomNode, setHtmlElement
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, 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
public HTMLCollection jsxGet_all()
public Object jsxGet_style()
public Object jsxGet_currentStyle()
public Object jsxGet_runtimeStyle()
public void setDomNode(DomNode domNode)
setDomNode
in class SimpleScriptable
domNode
- The DOM nodepublic String jsxGet_id()
public void jsxSet_id(String newId)
newId
- The new identifier of this element.public String jsxGet_title()
public void jsxSet_title(String newTitle)
newTitle
- The new identifier of this element.public boolean jsxGet_disabled()
public void jsxSet_disabled(boolean disabled)
disabled
- True if this is to be disabled.public String jsxGet_tagName()
public String jsxGet_namespaceURI()
public String jsxGet_localName()
public String jsxGet_prefix()
public Object jsxGet_ownerDocument()
public Object getWithFallback(String name)
Scriptable
object.getWithFallback
in interface ScriptableWithFallbackGetter
name
- the name of the requested propertyScriptable.NOT_FOUND
if nothing is foundpublic NamedNodeMap jsxGet_attributes()
public String jsxFunction_getAttribute(String attributeName)
attributeName
- attribute name.null
if the attribute is not definedpublic String jsxFunction_getAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic boolean jsxFunction_hasAttribute(String name)
name
- Name of the attribute to testtrue
if the node has this attributepublic boolean jsxFunction_hasAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fortrue
if the node has this attributepublic void jsxFunction_setAttribute(String name, String value)
name
- Name of the attribute to setvalue
- Value to set the attribute topublic void jsxFunction_setAttributeNS(String namespaceURI, String qualifiedName, String value)
namespaceURI
- the namespace URIqualifiedName
- the local name of the attribute to look forvalue
- the new attribute valuepublic void jsxFunction_removeAttribute(String name)
name
- Name of the attribute to removepublic Object jsxFunction_getAttributeNode(String attributeName)
attributeName
- the name of the attribute to retrievepublic Attribute jsxFunction_setAttributeNode(Attribute newAtt)
newAtt
- the attribute to set.public Object jsxFunction_getElementsByTagName(String tagName)
tagName
- the name to search forpublic Object jsxGet_className()
public void jsxSet_className(String className)
className
- - the new class namepublic String jsxGet_innerHTML()
public String jsxGet_innerText()
public String jsxGet_outerHTML()
public void jsxSet_innerHTML(Object value)
value
- - the new value for the contents of this nodepublic void jsxSet_innerText(String value)
value
- - the new value for the contents of this nodepublic void jsxSet_outerHTML(String value)
value
- - the new value for replacing this nodeprotected org.xml.sax.helpers.AttributesImpl readAttributes(HtmlElement element)
Attributes
element
- the element to read the attributes frompublic void jsxFunction_insertAdjacentHTML(String where, 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 Object jsxFunction_insertAdjacentElement(String where, Object object)
where
- specifies where to insert the element, using one of the following value:
beforeBegin, afterBegin, beforeEnd, afterEndobject
- the element to insertpublic int jsxFunction_addBehavior(String behavior)
behavior
- the URL of the behavior to add, or a default behavior namepublic void jsxFunction_removeBehavior(int id)
id
- the identifier for the behavior to removepublic int getAvailHeight()
public int getAvailWidth()
public int getBufferDepth()
public BoxObject getBoxObject()
public int getColorDepth()
public String getConnectionType()
public boolean getCookieEnabled()
public String getCpuClass()
public int getHeight()
public boolean getJavaEnabled()
public String getPlatform()
public String getSystemLanguage()
public String getUserLanguage()
public int getWidth()
public void addComponentRequest(String id, String idType, 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(String v1, String v2)
v1
- the first of the two version numbers to comparev2
- the second of the two version numbers to comparepublic boolean doComponentRequest()
addComponentRequest(String, String, String)
.false
public String getComponentVersion(String id, String idType)
id
- the identifier for the component whose version is to be returnedidType
- the type of identifier specifiedpublic boolean isComponentInstalled(String id, String idType, String minVersion)
id
- the identifier for the component to check foridType
- the type of id specifiedminVersion
- the minimum version to check forpublic void startDownload(String uri, org.mozilla.javascript.Function callback) throws MalformedURLException
uri
- The URI of the download sourcecallback
- the method which should be called when the download is finishedMalformedURLException
- If the url cannot be createdpublic boolean isHomePage(String url)
url
- the URL to checkpublic void setHomePage(String url)
url
- the new homepage URLpublic void navigateHomePage() throws IOException
IOException
- if loading home page failspublic Object jsxGet_children()
public void jsxSet_onclick(Object handler)
handler
- the new handlerpublic Object jsxGet_onclick()
org.mozilla.javascript.Function
public void jsxSet_ondblclick(Object handler)
handler
- the new handlerpublic Object jsxGet_ondblclick()
org.mozilla.javascript.Function
public void jsxSet_onblur(Object handler)
handler
- the new handlerpublic Object jsxGet_onblur()
org.mozilla.javascript.Function
public void jsxSet_onfocus(Object handler)
handler
- the new handlerpublic Object jsxGet_onfocus()
org.mozilla.javascript.Function
public void jsxSet_onkeydown(Object handler)
handler
- the new handlerpublic Object jsxGet_onkeydown()
org.mozilla.javascript.Function
public void jsxSet_onkeypress(Object handler)
handler
- the new handlerpublic Object jsxGet_onkeypress()
org.mozilla.javascript.Function
public void jsxSet_onkeyup(Object handler)
handler
- the new handlerpublic Object jsxGet_onkeyup()
org.mozilla.javascript.Function
public void jsxSet_onmousedown(Object handler)
handler
- the new handlerpublic Object jsxGet_onmousedown()
org.mozilla.javascript.Function
public void jsxSet_onmousemove(Object handler)
handler
- the new handlerpublic Object jsxGet_onmousemove()
org.mozilla.javascript.Function
public void jsxSet_onmouseout(Object handler)
handler
- the new handlerpublic Object jsxGet_onmouseout()
org.mozilla.javascript.Function
public void jsxSet_onmouseover(Object handler)
handler
- the new handlerpublic Object jsxGet_onmouseover()
org.mozilla.javascript.Function
public void jsxSet_onmouseup(Object handler)
handler
- the new handlerpublic Object jsxGet_onmouseup()
org.mozilla.javascript.Function
public void jsxSet_oncontextmenu(Object handler)
handler
- the new handlerpublic Object jsxGet_oncontextmenu()
org.mozilla.javascript.Function
public void jsxSet_onresize(Object handler)
handler
- the new handlerpublic Object jsxGet_onresize()
org.mozilla.javascript.Function
public int jsxGet_offsetHeight()
public int jsxGet_offsetWidth()
public int jsxGet_offsetLeft()
public int jsxGet_offsetTop()
public Object jsxGet_offsetParent()
public int jsxGet_scrollTop()
public void jsxSet_scrollTop(int scroll)
scroll
- the new valuepublic int jsxGet_scrollLeft()
public void jsxSet_scrollLeft(int scroll)
scroll
- the new valuepublic int jsxGet_scrollHeight()
public int jsxGet_scrollWidth()
public Object jsxGet_parentElement()
It is identical to Node.jsxGet_parentNode()
with the exception of HTML, which has a null parent element.
Node.jsxGet_parentNode()
public void jsxFunction_scrollIntoView()
public TextRectangle jsxFunction_getBoundingClientRect()
public Object jsxFunction_getClientRects()
public void jsxFunction_setExpression(String propertyName, String expression, String language)
propertyName
- Specifies the name of the property to which expression is added.expression
- specifies any valid script statement without quotations or semicolons.
This string can include references to other properties on the current page.
Array references are not allowed on object properties included in this script.language
- specified the language used.public boolean jsxFunction_removeExpression(String propertyName)
propertyName
- Specifies the name of the property from which to remove an expression.public String jsxGet_uniqueID()
public boolean jsxFunction_dispatchEvent(Event event)
event
- the event to be dispatchedpublic static ScriptResult jsxFunction_fireEvent(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function f)
cx
- the JavaScript contextthisObj
- the element instance on which this method was invokedargs
- contains the event type as a string, and an optional event templatef
- the function being invokedpublic final HtmlElement getHtmlElementOrDie() throws IllegalStateException
IllegalStateException
- If the html element could not be found.public final HtmlElement getHtmlElementOrNull()
public void jsxFunction_blur()
public void jsxFunction_focus()
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.