@Deprecated public class DelegatingFocusListenerCollection extends FocusListenerCollection implements FocusListener
FocusListenerCollection
used to correctly hook up listeners which
need to listen to events from another source.
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 DelegatingFocusListenerCollection
,
simply use the DelegatingFocusListenerCollection
instead of a
FocusListenerCollection
. For example, in SuggestBox
, the
following code is used to listen to focus events on the SuggestBox
's
underlying widget.
public void addFocusListener(FocusListener listener) { if (focusListeners == null) { focusListeners = new DelegatingFocusListenerCollection(this, box); } focusListeners.add(listener); }
modCount
Constructor and Description |
---|
DelegatingFocusListenerCollection(Widget owner,
SourcesFocusEvents delegatedTo)
Deprecated.
Constructor for
DelegatingFocusListenerCollection . |
Modifier and Type | Method and Description |
---|---|
void |
onFocus(Widget sender)
Deprecated.
Fired when a widget receives keyboard focus.
|
void |
onLostFocus(Widget sender)
Deprecated.
Fired when a widget loses keyboard focus.
|
fireFocus, fireFocusEvent, fireLostFocus
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
equals, hashCode, iterator, listIterator, listIterator, subList
containsAll, removeAll, retainAll, toString
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
public DelegatingFocusListenerCollection(Widget owner, SourcesFocusEvents delegatedTo)
DelegatingFocusListenerCollection
. *owner
- owner of listenersdelegatedTo
- source of eventspublic void onFocus(Widget sender)
FocusListener
onFocus
in interface FocusListener
sender
- the widget receiving focus.public void onLostFocus(Widget sender)
FocusListener
onLostFocus
in interface FocusListener
sender
- the widget losing focus.Copyright © 2016. All rights reserved.