Widget.delegateEvent
instead@Deprecated public class DelegatingChangeListenerCollection extends ChangeListenerCollection implements ChangeListener
ChangeListenerCollection
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 DelegatingChangeListenerCollection
,
simply use the DelegatingChangeListenerCollection
instead of a
ChangeListenerCollection
. For example, in SuggestBox
, the
following code is used to listen to change events on the SuggestBox
's
underlying widget.
public void addChangeListener(ChangeListener listener) { if (changeListeners == null) { changeListeners = new DelegatingChangeListenerCollection(this, box); } changeListeners.add(listener); }
modCount
Constructor and Description |
---|
DelegatingChangeListenerCollection(Widget owner,
SourcesChangeEvents delegatedTo)
Deprecated.
Constructor for
DelegatingChangeListenerCollection . |
Modifier and Type | Method and Description |
---|---|
void |
onChange(Widget sender)
Deprecated.
Fired when a widget changes, where 'change' is defined by the widget
sending the event.
|
fireChange
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 DelegatingChangeListenerCollection(Widget owner, SourcesChangeEvents delegatedTo)
DelegatingChangeListenerCollection
.owner
- owner of listenersdelegatedTo
- source of eventspublic void onChange(Widget sender)
ChangeListener
onChange
in interface ChangeListener
sender
- the widget that has changedCopyright © 2016. All rights reserved.