|
@@ -1,63 +1,63 @@ |
1 |
|
- |
/* |
2 |
|
- |
* Copyright 2008 Google Inc. |
3 |
|
- |
* |
4 |
|
- |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
5 |
|
- |
* use this file except in compliance with the License. You may obtain a copy of |
6 |
|
- |
* the License at |
7 |
|
- |
* |
8 |
|
- |
* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
|
- |
* |
10 |
|
- |
* Unless required by applicable law or agreed to in writing, software |
11 |
|
- |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
12 |
|
- |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
13 |
|
- |
* License for the specific language governing permissions and limitations under |
14 |
|
- |
* the License. |
15 |
|
- |
*/ |
16 |
|
- |
|
17 |
|
- |
package com.google.gwt.gen2.event.dom.client; |
18 |
|
- |
|
19 |
|
- |
import com.google.gwt.gen2.event.shared.*; |
20 |
|
- |
|
21 |
|
- |
/** |
22 |
|
- |
* Convenience interface used to implement all key handlers at once. In the |
23 |
|
- |
* unlikely event that more key handler subtypes are added to GWT, this |
24 |
|
- |
* interface will be expanded, so only implement this interface if you wish to |
25 |
|
- |
* have your widget break if a new key event type is introduced. |
26 |
|
- |
* |
27 |
|
- |
* @deprecated use the com.google.gwt.event.dom.client classes instead |
28 |
|
- |
*/ |
29 |
|
- |
@Deprecated |
30 |
|
- |
public interface HasAllKeyHandlers extends HasKeyUpHandlers, |
31 |
|
- |
HasKeyDownHandlers, |
32 |
|
- |
HasKeyPressHandlers { |
33 |
|
- |
|
34 |
|
- |
/** |
35 |
|
- |
* Adaptor used to create and add all the Keyboard events at once. |
36 |
|
- |
*/ |
37 |
|
- |
public abstract static class Adaptor extends HandlerAdaptor implements KeyDownHandler, |
38 |
|
- |
KeyUpHandler, |
39 |
|
- |
KeyPressHandler { |
40 |
|
- |
|
41 |
|
- |
/** |
42 |
|
- |
* Convenience method to add all key handlers at once. |
43 |
|
- |
* |
44 |
|
- |
* @param <EventSourceType> event source type |
45 |
|
- |
* @param <EventHandler> event handler type |
46 |
|
- |
* @param source event source |
47 |
|
- |
* @param handlers handlers to add |
48 |
|
- |
*/ |
49 |
|
- |
public static <EventSourceType extends HasHandlerManager & HasAllKeyHandlers, EventHandler extends KeyDownHandler & KeyUpHandler & KeyPressHandler> |
50 |
|
- |
void addHandlers( |
51 |
|
- |
EventSourceType source, EventHandler handlers ) { |
52 |
|
- |
source.addKeyDownHandler( handlers ); |
53 |
|
- |
source.addKeyPressHandler( handlers ); |
54 |
|
- |
source.addKeyUpHandler( handlers ); |
55 |
|
- |
} |
56 |
|
- |
|
57 |
|
- |
/** |
58 |
|
- |
* Constructor. |
59 |
|
- |
*/ |
60 |
|
- |
public Adaptor() { |
61 |
|
- |
} |
62 |
|
- |
} |
63 |
|
- |
} |
|
1 |
+ |
/* |
|
2 |
+ |
* Copyright 2008 Google Inc. |
|
3 |
+ |
* |
|
4 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
5 |
+ |
* use this file except in compliance with the License. You may obtain a copy of |
|
6 |
+ |
* the License at |
|
7 |
+ |
* |
|
8 |
+ |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
+ |
* |
|
10 |
+ |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
+ |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
12 |
+ |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
13 |
+ |
* License for the specific language governing permissions and limitations under |
|
14 |
+ |
* the License. |
|
15 |
+ |
*/ |
|
16 |
+ |
|
|
17 |
+ |
package com.google.gwt.gen2.event.dom.client; |
|
18 |
+ |
|
|
19 |
+ |
import com.google.gwt.gen2.event.shared.*; |
|
20 |
+ |
|
|
21 |
+ |
/** |
|
22 |
+ |
* Convenience interface used to implement all key handlers at once. In the |
|
23 |
+ |
* unlikely event that more key handler subtypes are added to GWT, this |
|
24 |
+ |
* interface will be expanded, so only implement this interface if you wish to |
|
25 |
+ |
* have your widget break if a new key event type is introduced. |
|
26 |
+ |
* |
|
27 |
+ |
* @deprecated use the com.google.gwt.event.dom.client classes instead |
|
28 |
+ |
*/ |
|
29 |
+ |
@Deprecated |
|
30 |
+ |
public interface HasAllKeyHandlers extends HasKeyUpHandlers, |
|
31 |
+ |
HasKeyDownHandlers, |
|
32 |
+ |
HasKeyPressHandlers { |
|
33 |
+ |
|
|
34 |
+ |
/** |
|
35 |
+ |
* Adaptor used to create and add all the Keyboard events at once. |
|
36 |
+ |
*/ |
|
37 |
+ |
public abstract static class Adaptor extends HandlerAdaptor implements KeyDownHandler, |
|
38 |
+ |
KeyUpHandler, |
|
39 |
+ |
KeyPressHandler { |
|
40 |
+ |
|
|
41 |
+ |
/** |
|
42 |
+ |
* Convenience method to add all key handlers at once. |
|
43 |
+ |
* |
|
44 |
+ |
* @param <EventSourceType> event source type |
|
45 |
+ |
* @param <EventHandler> event handler type |
|
46 |
+ |
* @param source event source |
|
47 |
+ |
* @param handlers handlers to add |
|
48 |
+ |
*/ |
|
49 |
+ |
public static <EventSourceType extends HasHandlerManager & HasAllKeyHandlers, EventHandler extends KeyDownHandler & KeyUpHandler & KeyPressHandler> |
|
50 |
+ |
void addHandlers( |
|
51 |
+ |
EventSourceType source, EventHandler handlers ) { |
|
52 |
+ |
source.addKeyDownHandler( handlers ); |
|
53 |
+ |
source.addKeyPressHandler( handlers ); |
|
54 |
+ |
source.addKeyUpHandler( handlers ); |
|
55 |
+ |
} |
|
56 |
+ |
|
|
57 |
+ |
/** |
|
58 |
+ |
* Constructor. |
|
59 |
+ |
*/ |
|
60 |
+ |
public Adaptor() { |
|
61 |
+ |
} |
|
62 |
+ |
} |
|
63 |
+ |
} |