java.lang.Object | |||||
↳ | java.util.AbstractCollection<E> | ||||
↳ | java.util.AbstractList<E> | ||||
↳ | java.util.ArrayList<E> | ||||
↳ | com.google.gwt.user.client.ui.KeyboardListenerCollection | ||||
↳ | com.google.gwt.user.client.ui.DelegatingKeyboardListenerCollection |
This class is deprecated.
Use delegateEvent(Widget, GwtEvent>)
instead
KeyboardListenerCollection
used to correctly hook up event listeners
to the composite's wrapped widget.
For example, Composite
widgets often need to listen to events
generated on their wrapped widget. Upon the firing of a wrapped widget's
event, the composite widget must fire its own listeners with itself as the
source of the event. To use a DelegatingKeyboardListenerCollection
,
simply use the DelegatingKeyboardListenerCollection
instead of a
KeyboardListenerCollection
. For example, in SuggestBox
, the
following code is used to listen to keyboard events on the SuggestBox
underlying widget.
public void addKeyboardListener(KeyboardListener listener) { if (keyboardListeners == null) { keyboardListeners = new DelegatingKeyboardListenerCollection(this, box); } keyboardListeners.add(listener); }
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.gwt.user.client.ui.KeyboardListener
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.AbstractList
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for
DelegatingKeyboardListenerCollection . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Fired when the user depresses a physical key.
| |||||||||||
Fired when a keyboard action generates a character.
| |||||||||||
Fired when the user releases a physical key.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.KeyboardListenerCollection
| |||||||||||
From class
java.util.ArrayList
| |||||||||||
From class
java.util.AbstractList
| |||||||||||
From class
java.util.AbstractCollection
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.user.client.ui.KeyboardListener
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
From interface
java.util.Collection
| |||||||||||
From interface
java.util.List
|
Constructor for DelegatingKeyboardListenerCollection
.
owner | owner of listeners |
---|---|
delegatedTo | source of events |
Fired when the user depresses a physical key.
sender | the widget that was focused when the event occurred. |
---|---|
keyCode | the physical key that was depressed. Constants for this value are defined in this interface with the KEY prefix. |
modifiers | the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
MODIFIER_SHIFT ,
MODIFIER_CTRL , and
MODIFIER_ALT |
Fired when a keyboard action generates a character. This occurs after onKeyDown and onKeyUp are fired for the physical key that was pressed.
It should be noted that many browsers do not generate keypress events for
non-printing keyCode values, such as KEY_ENTER
or
arrow keys. These keyCodes can be reliably captured either with
onKeyDown(Widget, char, int)
or
onKeyUp(Widget, char, int)
.
sender | the widget that was focused when the event occurred. |
---|---|
keyCode | the Unicode character that was generated by the keyboard action. |
modifiers | the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
MODIFIER_SHIFT ,
MODIFIER_CTRL , and
MODIFIER_ALT |
Fired when the user releases a physical key.
sender | the widget that was focused when the event occurred. |
---|---|
keyCode | the physical key that was released. Constants for this value are defined in this interface with the KEY prefix. |
modifiers | the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
MODIFIER_SHIFT ,
MODIFIER_CTRL , and
MODIFIER_ALT |