Source Code Cross Referenced for EventObject.java in  » Ajax » gwtext-2.01 » com » gwtext » client » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » gwtext 2.01 » com.gwtext.client.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * GWT-Ext Widget Library
003:         * Copyright(c) 2007-2008, GWT-Ext.
004:         * licensing@gwt-ext.com
005:         * 
006:         * http://www.gwt-ext.com/license
007:         */
008:
009:        package com.gwtext.client.core;
010:
011:        import com.google.gwt.core.client.JavaScriptObject;
012:        import com.google.gwt.user.client.Element;
013:        import com.google.gwt.user.client.Event;
014:
015:        /**
016:         * A normalized Event object. Can use DOM.eventGetType(Event) for determinint event type too.
017:         */
018:        public class EventObject extends JsObject {
019:
020:            public static int BACKSPACE, CONTROL, DELETE, DOWN, END, ENTER,
021:                    ESC, F5, HOME, LEFT, PAGEDOWN, PAGEUP, RETURN, RIGHT,
022:                    SHIFT, SPACE, TAB, UP;
023:
024:            /*
025:            Initializing constants from JsObject static bloc instead of here because of issue with OS X
026:            See http://code.google.com/p/gwt-ext/issues/detail?id=71
027:            static {
028:                initConstants();
029:            }*/
030:
031:            public EventObject(JavaScriptObject jsObj) {
032:                super (jsObj);
033:            }
034:
035:            public static EventObject instance(JavaScriptObject event) {
036:                return new EventObject(event);
037:            }
038:
039:            /**
040:             * Gets the key code for the event.
041:             *
042:             * @return  the key code for the event.
043:             */
044:            public native int getCharCode() /*-{
045:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
046:                   return e.getCharCode();
047:               }-*/;
048:
049:            /**
050:             * Returns a normalized keyCode for the event.
051:             *
052:             * @return a normalized keyCode for the event.
053:             */
054:            public native int getKey() /*-{
055:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
056:                   var key =  e.getKey();
057:                   return key == null || key === undefined ? -1 : key;
058:               }-*/;
059:
060:            /**
061:             * Gets the related target.
062:             *
063:             * @return the related target.
064:             */
065:            public native Element getRelatedTarget() /*-{
066:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
067:                   var rt =  e.getRelatedTarget();
068:                   return rt === undefined ? null : rt;
069:               }-*/;
070:
071:            /**
072:             * Gets the target for the event.
073:             *
074:             * @return the target for the event.
075:             */
076:            public native Element getTarget() /*-{
077:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
078:                   var el = e.getTarget();
079:                   return el === undefined ? null : el;
080:               }-*/;
081:
082:            public native Element getTarget(String selector, int maxDepth) /*-{
083:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
084:                   var el =  e.getTarget(selector, maxDepth);
085:                   return el === undefined ? null : el;
086:               }-*/;
087:
088:            public native long getTime() /*-{
089:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
090:                   return e.getTime();
091:               }-*/;
092:
093:            public native int getWheelDelta() /*-{
094:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
095:                   return e.getWheelDelta();
096:               }-*/;
097:
098:            /**
099:             * Gets the xy coordinates of the event.
100:             *
101:             * @return the xy coordinates of the event.
102:             */
103:            public int[] getXY() {
104:                return new int[] { getPageX(), getPageY() };
105:            }
106:
107:            /**
108:             * Gets the x coordinate of the event.
109:             *
110:             * @return the x coordinate of the event.
111:             */
112:            public native int getPageX() /*-{
113:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
114:                   return e.getPageX();
115:               }-*/;
116:
117:            /**
118:             * Gets the y coordinate of the event.
119:             *
120:             * @return the y coordinate of the event.
121:             */
122:            public native int getPageY() /*-{
123:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
124:                   return e.getPageY();
125:               }-*/;
126:
127:            /**
128:             * Returns true if the control, meta, shift or alt key was pressed during this event.
129:             *
130:             * @return true if the control, meta, shift or alt key was pressed during this event.
131:             */
132:            public native boolean hasModifier() /*-{
133:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
134:                   return e.hasModifier();
135:               }-*/;
136:
137:            /**
138:             * Stop the event (preventDefault and stopPropagation)
139:             */
140:            public native void stopEvent() /*-{
141:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
142:                   e.stopEvent();
143:               }-*/;
144:
145:            /**
146:             *  Cancels bubbling of the event.
147:             */
148:            public native void stopPropagation() /*-{
149:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
150:                   e.stopPropagation();
151:               }-*/;
152:
153:            /**
154:             * Returns true if the target of this event equals el or is a child of el
155:             *
156:             * @param id  the element ID
157:             * @return true if target within
158:             */
159:            public native boolean within(String id) /*-{
160:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
161:                   var bool =  e.within(id);
162:                   return bool == undefined || bool == null ? false : bool;
163:               }-*/;
164:
165:            /**
166:             * Returns true if the target of this event equals el or is a child of el
167:             *
168:             * @param elem the element
169:             * @return true if target within
170:             */
171:            public native boolean within(Element elem) /*-{
172:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
173:                   var bool = e.within(elem);
174:                   return bool == undefined || bool == null ? false : bool;
175:               }-*/;
176:
177:            /**
178:             * Return true if is Alt key.
179:             *
180:             * @return true if is Alt key.
181:             */
182:            public native boolean isAltKey() /*-{
183:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
184:                   var isAlt = e.altKey;
185:                   return (isAlt == null || isAlt === undefined) ? false : isAlt;
186:               }-*/;
187:
188:            /**
189:             * Return true if is Ctrl key.
190:             *
191:             * @return true if is Ctrl key.
192:             */
193:            public native boolean isCtrlKey() /*-{
194:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
195:                   var isCrtl = e.ctrlKey;
196:                   return (isCrtl == null || isCrtl === undefined) ? false : isCrtl;
197:               }-*/;
198:
199:            /**
200:             * Return true if is Shift key.
201:             *
202:             * @return true if is Shift key.
203:             */
204:            public native boolean isShiftKey() /*-{
205:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
206:                   var isShift = e.shiftKey;
207:                   return (isShift == null || isShift === undefined) ? false : isShift;
208:               }-*/;
209:
210:            /**
211:             * @return -1 = none, 0 = left, 1 = middle, 2 right
212:             */
213:            public native int getMouseButton() /*-{
214:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
215:                   return e.button;
216:               }-*/;
217:
218:            /**
219:             * Return the native browser event.
220:             *
221:             * @return the native browser event
222:             */
223:            public native Event getBrowserEvent() /*-{
224:                   var e = this.@com.gwtext.client.core.JsObject::getJsObj()();
225:                   return e.browserEvent;
226:               }-*/;
227:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.