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: package com.gwtext.client.util;
009:
010: import com.gwtext.client.core.BaseConfig;
011: import com.gwtext.client.core.EventCallback;
012:
013: /**
014: * KeyNav configuration class.
015: */
016: public class KeyNavConfig extends BaseConfig {
017:
018: /**
019: * Register handler for the Enter key.
020: *
021: * @param cb the key handler
022: */
023: public native void onEnter(EventCallback cb) /*-{
024: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
025: config['enter'] = function(e) {
026: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
027: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
028: };
029: }-*/;
030:
031: /**
032: * Register handler for the Left arrow key.
033: *
034: * @param cb the key handler
035: */
036: public native void onLeft(EventCallback cb) /*-{
037: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
038: config['left'] = function(e) {
039: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
040: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
041: };
042: }-*/;
043:
044: /**
045: * Register handler for the Right arrow key.
046: *
047: * @param cb the key handler
048: */
049: public native void onRight(EventCallback cb) /*-{
050: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
051: config['right'] = function(e) {
052: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
053: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
054: };
055: }-*/;
056:
057: /**
058: * Register handler for the Up arrow key.
059: *
060: * @param cb the key handler
061: */
062: public native void onUp(EventCallback cb) /*-{
063: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
064: config['up'] = function(e) {
065: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
066: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
067: };
068: }-*/;
069:
070: /**
071: * Register handler for the Down arrow key.
072: *
073: * @param cb the key handler
074: */
075: public native void onDown(EventCallback cb) /*-{
076: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
077: config['down'] = function(e) {
078: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
079: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
080: };
081: }-*/;
082:
083: /**
084: * Register handler for the Tab key.
085: *
086: * @param cb the key handler
087: */
088: public native void onTab(EventCallback cb) /*-{
089: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
090: config['tab'] = function(e) {
091: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
092: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
093: };
094: }-*/;
095:
096: /**
097: * Register handler for the Esc key.
098: *
099: * @param cb the key handler
100: */
101: public native void onEsc(EventCallback cb) /*-{
102: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
103: config['esc'] = function(e) {
104: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
105: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
106: };
107: }-*/;
108:
109: /**
110: * Register handler for the PageUp key.
111: *
112: * @param cb the key handler
113: */
114: public native void onPageUp(EventCallback cb) /*-{
115: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
116: config['pageUp'] = function(e) {
117: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
118: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
119: };
120: }-*/;
121:
122: /**
123: * Register handler for the PageDown key.
124: *
125: * @param cb the key handler
126: */
127: public native void onPageDown(EventCallback cb) /*-{
128: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
129: config['pageDown'] = function(e) {
130: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
131: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
132: };
133: }-*/;
134:
135: /**
136: * Register handler for the Del key.
137: *
138: * @param cb the key handler
139: */
140: public native void onDel(EventCallback cb) /*-{
141: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
142: config['del'] = function(e) {
143: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
144: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
145: };
146: }-*/;
147:
148: /**
149: * Register handler for the Home key.
150: *
151: * @param cb the key handler
152: */
153: public native void onHome(EventCallback cb) /*-{
154: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
155: config['home'] = function(e) {
156: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
157: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
158: };
159: }-*/;
160:
161: /**
162: * Register handler for the End key.
163: *
164: * @param cb the key handler
165: */
166: public native void onEnd(EventCallback cb) /*-{
167: var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
168: config['end'] = function(e) {
169: var eJ = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e);
170: cb.@com.gwtext.client.core.EventCallback::execute(Lcom/gwtext/client/core/EventObject;)(eJ);
171: };
172: }-*/;
173: }
|