public class Node extends SimpleScriptable
DomNode.| Modifier and Type | Field and Description |
|---|---|
static short |
ATTRIBUTE_NODE |
static short |
CDATA_SECTION_NODE |
static short |
COMMENT_NODE |
static short |
DOCUMENT_FRAGMENT_NODE |
static short |
DOCUMENT_NODE |
static short |
DOCUMENT_TYPE_NODE |
static short |
ELEMENT_NODE |
static short |
ENTITY_NODE |
static short |
ENTITY_REFERENCE_NODE |
static short |
NOTATION_NODE |
static short |
PROCESSING_INSTRUCTION_NODE |
static short |
TEXT_NODE |
| Constructor and Description |
|---|
Node()
Create an instance.
|
| Modifier and Type | Method and Description |
|---|---|
ScriptResult |
executeEvent(Event event)
Execute the event on this object only (needed for instance for onload on (i)frame tags)
|
ScriptResult |
fireEvent(Event event)
Fires the event on the node with capturing and bubbling phase
|
org.mozilla.javascript.Function |
getEventHandler(String eventName)
Gets an event handler
|
protected Object |
getEventHandlerProp(String eventName)
Gets the property defined as event handler (not necessary a Function if something else has been set)
|
protected Object |
getJavaScriptNode(DomNode domNode)
Get the JavaScript node for a given DomNode
|
void |
jsxFunction_addEventListener(String type,
org.mozilla.javascript.Function listener,
boolean useCapture)
Allows the registration of event listeners on the event target.
|
Object |
jsxFunction_appendChild(Object childObject)
Add a DOM node to the node
|
boolean |
jsxFunction_attachEvent(String type,
org.mozilla.javascript.Function listener)
Allows the registration of event listeners on the event target.
|
Object |
jsxFunction_cloneNode(boolean deep)
Duplicate an XML node
|
void |
jsxFunction_detachEvent(String type,
org.mozilla.javascript.Function listener)
Allows the removal of event listeners on the event target.
|
boolean |
jsxFunction_hasChildNodes()
Returns whether this node has any children.
|
Object |
jsxFunction_insertBefore(Object newChildObject,
Object refChildObject)
Add a DOM node as a child to this node before the referenced
node.
|
boolean |
jsxFunction_isSameNode(Object other)
This method provides a way to determine whether two Node references returned by
the implementation reference the same object.
|
Object |
jsxFunction_removeChild(Object childObject)
Remove a DOM node from this node
|
void |
jsxFunction_removeEventListener(String type,
org.mozilla.javascript.Function listener,
boolean useCapture)
Allows the removal of event listeners on the event target.
|
Object |
jsxFunction_replaceChild(Object newChildObject,
Object oldChildObject)
Replaces a child DOM node with another DOM node.
|
Object |
jsxGet_childNodes()
Returns the child nodes of the current element.
|
Object |
jsxGet_firstChild()
Get the JavaScript property "firstChild" for the node that
contains the current node.
|
Object |
jsxGet_lastChild()
Get the JavaScript property "lastChild" for the node that
contains the current node.
|
Object |
jsxGet_nextSibling()
Get the JavaScript property "nextSibling" for the node that
contains the current node.
|
String |
jsxGet_nodeName()
Get the JavaScript property "nodeName" for the current node.
|
short |
jsxGet_nodeType()
Get the JavaScript property "nodeType" for the current node.
|
String |
jsxGet_nodeValue()
Get the JavaScript property "nodeValue" for the current node.
|
Object |
jsxGet_parentNode()
Get the JavaScript property "parentNode" for the node that
contains the current node.
|
Object |
jsxGet_previousSibling()
Get the JavaScript property "previousSibling" for the node that
contains the current node.
|
void |
jsxSet_nodeValue(String newValue)
Set the JavaScript property "nodeValue" for the current node.
|
void |
setEventHandler(String eventName,
org.mozilla.javascript.Function eventHandler)
Defines an event handler
|
protected void |
setEventHandlerProp(String eventName,
Object value)
Defines an event handler (or maybe any other object)
|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, makeScriptableFor, setDomNode, setDomNode, setHtmlElementassociateValue, 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, setPrototypepublic static final short ELEMENT_NODE
org.w3c.dom.Node#ELEMENT_NODE}.,
Constant Field Valuespublic static final short ATTRIBUTE_NODE
org.w3c.dom.Node#ATTRIBUTE_NODE}.,
Constant Field Valuespublic static final short TEXT_NODE
org.w3c.dom.Node#TEXT_NODE}.,
Constant Field Valuespublic static final short CDATA_SECTION_NODE
org.w3c.dom.Node#CDATA_SECTION_NODE}.,
Constant Field Valuespublic static final short ENTITY_REFERENCE_NODE
org.w3c.dom.Node#ENTITY_REFERENCE_NODE}.,
Constant Field Valuespublic static final short ENTITY_NODE
org.w3c.dom.Node#ENTITY_NODE}.,
Constant Field Valuespublic static final short PROCESSING_INSTRUCTION_NODE
org.w3c.dom.Node#PROCESSING_INSTRUCTION_NODE}.,
Constant Field Valuespublic static final short COMMENT_NODE
org.w3c.dom.Node#COMMENT_NODE}.,
Constant Field Valuespublic static final short DOCUMENT_NODE
org.w3c.dom.Node#DOCUMENT_NODE}.,
Constant Field Valuespublic static final short DOCUMENT_TYPE_NODE
org.w3c.dom.Node#DOCUMENT_TYPE_NODE}.,
Constant Field Valuespublic static final short DOCUMENT_FRAGMENT_NODE
org.w3c.dom.Node#DOCUMENT_FRAGMENT_NODE}.,
Constant Field Valuespublic static final short NOTATION_NODE
org.w3c.dom.Node#NOTATION_NODE}.,
Constant Field Valuespublic short jsxGet_nodeType()
public String jsxGet_nodeName()
public String jsxGet_nodeValue()
public void jsxSet_nodeValue(String newValue)
newValue - The new node valuepublic Object jsxFunction_appendChild(Object childObject)
childObject - The node to add to this nodepublic Object jsxFunction_cloneNode(boolean deep)
deep - If true, recursively clone all descendants. Otherwise,
just clone this node.public Object jsxFunction_insertBefore(Object newChildObject, Object refChildObject)
newChildObject - The node to add to this noderefChildObject - The node before which to add the new childpublic boolean jsxFunction_isSameNode(Object other)
other - The node to test against.public Object jsxFunction_removeChild(Object childObject)
childObject - The node to remove from this nodepublic boolean jsxFunction_hasChildNodes()
public Object jsxGet_childNodes()
public Object jsxFunction_replaceChild(Object newChildObject, Object oldChildObject)
newChildObject - the node to add as a child of this nodeoldChildObject - the node to remove as a child of this nodepublic Object jsxGet_parentNode()
public Object jsxGet_nextSibling()
public Object jsxGet_previousSibling()
public Object jsxGet_firstChild()
public Object jsxGet_lastChild()
protected Object getJavaScriptNode(DomNode domNode)
domNode - The DomNodepublic boolean jsxFunction_attachEvent(String type, org.mozilla.javascript.Function listener)
type - the event type to listen for (like "onclick")listener - the event listenertrue if the listener has been addedpublic void jsxFunction_addEventListener(String type, org.mozilla.javascript.Function listener, boolean useCapture)
type - the event type to listen for (like "click")listener - the event listeneruseCapture - If true, indicates that the user wishes to initiate capturepublic void jsxFunction_detachEvent(String type, org.mozilla.javascript.Function listener)
type - the event type to listen for (like "onclick")listener - the event listenerpublic void jsxFunction_removeEventListener(String type, org.mozilla.javascript.Function listener, boolean useCapture)
type - the event type to listen for (like "click")listener - the event listeneruseCapture - If true, indicates that the user wishes to initiate capture (not yet implemented)public ScriptResult executeEvent(Event event)
event - the eventpublic ScriptResult fireEvent(Event event)
event - the eventpublic org.mozilla.javascript.Function getEventHandler(String eventName)
eventName - the event name (ex: "onclick")null if the property is null or not a functionpublic void setEventHandler(String eventName, org.mozilla.javascript.Function eventHandler)
eventName - the event name (like "onclick")eventHandler - the handler (null to reset it)protected void setEventHandlerProp(String eventName, Object value)
eventName - the event name (like "onclick")value - the property (null to reset it)Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.