|
@@ -16,46 +16,50 @@ |
16 |
16 |
|
|
17 |
17 |
|
package com.google.gwt.gen2.event.dom.client; |
18 |
18 |
|
|
19 |
|
- |
import com.google.gwt.gen2.event.shared.HandlerAdaptor; |
20 |
|
- |
import com.google.gwt.gen2.event.shared.HasHandlerManager; |
|
19 |
+ |
import com.google.gwt.gen2.event.shared.*; |
21 |
20 |
|
|
22 |
21 |
|
/** |
23 |
22 |
|
* Convenience interface used to implement all key handlers at once. In the |
24 |
23 |
|
* unlikely event that more key handler subtypes are added to GWT, this |
25 |
24 |
|
* interface will be expanded, so only implement this interface if you wish to |
26 |
25 |
|
* have your widget break if a new key event type is introduced. |
27 |
|
- |
* |
|
26 |
+ |
* |
28 |
27 |
|
* @deprecated use the com.google.gwt.event.dom.client classes instead |
29 |
28 |
|
*/ |
30 |
29 |
|
@Deprecated |
31 |
30 |
|
public interface HasAllKeyHandlers extends HasKeyUpHandlers, |
32 |
|
- |
HasKeyDownHandlers, 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 |
38 |
|
- |
KeyDownHandler, KeyUpHandler, KeyPressHandler { |
39 |
|
- |
|
40 |
|
- |
/** |
41 |
|
- |
* Convenience method to add all key handlers at once. |
42 |
|
- |
* |
43 |
|
- |
* @param <EventSourceType> event source type |
44 |
|
- |
* @param <EventHandler> event handler type |
45 |
|
- |
* @param source event source |
46 |
|
- |
* @param handlers handlers to add |
47 |
|
- |
*/ |
48 |
|
- |
public static <EventSourceType extends HasHandlerManager & HasAllKeyHandlers, EventHandler extends KeyDownHandler & KeyUpHandler & KeyPressHandler> void addHandlers( |
49 |
|
- |
EventSourceType source, EventHandler handlers) { |
50 |
|
- |
source.addKeyDownHandler(handlers); |
51 |
|
- |
source.addKeyPressHandler(handlers); |
52 |
|
- |
source.addKeyUpHandler(handlers); |
53 |
|
- |
} |
|
31 |
+ |
HasKeyDownHandlers, |
|
32 |
+ |
HasKeyPressHandlers |
|
33 |
+ |
{ |
54 |
34 |
|
|
55 |
35 |
|
/** |
56 |
|
- |
* Constructor. |
|
36 |
+ |
* Adaptor used to create and add all the Keyboard events at once. |
57 |
37 |
|
*/ |
58 |
|
- |
public Adaptor() { |
|
38 |
+ |
public abstract static class Adaptor extends HandlerAdaptor implements KeyDownHandler, |
|
39 |
+ |
KeyUpHandler, |
|
40 |
+ |
KeyPressHandler |
|
41 |
+ |
{ |
|
42 |
+ |
|
|
43 |
+ |
/** |
|
44 |
+ |
* Convenience method to add all key handlers at once. |
|
45 |
+ |
* |
|
46 |
+ |
* @param <EventSourceType> event source type |
|
47 |
+ |
* @param <EventHandler> event handler type |
|
48 |
+ |
* @param source event source |
|
49 |
+ |
* @param handlers handlers to add |
|
50 |
+ |
*/ |
|
51 |
+ |
public static <EventSourceType extends HasHandlerManager & HasAllKeyHandlers, EventHandler extends KeyDownHandler & KeyUpHandler & KeyPressHandler> void addHandlers( EventSourceType source, EventHandler handlers ) |
|
52 |
+ |
{ |
|
53 |
+ |
source.addKeyDownHandler( handlers ); |
|
54 |
+ |
source.addKeyPressHandler( handlers ); |
|
55 |
+ |
source.addKeyUpHandler( handlers ); |
|
56 |
+ |
} |
|
57 |
+ |
|
|
58 |
+ |
/** |
|
59 |
+ |
* Constructor. |
|
60 |
+ |
*/ |
|
61 |
+ |
public Adaptor() |
|
62 |
+ |
{ |
|
63 |
+ |
} |
59 |
64 |
|
} |
60 |
|
- |
} |
61 |
65 |
|
} |