fireDOMSubtreeModifiedEvent(); return n;
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#appendChild(Node)}. */ public Node appendChild(Node newChild) throws DOMException { checkAndRemove(newChild, false); if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) { Node n = newChild.getFirstChild(); while (n != null) { Node ns = n.getNextSibling(); appendChild(n); n = ns; } return newChild; } else { if (childNodes == null) childNodes = new ChildNodes(); // Node modification ExtendedNode n = childNodes.append((ExtendedNode)newChild); n.setParentNode(this); nodeAdded(n); // Mutation event fireDOMNodeInsertedEvent(n); fireDOMSubtreeModifiedEvent(); return n; } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#appendChild(Node)}. */ public Node appendChild(Node newChild) throws DOMException { checkAndRemove(newChild, false); if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) { Node n = newChild.getFirstChild(); while (n != null) { Node ns = n.getNextSibling(); appendChild(n); n = ns; } return newChild; } else { if (childNodes == null) childNodes = new ChildNodes(); // Node modification ExtendedNode n = childNodes.append((ExtendedNode)newChild); n.setParentNode(this); nodeAdded(n); // Mutation event fireDOMNodeInsertedEvent(n); fireDOMSubtreeModifiedEvent(); return n; } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#appendChild(Node)}. */ public Node appendChild(Node newChild) throws DOMException { checkAndRemove(newChild, false); if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) { Node n = newChild.getFirstChild(); while (n != null) { Node ns = n.getNextSibling(); appendChild(n); n = ns; } return newChild; } else { if (childNodes == null) childNodes = new ChildNodes(); // Node modification ExtendedNode n = childNodes.append((ExtendedNode)newChild); n.setParentNode(this); nodeAdded(n); // Mutation event fireDOMNodeInsertedEvent(n); fireDOMSubtreeModifiedEvent(); return n; } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#removeChild(Node)}. */ public Node removeChild(Node oldChild) throws DOMException { if (childNodes == null || oldChild.getParentNode() != this) { throw createDOMException (DOMException.NOT_FOUND_ERR, "child.missing", new Object[] { new Integer(oldChild.getNodeType()), oldChild.getNodeName() }); } if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); } // Mutation event fireDOMNodeRemovedEvent(oldChild); getCurrentDocument().nodeToBeRemoved(oldChild); nodeToBeRemoved(oldChild); // Node modification ExtendedNode result = childNodes.remove((ExtendedNode)oldChild); result.setParentNode(null); // Mutation event fireDOMSubtreeModifiedEvent(); return result; }
/** * Fires a DOMSubtreeModified event. */ protected void fireDOMSubtreeModifiedEvent() { AbstractDocument doc = getCurrentDocument(); if (doc.getEventsEnabled()) { super.fireDOMSubtreeModifiedEvent(); if (getOwnerElement() != null) { ((AbstractElement)getOwnerElement()). fireDOMSubtreeModifiedEvent(); } } }
/** * Fires a DOMSubtreeModified event. */ protected void fireDOMSubtreeModifiedEvent() { AbstractDocument doc = getCurrentDocument(); if (doc.getEventsEnabled()) { super.fireDOMSubtreeModifiedEvent(); if (getOwnerElement() != null) { ((AbstractElement)getOwnerElement()). fireDOMSubtreeModifiedEvent(); } } }
/** * Fires a DOMSubtreeModified event. */ protected void fireDOMSubtreeModifiedEvent() { AbstractDocument doc = getCurrentDocument(); if (doc.getEventsEnabled()) { super.fireDOMSubtreeModifiedEvent(); if (getOwnerElement() != null) { ((AbstractElement)getOwnerElement()). fireDOMSubtreeModifiedEvent(); } } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); } // Node modification String val = this.nodeValue; this.nodeValue = (nodeValue == null) ? "" : nodeValue; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.nodeValue); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.ProcessingInstruction#setData(String)}. */ public void setData(String data) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); } String val = this.data; this.data = data; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.data); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
fireDOMSubtreeModifiedEvent(); return n;
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#removeChild(Node)}. */ public Node removeChild(Node oldChild) throws DOMException { if (childNodes == null || oldChild.getParentNode() != this) { throw createDOMException (DOMException.NOT_FOUND_ERR, "child.missing", new Object[] {(int) oldChild.getNodeType(), oldChild.getNodeName() }); } if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } // Mutation event fireDOMNodeRemovedEvent(oldChild); getCurrentDocument().nodeToBeRemoved(oldChild); nodeToBeRemoved(oldChild); // Node modification ExtendedNode result = childNodes.remove((ExtendedNode)oldChild); result.setParentNode(null); // Mutation event fireDOMSubtreeModifiedEvent(); return result; }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } // Node modification String val = this.nodeValue; this.nodeValue = (nodeValue == null) ? "" : nodeValue; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.nodeValue); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.ProcessingInstruction#setData(String)}. */ public void setData(String data) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String val = this.data; this.data = data; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.data); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } // Node modification String val = this.nodeValue; this.nodeValue = (nodeValue == null) ? "" : nodeValue; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.nodeValue); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.ProcessingInstruction#setData(String)}. */ public void setData(String data) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String val = this.data; this.data = data; // Mutation event fireDOMCharacterDataModifiedEvent(val, this.data); if (getParentNode() != null) { ((AbstractParentNode)getParentNode()). fireDOMSubtreeModifiedEvent(); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#removeChild(Node)}. */ public Node removeChild(Node oldChild) throws DOMException { if (childNodes == null || oldChild.getParentNode() != this) { throw createDOMException (DOMException.NOT_FOUND_ERR, "child.missing", new Object[] {(int) oldChild.getNodeType(), oldChild.getNodeName() }); } if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } // Mutation event fireDOMNodeRemovedEvent(oldChild); getCurrentDocument().nodeToBeRemoved(oldChild); nodeToBeRemoved(oldChild); // Node modification ExtendedNode result = childNodes.remove((ExtendedNode)oldChild); result.setParentNode(null); // Mutation event fireDOMSubtreeModifiedEvent(); return result; }