01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core.event.client2serv.dom.w3c;
15:
16: import org.itsnat.core.ItsNatException;
17: import org.itsnat.impl.core.ItsNatServletRequestImpl;
18: import org.itsnat.impl.core.listener.dom.DOMEventListenerWrapperImpl;
19: import org.itsnat.impl.core.event.client2serv.dom.NodeContainer;
20: import org.w3c.dom.Node;
21: import org.w3c.dom.events.EventTarget;
22: import org.w3c.dom.events.MutationEvent;
23:
24: /**
25: *
26: * @author jmarranz
27: */
28: public class W3CMutationEventImpl extends W3CEventImpl implements
29: MutationEvent {
30: protected NodeContainer relatedNode;
31: protected NodeContainer refChild;
32: protected EventTarget targetNodeInserted;
33:
34: /**
35: * Creates a new instance of W3CMutationEventImpl
36: */
37: public W3CMutationEventImpl(
38: DOMEventListenerWrapperImpl listenerWrapper,
39: ItsNatServletRequestImpl request) {
40: super (listenerWrapper, request);
41: }
42:
43: public void initMutationEvent(String typeArg, boolean canBubbleArg,
44: boolean cancelableArg, Node relatedNodeArg,
45: String prevValueArg, String newValueArg,
46: String attrNameArg, short attrChangeArg) {
47: throw new ItsNatException("Not implemented");
48: }
49:
50: public Node getRelatedNode() {
51: if (relatedNode == null)
52: this .relatedNode = new NodeContainer(
53: getDOMEventParamNode("relatedNode"));
54: return relatedNode.get();
55: }
56:
57: public String getPrevValue() {
58: return getDOMEventParam("prevValue");
59: }
60:
61: public String getNewValue() {
62: return getDOMEventParam("newValue");
63: }
64:
65: public String getAttrName() {
66: return getDOMEventParam("attrName");
67: }
68:
69: public short getAttrChange() {
70: return getDOMEventParamShort("attrChange");
71: }
72:
73: public Node getRefChild() {
74: // No es estándar esta propiedad
75: if (refChild == null)
76: this .refChild = new NodeContainer(
77: getDOMEventParamNode("refChild"));
78: return refChild.get();
79: }
80:
81: public void setTargetNodeInserted(EventTarget target) {
82: this .targetNodeInserted = target;
83: }
84:
85: public EventTarget getTarget() {
86: String type = getType();
87: if (type.equals("DOMNodeInserted"))
88: return targetNodeInserted;
89: else
90: return super.getTarget();
91: }
92: }
|