com.gargoylesoftware.htmlunit.html
Class DomNode

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
DomCharacterData, DomDocumentFragment, DomNamespaceNode, SgmlPage

public abstract class DomNode
extends Object
implements Cloneable, Serializable

Base class for nodes in the HTML DOM tree. This class is modeled after the W3C DOM specification, but does not implement it.

Version:
$Revision: 2132 $
Author:
Mike Bowler, Mike J. Bresnahan, David K. Taylor, Christian Sell, Chris Erskine, Mike Williams, Marc Guillemot, Denis N. Antonioli, Daniel Gredler, Ahmed Ashour, Rodney Gitzel
See Also:
Serialized Form

Nested Class Summary
protected  class DomNode.ChildIterator
          an iterator over all children of this node
protected  class DomNode.DescendantElementsIterator
          An iterator over all HtmlElement descendants in document order.
 
Field Summary
static short ATTRIBUTE_NODE
          Deprecated. use Node.ATTRIBUTE_NODE instead.
static short COMMENT_NODE
          Deprecated. use Node.COMMENT_NODE instead.
static short DOCUMENT_NODE
          Deprecated. use Node.DOCUMENT_NODE instead.
static short ELEMENT_NODE
          Deprecated. use Node.ELEMENT_NODE instead.
static String PROPERTY_ELEMENT
          The name of the "element" property.
static String READY_STATE_COMPLETE
          A ready state constant for IE (state 5).
static String READY_STATE_INTERACTIVE
          A ready state constant for IE (state 4).
static String READY_STATE_LOADED
          A ready state constant for IE (state 3).
static String READY_STATE_LOADING
          A ready state constant for IE (state 2).
static String READY_STATE_UNINITIALIZED
          A ready state constant for IE (state 1).
static short TEXT_NODE
          Deprecated. use Node.TEXT_NODE instead.
 
Constructor Summary
protected DomNode()
          Deprecated.  
protected DomNode(Page page)
          Creates an instance.
 
Method Summary
 void addDomChangeListener(DomChangeListener listener)
          Adds a DomChangeListener to the listener list.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Deprecated. Not used
 DomNode appendChild(DomNode node)
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use appendDomChild instead.
 DomNode appendDomChild(DomNode node)
          append a child node to the end of the current list
 String asText()
          Returns a text representation of this element that represents what would be visible to the user if this page was shown in a web browser.
 String asXml()
          Return a string representation of the xml document from this element and all it's children (recursively).
 DomNode cloneDomNode(boolean deep)
          Make a clone of this node
 DomNode cloneNode(boolean deep)
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use cloneDomNode instead.
protected  void fireNodeAdded(DomNode parentNode, DomNode addedNode)
          Support for reporting DOM changes.
protected  void fireNodeDeleted(DomNode parentNode, DomNode deletedNode)
          Support for reporting DOM changes.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Deprecated. Not used
 Iterator getAllHtmlChildElements()
          Return an iterator that will recursively iterate over every child element below this one.
 List getByXPath(String xpathExpr)
          Facility to evaluate an xpath from the current node.
 Iterator getChildIterator()
           
protected  String getChildrenAsText()
          Return a text string that represents all the child elements as they would be visible in a web browser
 int getEndColumnNumber()
          Get the column number in the source page where the DOM node ends.
 int getEndLineNumber()
          Get the line number in the source page where the DOM node ends.
 org.mozilla.javascript.Function getEventHandler(String eventName)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return a Function to be executed when a given event occurs.
 Object getFirstByXPath(String xpathExpr)
          Facility to evaluate an xpath from the current node and get the first result.
 DomNode getFirstChild()
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getFirstDomChild instead.
 DomNode getFirstDomChild()
           
 DomNode getLastChild()
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getLastDomChild instead.
 DomNode getLastDomChild()
          Get the last child DomNode.
 String getLocalName()
          Returns the local part of the qualified name of this node.
protected  Log getLog()
          Return the log object for this element.
 String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified (see ).
 Page getNativePage()
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the Page interface, should be removed, and use getPage() instead.
 DomNode getNextDomSibling()
           
 DomNode getNextSibling()
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getNextDomSibling instead.
abstract  String getNodeName()
          Get the name for the current node.
abstract  short getNodeType()
          Get the type of the current node.
 String getNodeValue()
          Get the value for the current node.
 HtmlPage getPage()
          Return the HtmlPage that contains this node
 DomNode getParentDomNode()
           
 DomNode getParentNode()
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getParentDomNode instead.
 String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 DomNode getPreviousDomSibling()
           
 DomNode getPreviousSibling()
          Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getPreviousDomSibling instead.
 String getReadyState()
          Return this node's ready state (IE only).
 org.mozilla.javascript.ScriptableObject getScriptObject()
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
The logic of when and where the js object is created needs a clean up: functions using a js object of a dom node should not have to look if they should create it first Return the javascript object that corresponds to this node.
 int getStartColumnNumber()
          Get the column number in the source page where the DOM node starts.
 int getStartLineNumber()
          Get the line number in the source page where the DOM node starts.
 boolean hasAttributes()
          Return whether this node has any attributes.
 void insertBefore(DomNode newNode)
          Inserts a new child node before this node into the child relationship this node is a part of.
 boolean isAncestorOf(DomNode node)
          Returns true if this node is an ancestor of the specified node.
protected  boolean isRenderedVisible()
          Returns a flag indicating whether or not this node itself results in any space taken up in the browser windows; for instance, "" affects the specified text, but does not use up any space itself
protected  boolean isTrimmedText()
          Returns a flag indicating whether or not this node should have any leading and trailing whitespace removed when asText() is called; mostly this should be true, but must be false for such things as text formatting tags
protected  void notifyIncorrectness(String message)
          Facility to notify the registered IncorrectnessListener of something that is not fully correct.
protected  void onAddedToPage()
          Lifecycle method invoked whenever a node is added to a page.
protected  void onAllChildrenAddedToPage()
          Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML.
protected  void printChildrenAsXml(String indent, PrintWriter printWriter)
          recursively write the XML data for the node tree starting at node
protected  void printXml(String indent, PrintWriter printWriter)
          recursively write the XML data for the node tree starting at node
protected static String reduceWhitespace(String text)
          Removes extra whitespace from a string similar to what a browser does when it displays text.
 void remove()
          Removes this node from all relationships with other nodes.
 void removeAllChildren()
          Remove all the children of this node.
 void removeDomChangeListener(DomChangeListener listener)
          Removes an DomChangeListener from the listener list.
 void removeEventHandler(String eventName)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes the specified event handler.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Deprecated. Not used
 void replace(DomNode newNode)
          Replaces this node with another node.
 void setEventHandler(String eventName, org.mozilla.javascript.Function eventHandler)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a Function as an event handler.
 void setEventHandler(String eventName, String jsSnippet)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a snippet of javascript code as an event handler.
protected  void setNextSibling(DomNode next)
           
 void setNodeValue(String x)
           
protected  void setParentNode(DomNode parent)
          Set the parent node
 void setPrefix(String prefix)
          Set the namespace prefix of this node, or null if it is unspecified.
protected  void setPreviousSibling(DomNode previous)
           
 void setReadyState(String state)
          Sets this node's ready state (IE only).
 void setScriptObject(org.mozilla.javascript.ScriptableObject scriptObject)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Set the javascript object that corresponds to this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_NODE

public static final short DOCUMENT_NODE
Deprecated. use Node.DOCUMENT_NODE instead.
Node type constant for the Document node.

See Also:
Constant Field Values

ELEMENT_NODE

public static final short ELEMENT_NODE
Deprecated. use Node.ELEMENT_NODE instead.
Node type constant for Element nodes.

See Also:
Constant Field Values

TEXT_NODE

public static final short TEXT_NODE
Deprecated. use Node.TEXT_NODE instead.
Node type constant for Text nodes.

See Also:
Constant Field Values

ATTRIBUTE_NODE

public static final short ATTRIBUTE_NODE
Deprecated. use Node.ATTRIBUTE_NODE instead.
Node type constant for Attribute nodes.

See Also:
Constant Field Values

COMMENT_NODE

public static final short COMMENT_NODE
Deprecated. use Node.COMMENT_NODE instead.
Node type constant for Comment nodes.

See Also:
Constant Field Values

READY_STATE_UNINITIALIZED

public static final String READY_STATE_UNINITIALIZED
A ready state constant for IE (state 1).

See Also:
Constant Field Values

READY_STATE_LOADING

public static final String READY_STATE_LOADING
A ready state constant for IE (state 2).

See Also:
Constant Field Values

READY_STATE_LOADED

public static final String READY_STATE_LOADED
A ready state constant for IE (state 3).

See Also:
Constant Field Values

READY_STATE_INTERACTIVE

public static final String READY_STATE_INTERACTIVE
A ready state constant for IE (state 4).

See Also:
Constant Field Values

READY_STATE_COMPLETE

public static final String READY_STATE_COMPLETE
A ready state constant for IE (state 5).

See Also:
Constant Field Values

PROPERTY_ELEMENT

public static final String PROPERTY_ELEMENT
The name of the "element" property. Used when watching property change events.

See Also:
Constant Field Values
Constructor Detail

DomNode

protected DomNode()
Deprecated. 

Never call this, used for Serialization.


DomNode

protected DomNode(Page page)
Creates an instance.

Parameters:
page - The page which contains this node.
Method Detail

getStartLineNumber

public int getStartLineNumber()
Get the line number in the source page where the DOM node starts.

Returns:
See above.

getStartColumnNumber

public int getStartColumnNumber()
Get the column number in the source page where the DOM node starts.

Returns:
See above.

getEndLineNumber

public int getEndLineNumber()
Get the line number in the source page where the DOM node ends.

Returns:
See above.

getEndColumnNumber

public int getEndColumnNumber()
Get the column number in the source page where the DOM node ends.

Returns:
See above.

getPage

public HtmlPage getPage()
Return the HtmlPage that contains this node

Returns:
See above

getNativePage

public Page getNativePage()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the Page interface, should be removed, and use getPage() instead.

Returns:
the Page interface.

setScriptObject

public void setScriptObject(org.mozilla.javascript.ScriptableObject scriptObject)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Set the javascript object that corresponds to this node. This is not guaranteed to be set even if there is a javascript object for this DOM node.

Parameters:
scriptObject - The javascript object.

getLastChild

public DomNode getLastChild()
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getLastDomChild instead.

Get the last child node.

Returns:
The last child node or null if the current node has no children.

getLastDomChild

public DomNode getLastDomChild()
Get the last child DomNode.

Returns:
The last child node or null if the current node has no children.

getParentNode

public DomNode getParentNode()
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getParentDomNode instead.

Returns:
the parent of this node, which may be null if this is the root node

getParentDomNode

public DomNode getParentDomNode()
Returns:
the parent DomNode of this node, which may be null if this is the root node

setParentNode

protected void setParentNode(DomNode parent)
Set the parent node

Parameters:
parent - the parent node

getPreviousSibling

public DomNode getPreviousSibling()
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getPreviousDomSibling instead.

Returns:
the previous sibling of this node, or null if this is the first node

getPreviousDomSibling

public DomNode getPreviousDomSibling()
Returns:
the previous sibling of this node, or null if this is the first node

getNextSibling

public DomNode getNextSibling()
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getNextDomSibling instead.

Returns:
the next sibling

getNextDomSibling

public DomNode getNextDomSibling()
Returns:
the next sibling

getFirstChild

public DomNode getFirstChild()
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use getFirstDomChild instead.

Returns:
the previous sibling

getFirstDomChild

public DomNode getFirstDomChild()
Returns:
the previous sibling

isAncestorOf

public boolean isAncestorOf(DomNode node)
Returns true if this node is an ancestor of the specified node.

Parameters:
node - the node to check
Returns:
true if this node is an ancestor of the specified node

setPreviousSibling

protected void setPreviousSibling(DomNode previous)
Parameters:
previous - set the previousSibling field value

setNextSibling

protected void setNextSibling(DomNode next)
Parameters:
next - set the nextSibling field value

getNodeType

public abstract short getNodeType()
Get the type of the current node.

Returns:
The node type

getNodeName

public abstract String getNodeName()
Get the name for the current node.

Returns:
The node name

getNamespaceURI

public String getNamespaceURI()
The namespace URI of this node, or null if it is unspecified (see ). This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time. For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as Document.createElement(), this is always null.

Returns:
The URI that identifies an XML namespace.

getLocalName

public String getLocalName()
Returns the local part of the qualified name of this node. For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as Document.createElement(), this is always null.

Returns:
The local name (without prefix).

getPrefix

public String getPrefix()
The namespace prefix of this node, or null if it is unspecified.

Returns:
The Namespace prefix.

setPrefix

public void setPrefix(String prefix)
Set the namespace prefix of this node, or null if it is unspecified. When it is defined to be null, setting it has no effect, including if the node is read-only. Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable. Setting the prefix to null makes it unspecified, setting it to an empty string is implementation dependent. Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change. For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

Parameters:
prefix - The namespace prefix of this node, or null if it is unspecified.

hasAttributes

public boolean hasAttributes()
Return whether this node has any attributes.

Returns:
true if the node has attributes, false otherwise.

isRenderedVisible

protected boolean isRenderedVisible()
Returns a flag indicating whether or not this node itself results in any space taken up in the browser windows; for instance, "" affects the specified text, but does not use up any space itself

Returns:
The flag

isTrimmedText

protected boolean isTrimmedText()
Returns a flag indicating whether or not this node should have any leading and trailing whitespace removed when asText() is called; mostly this should be true, but must be false for such things as text formatting tags

Returns:
The flag

asText

public String asText()
Returns a text representation of this element that represents what would be visible to the user if this page was shown in a web browser. For example, a single-selection select element would return the currently selected value as text.

Returns:
The element as text.

getChildrenAsText

protected final String getChildrenAsText()
Return a text string that represents all the child elements as they would be visible in a web browser

Returns:
See above
See Also:
asText()

reduceWhitespace

protected static String reduceWhitespace(String text)
Removes extra whitespace from a string similar to what a browser does when it displays text.

Parameters:
text - The text to clean up.
Returns:
The cleaned up text.

getLog

protected final Log getLog()
Return the log object for this element.

Returns:
The log object for this element.

asXml

public String asXml()
Return a string representation of the xml document from this element and all it's children (recursively).

Returns:
The xml string.

printXml

protected void printXml(String indent,
                        PrintWriter printWriter)
recursively write the XML data for the node tree starting at node

Parameters:
indent - white space to indent child nodes
printWriter - writer where child nodes are written

printChildrenAsXml

protected void printChildrenAsXml(String indent,
                                  PrintWriter printWriter)
recursively write the XML data for the node tree starting at node

Parameters:
indent - white space to indent child nodes
printWriter - writer where child nodes are written

getNodeValue

public String getNodeValue()
Get the value for the current node.

Returns:
The node value

setNodeValue

public void setNodeValue(String x)
Parameters:
x - The new value

cloneNode

public DomNode cloneNode(boolean deep)
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use cloneDomNode instead.

Make a clone of this node

Parameters:
deep - if true, the clone will be propagated to the whole subtree below this one. Otherwise, the new node will not have any children. The page reference will always be the same as this node's.
Returns:
a new node

cloneDomNode

public DomNode cloneDomNode(boolean deep)
Make a clone of this node

Parameters:
deep - if true, the clone will be propagated to the whole subtree below this one. Otherwise, the new node will not have any children. The page reference will always be the same as this node's.
Returns:
a new node

getScriptObject

public org.mozilla.javascript.ScriptableObject getScriptObject()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
The logic of when and where the js object is created needs a clean up: functions using a js object of a dom node should not have to look if they should create it first Return the javascript object that corresponds to this node.

Returns:
The javascript object that corresponds to this node building it if necessary.

appendChild

public DomNode appendChild(DomNode node)
Deprecated. This method conflicts with the W3C DOM API since the return values are different. Use appendDomChild instead.

append a child node to the end of the current list

Parameters:
node - the node to append
Returns:
the node added

appendDomChild

public DomNode appendDomChild(DomNode node)
append a child node to the end of the current list

Parameters:
node - the node to append
Returns:
the node added

insertBefore

public void insertBefore(DomNode newNode)
                  throws IllegalStateException
Inserts a new child node before this node into the child relationship this node is a part of. If the specified node is this node, this method is a no-op.

Parameters:
newNode - the new node to insert
Throws:
IllegalStateException - if this node is not a child of any other node

remove

public void remove()
            throws IllegalStateException
Removes this node from all relationships with other nodes.

Throws:
IllegalStateException - if this node is not a child of any other node

replace

public void replace(DomNode newNode)
             throws IllegalStateException
Replaces this node with another node. If the specified node is this node, this method is a no-op.

Parameters:
newNode - the node to replace this one
Throws:
IllegalStateException - if this node is not a child of any other node

onAddedToPage

protected void onAddedToPage()
Lifecycle method invoked whenever a node is added to a page. Intended to be overridden by nodes which need to perform custom logic when they are added to a page. This method is recursive, so if you override it, please be sure to call super.onAddedToPage().


onAllChildrenAddedToPage

protected void onAllChildrenAddedToPage()
Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML. Intended to be overridden by nodes which need to perform custom logic after they and all their child nodes have been processed by the HTML parser. This method is not recursive, and the default implementation is empty, so there is no need to call super.onAllChildrenAddedToPage() if you implement this method.


getChildIterator

public Iterator getChildIterator()
Returns:
an iterator over the children of this node

getEventHandler

public org.mozilla.javascript.Function getEventHandler(String eventName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return a Function to be executed when a given event occurs.

Parameters:
eventName - Name of event such as "onclick" or "onblur", etc.
Returns:
A rhino javascript executable Function, or null if no event handler has been defined

setEventHandler

public void setEventHandler(String eventName,
                            org.mozilla.javascript.Function eventHandler)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a Function as an event handler.

Parameters:
eventName - Name of event such as "onclick" or "onblur", etc.
eventHandler - A rhino javascript executable Function

setEventHandler

public void setEventHandler(String eventName,
                            String jsSnippet)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Register a snippet of javascript code as an event handler. The javascript code will be wrapped inside a unique function declaration which provides one argument named "event"

Parameters:
eventName - Name of event such as "onclick" or "onblur", etc.
jsSnippet - executable javascript code

removeEventHandler

public void removeEventHandler(String eventName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Removes the specified event handler.

Parameters:
eventName - Name of the event such as "onclick" or "onblur", etc.

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)
Deprecated. Not used

Add a property change listener to this node.

Parameters:
listener - The new listener.

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)
Deprecated. Not used

Remove a property change listener from this node.

Parameters:
listener - The listener.

firePropertyChange

protected final void firePropertyChange(String propertyName,
                                        Object oldValue,
                                        Object newValue)
Deprecated. Not used

Fire a property change event

Parameters:
propertyName - The name of the property.
oldValue - The old value.
newValue - The new value.

getAllHtmlChildElements

public Iterator getAllHtmlChildElements()
Return an iterator that will recursively iterate over every child element below this one.

Returns:
The iterator.

getReadyState

public String getReadyState()
Return this node's ready state (IE only).

Returns:
This node's ready state.

setReadyState

public void setReadyState(String state)
Sets this node's ready state (IE only).

Parameters:
state - This node's ready state.

removeAllChildren

public void removeAllChildren()
Remove all the children of this node.


getByXPath

public List getByXPath(String xpathExpr)
                throws org.jaxen.JaxenException
Facility to evaluate an xpath from the current node. The current node is considered as the document root for the evaluation therefore parent nodes can't be reached.

Parameters:
xpathExpr - the xpath expression
Returns:
See XPath#selectNodes(Object)
Throws:
org.jaxen.JaxenException - if the xpath expression can't be parsed/evaluated

getFirstByXPath

public Object getFirstByXPath(String xpathExpr)
                       throws org.jaxen.JaxenException
Facility to evaluate an xpath from the current node and get the first result. The current node is considered as the document root for the evaluation therefore parent nodes can't be reached.

Parameters:
xpathExpr - the xpath expression
Returns:
null if no result is found, the first one otherwise
Throws:
org.jaxen.JaxenException - if the xpath expression can't be parsed/evaluated

notifyIncorrectness

protected void notifyIncorrectness(String message)
Facility to notify the registered IncorrectnessListener of something that is not fully correct.

Parameters:
message - the notification

addDomChangeListener

public void addDomChangeListener(DomChangeListener listener)
Adds a DomChangeListener to the listener list. The listener is registered for all children nodes of this DomNode, as well as the descendant nodes.

Parameters:
listener - the dom structure change listener to be added.
See Also:
removeDomChangeListener(DomChangeListener)

removeDomChangeListener

public void removeDomChangeListener(DomChangeListener listener)
Removes an DomChangeListener from the listener list. This method should be used to remove DomChangeListener that were registered for all children nodes and descendant nodes of this DomNode.

Parameters:
listener - the dom structure change listener to be removed.
See Also:
addDomChangeListener(DomChangeListener)

fireNodeAdded

protected void fireNodeAdded(DomNode parentNode,
                             DomNode addedNode)
Support for reporting DOM changes. This method can be called when a node has been added and it will send the appropriate DomChangeEvent to any registered DomChangeListeners. Note that this method recursively calls this node's parent's fireNodeAdded(DomNode, DomNode).

Parameters:
parentNode - the parent of the node that was added.
addedNode - the node that was added.

fireNodeDeleted

protected void fireNodeDeleted(DomNode parentNode,
                               DomNode deletedNode)
Support for reporting DOM changes. This method can be called when a node has been deleted and it will send the appropriate DomChangeEvent to any registered DomChangeListeners. Note that this method recursively calls this node's parent's fireNodeDeleted(DomNode, DomNode).

Parameters:
parentNode - the parent of the node that was deleted.
deletedNode - the node that was deleted.


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