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.event.client2serv.dom.DOMEventImpl;
19: import org.itsnat.impl.core.listener.dom.DOMEventListenerWrapperImpl;
20: import org.itsnat.impl.core.event.client2serv.dom.NodeContainer;
21: import org.w3c.dom.events.EventTarget;
22:
23: /**
24: *
25: * @author jmarranz
26: */
27: public class W3CEventImpl extends DOMEventImpl {
28: // http://cgi.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/mds.cgi
29: // http://en.wikipedia.org/wiki/DOM_Events
30:
31: /**
32: * Creates a new instance of W3CEventImpl
33: */
34: public W3CEventImpl(DOMEventListenerWrapperImpl listenerWrapper,
35: ItsNatServletRequestImpl request) {
36: super (listenerWrapper, request);
37: }
38:
39: public void initEvent(String eventTypeArg, boolean canBubbleArg,
40: boolean cancelableArg) {
41: throw new ItsNatException("Not implemented");
42: }
43:
44: public EventTarget getTarget() {
45: if (target == null)
46: target = new NodeContainer(getDOMEventParamNode("target"));
47: return (EventTarget) target.get();
48: }
49:
50: public String getType() {
51: return getDOMEventParam("type");
52: }
53:
54: public short getEventPhase() {
55: return getDOMEventParamShort("eventPhase");
56: }
57:
58: public boolean getBubbles() {
59: return getDOMEventParamBoolean("bubbles");
60: }
61:
62: public boolean getCancelable() {
63: return getDOMEventParamBoolean("cancelable");
64: }
65:
66: public long getTimeStamp() {
67: return getDOMEventParamLong("timeStamp");
68: }
69:
70: }
|