/** * A method to be called when a node has been replaced in the tree. */ void replacedNode(NodeImpl node) { if (mutationEvents) { dispatchAggregateEvents(node, savedEnclosingAttr); } }
/** * A method to be called when an attribute value has been modified */ void modifiedAttrValue(AttrImpl attr, String oldvalue) { if (mutationEvents) { // MUTATION POST-EVENTS: dispatchAggregateEvents(attr, attr, oldvalue, MutationEvent.MODIFICATION); } }
/** * A method to be called when a node has been removed from the tree. */ void removedNode(NodeImpl node, boolean replace) { if (mutationEvents) { // MUTATION POST-EVENTS: // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified, // if required. (Common to most kinds of mutation) if (!replace) { dispatchAggregateEvents(node, savedEnclosingAttr); } } // End mutation postprocessing }
/** * NON-DOM INTERNAL: Convenience wrapper for calling * dispatchAggregateEvents when the context was established * by <code>savedEnclosingAttr</code>. * @param node node to dispatch to * @param ea description of Attr affected by current operation */ protected void dispatchAggregateEvents(NodeImpl node, EnclosingAttr ea) { if (ea != null) dispatchAggregateEvents(node, ea.node, ea.oldvalue, MutationEvent.MODIFICATION); else dispatchAggregateEvents(node, null, null, (short) 0); } // dispatchAggregateEvents(NodeImpl,EnclosingAttr) :void
/** * A method to be called when an attribute node has been set */ void setAttrNode(AttrImpl attr, AttrImpl previous) { if (mutationEvents) { // MUTATION POST-EVENTS: if (previous == null) { dispatchAggregateEvents(attr.ownerNode, attr, null, MutationEvent.ADDITION); } else { dispatchAggregateEvents(attr.ownerNode, attr, previous.getNodeValue(), MutationEvent.MODIFICATION); } } }
private void mutationEventsModifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) { if (!replace) { // MUTATION POST-EVENTS: LCount lc = LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED); if (lc.total > 0) { MutationEvent me = new MutationEventImpl(); me.initMutationEvent( MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED, true, false, null, oldvalue, value, null, (short) 0); dispatchEvent(node, me); } // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified, // if required. (Common to most kinds of mutation) dispatchAggregateEvents(node, savedEnclosingAttr); } // End mutation postprocessing }
private void mutationEventsRemovedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) { // If we have to send DOMAttrModified (determined earlier), // do so. LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED); if (lc.total > 0) { MutationEventImpl me= new MutationEventImpl(); me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED, true, false, attr, attr.getNodeValue(), null, name, MutationEvent.REMOVAL); dispatchEvent(oldOwner, me); } // We can hand off to process DOMSubtreeModified, though. // Note that only the Element needs to be informed; the // Attr's subtree has not been changed by this operation. dispatchAggregateEvents(oldOwner, null, null, (short) 0); }
dispatchAggregateEvents(node, savedEnclosingAttr);