| com.gargoylesoftware.htmlunit.javascript.SimpleScriptable com.gargoylesoftware.htmlunit.javascript.host.Node
All known Subclasses: com.gargoylesoftware.htmlunit.javascript.host.CharacterDataImpl, com.gargoylesoftware.htmlunit.javascript.host.Document, com.gargoylesoftware.htmlunit.javascript.host.Element, com.gargoylesoftware.htmlunit.javascript.host.DocumentFragment, com.gargoylesoftware.htmlunit.javascript.host.XMLElement,
Node | public class Node extends SimpleScriptable (Code) | | The javascript object "Node" which is the base class for all DOM
objects. This will typically wrap an instance of
DomNode .
version: $Revision: 2157 $ author: Mike Bowler author: David K. Taylor author: Barnaby Court author: Christian Sell author: George Murnock author: Chris Erskine author: Bruce Faulkner author: Ahmed Ashour |
Constructor Summary | |
public | Node() Create an instance. |
Method Summary | |
public ScriptResult | executeEvent(Event event) | public ScriptResult | fireEvent(Event event) | public Function | getEventHandler(String eventName) | protected Object | getEventHandlerProp(String eventName) | protected Object | getJavaScriptNode(DomNode domNode) | public void | jsxFunction_addEventListener(String type, Function listener, boolean useCapture) Allows the registration of event listeners on the event target. | public Object | jsxFunction_appendChild(Object childObject) | public boolean | jsxFunction_attachEvent(String type, Function listener) Allows the registration of event listeners on the event target. | public Object | jsxFunction_cloneNode(boolean deep) Duplicate an XML node
Parameters: deep - If true, recursively clone all descendants. | public void | jsxFunction_detachEvent(String type, Function listener) Allows the removal of event listeners on the event target. | public boolean | jsxFunction_hasChildNodes() Returns whether this node has any children. | public Object | jsxFunction_insertBefore(Object newChildObject, Object refChildObject) Add a DOM node as a child to this node before the referenced
node. | public boolean | jsxFunction_isSameNode(Object other) This method provides a way to determine whether two Node references returned by
the implementation reference the same object.
When two Node references are references to the same object, even if through a proxy,
the references may be used completely interchangeably, such that all attributes
have the same values and calling the same DOM method on either reference always has exactly the same effect.
Parameters: other - The node to test against. | public Object | jsxFunction_removeChild(Object childObject) | public void | jsxFunction_removeEventListener(String type, Function listener, boolean useCapture) Allows the removal of event listeners on the event target. | public Object | jsxFunction_replaceChild(Object newChildObject, Object oldChildObject) Replaces a child DOM node with another DOM node. | public Object | jsxGet_childNodes() Returns the child nodes of the current element. | public Object | jsxGet_firstChild() Get the JavaScript property "firstChild" for the node that
contains the current node. | public Object | jsxGet_lastChild() Get the JavaScript property "lastChild" for the node that
contains the current node. | public Object | jsxGet_nextSibling() Get the JavaScript property "nextSibling" for the node that
contains the current node. | public String | jsxGet_nodeName() Get the JavaScript property "nodeName" for the current node. | public short | jsxGet_nodeType() Get the JavaScript property "nodeType" for the current node. | public String | jsxGet_nodeValue() Get the JavaScript property "nodeValue" for the current node. | public Object | jsxGet_parentNode() Get the JavaScript property "parentNode" for the node that
contains the current node. | public Object | jsxGet_previousSibling() Get the JavaScript property "previousSibling" for the node that
contains the current node. | public void | jsxSet_nodeValue(String newValue) Set the JavaScript property "nodeValue" for the current node. | public void | setEventHandler(String eventName, Function eventHandler) | protected void | setEventHandlerProp(String eventName, Object value) |
Node | public Node()(Code) | | Create an instance.
|
executeEvent | public ScriptResult executeEvent(Event event)(Code) | | Execute the event on this object only (needed for instance for onload on (i)frame tags)
Parameters: event - the event the result |
fireEvent | public ScriptResult fireEvent(Event event)(Code) | | Fires the event on the node with capturing and bubbling phase
Parameters: event - the event the result |
getEventHandler | public Function getEventHandler(String eventName)(Code) | | Gets an event handler
Parameters: eventName - the event name (ex: "onclick") the handler function, null if the property is null or not a function |
getEventHandlerProp | protected Object getEventHandlerProp(String eventName)(Code) | | Gets the property defined as event handler (not necessary a Function if something else has been set)
Parameters: eventName - the event name (like "onclick") the property |
getJavaScriptNode | protected Object getJavaScriptNode(DomNode domNode)(Code) | | Get the JavaScript node for a given DomNode
Parameters: domNode - The DomNode The JavaScript node or null if the DomNode was null. |
jsxFunction_addEventListener | public void jsxFunction_addEventListener(String type, Function listener, boolean useCapture)(Code) | | Allows the registration of event listeners on the event target.
Parameters: type - the event type to listen for (like "click") Parameters: listener - the event listener Parameters: useCapture - If true , indicates that the user wishes to initiate capture See Also: Mozilla documentation |
jsxFunction_appendChild | public Object jsxFunction_appendChild(Object childObject)(Code) | | Add a DOM node to the node
Parameters: childObject - The node to add to this node The newly added child node. |
jsxFunction_attachEvent | public boolean jsxFunction_attachEvent(String type, Function listener)(Code) | | Allows the registration of event listeners on the event target.
Parameters: type - the event type to listen for (like "onclick") Parameters: listener - the event listener See Also:
* MSDN documentation true if the listener has been added |
jsxFunction_cloneNode | public Object jsxFunction_cloneNode(boolean deep)(Code) | | Duplicate an XML node
Parameters: deep - If true, recursively clone all descendants. Otherwise,just clone this node. The newly cloned node. |
jsxFunction_detachEvent | public void jsxFunction_detachEvent(String type, Function listener)(Code) | | Allows the removal of event listeners on the event target.
Parameters: type - the event type to listen for (like "onclick") Parameters: listener - the event listener See Also:
* MSDN documentation |
jsxFunction_hasChildNodes | public boolean jsxFunction_hasChildNodes()(Code) | | Returns whether this node has any children.
boolean true if this node has any children, false otherwise. |
jsxFunction_insertBefore | public Object jsxFunction_insertBefore(Object newChildObject, Object refChildObject)(Code) | | Add a DOM node as a child to this node before the referenced
node. If the referenced node is null, append to the end.
Parameters: newChildObject - The node to add to this node Parameters: refChildObject - The node before which to add the new child The newly added child node. |
jsxFunction_isSameNode | public boolean jsxFunction_isSameNode(Object other)(Code) | | This method provides a way to determine whether two Node references returned by
the implementation reference the same object.
When two Node references are references to the same object, even if through a proxy,
the references may be used completely interchangeably, such that all attributes
have the same values and calling the same DOM method on either reference always has exactly the same effect.
Parameters: other - The node to test against. whether this node is the same node as the given one. |
jsxFunction_removeChild | public Object jsxFunction_removeChild(Object childObject)(Code) | | Remove a DOM node from this node
Parameters: childObject - The node to remove from this node The removed child node. |
jsxFunction_removeEventListener | public void jsxFunction_removeEventListener(String type, Function listener, boolean useCapture)(Code) | | Allows the removal of event listeners on the event target.
Parameters: type - the event type to listen for (like "click") Parameters: listener - the event listener Parameters: useCapture - If true , indicates that the user wishes to initiate capture (not yet implemented) See Also: Mozilla documentation |
jsxFunction_replaceChild | public Object jsxFunction_replaceChild(Object newChildObject, Object oldChildObject)(Code) | | Replaces a child DOM node with another DOM node.
Parameters: newChildObject - the node to add as a child of this node Parameters: oldChildObject - the node to remove as a child of this node the removed child node |
jsxGet_childNodes | public Object jsxGet_childNodes()(Code) | | Returns the child nodes of the current element.
The child nodes of the current element. |
jsxGet_firstChild | public Object jsxGet_firstChild()(Code) | | Get the JavaScript property "firstChild" for the node that
contains the current node.
The first child node or null if the current node hasno children. |
jsxGet_lastChild | public Object jsxGet_lastChild()(Code) | | Get the JavaScript property "lastChild" for the node that
contains the current node.
The last child node or null if the current node hasno children. |
jsxGet_nextSibling | public Object jsxGet_nextSibling()(Code) | | Get the JavaScript property "nextSibling" for the node that
contains the current node.
The next sibling node or null if the current node hasno next sibling. |
jsxGet_nodeName | public String jsxGet_nodeName()(Code) | | Get the JavaScript property "nodeName" for the current node.
The node name |
jsxGet_nodeType | public short jsxGet_nodeType()(Code) | | Get the JavaScript property "nodeType" for the current node.
The node type |
jsxGet_nodeValue | public String jsxGet_nodeValue()(Code) | | Get the JavaScript property "nodeValue" for the current node.
The node value |
jsxGet_parentNode | public Object jsxGet_parentNode()(Code) | | Get the JavaScript property "parentNode" for the node that
contains the current node.
The parent node |
jsxGet_previousSibling | public Object jsxGet_previousSibling()(Code) | | Get the JavaScript property "previousSibling" for the node that
contains the current node.
The previous sibling node or null if the current node hasno previous sibling. |
jsxSet_nodeValue | public void jsxSet_nodeValue(String newValue)(Code) | | Set the JavaScript property "nodeValue" for the current node.
Parameters: newValue - The new node value |
setEventHandler | public void setEventHandler(String eventName, Function eventHandler)(Code) | | Defines an event handler
Parameters: eventName - the event name (like "onclick") Parameters: eventHandler - the handler (null to reset it) |
setEventHandlerProp | protected void setEventHandlerProp(String eventName, Object value)(Code) | | Defines an event handler (or maybe any other object)
Parameters: eventName - the event name (like "onclick") Parameters: value - the property (null to reset it) |
Methods inherited from com.gargoylesoftware.htmlunit.javascript.SimpleScriptable | public Object get(String name, Scriptable start)(Code)(Java Doc) public static boolean getBooleanArg(int index, Object[] args, boolean defaultValue)(Code)(Java Doc) public String getClassName()(Code)(Java Doc) public Object getDefaultValue(Class hint)(Code)(Java Doc) final public DomNode getDomNodeOrDie() throws IllegalStateException(Code)(Java Doc) final public DomNode getDomNodeOrNull()(Code)(Java Doc) public static int getIntArg(int index, Object[] args, int defaultValue)(Code)(Java Doc) final protected Log getLog()(Code)(Java Doc) public static Object getObjectArg(int index, Object[] args, Object defaultValue)(Code)(Java Doc) protected Scriptable getPrototype(Class javaScriptClass)(Code)(Java Doc) protected SimpleScriptable getScriptableFor(Object object)(Code)(Java Doc) protected Scriptable getStartingScope()(Code)(Java Doc) public static String getStringArg(int index, Object[] args, String defaultValue)(Code)(Java Doc) protected Transformer getTransformerScriptableFor()(Code)(Java Doc) protected Window getWindow() throws RuntimeException(Code)(Java Doc) protected static Window getWindow(Scriptable s) throws RuntimeException(Code)(Java Doc) protected Object getWithPreemption(String name)(Code)(Java Doc) public SimpleScriptable makeScriptableFor(DomNode domNode)(Code)(Java Doc) public void setDomNode(DomNode domNode)(Code)(Java Doc) protected void setDomNode(DomNode domNode, boolean assignScriptObject)(Code)(Java Doc) public void setHtmlElement(HtmlElement htmlElement)(Code)(Java Doc)
|
|
|