public class

DelegatingFocusListenerCollection

extends FocusListenerCollection
implements FocusListener
java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractList<E>
       ↳ java.util.ArrayList<E>
         ↳ com.google.gwt.user.client.ui.FocusListenerCollection
           ↳ com.google.gwt.user.client.ui.DelegatingFocusListenerCollection

This class is deprecated.
Use delegateEvent(Widget, GwtEvent) instead

Class Overview

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);
  }

Summary

[Expand]
Inherited Fields
From class java.util.AbstractList
Public Constructors
DelegatingFocusListenerCollection(Widget owner, SourcesFocusEvents delegatedTo)
Public Methods
void onFocus(Widget sender)
Fired when a widget receives keyboard focus.
void onLostFocus(Widget sender)
Fired when a widget loses keyboard focus.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.FocusListenerCollection
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.FocusListener
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List

Public Constructors

public DelegatingFocusListenerCollection (Widget owner, SourcesFocusEvents delegatedTo)

Parameters
owner owner of listeners
delegatedTo source of events

Public Methods

public void onFocus (Widget sender)

Fired when a widget receives keyboard focus.

Parameters
sender the widget receiving focus.

public void onLostFocus (Widget sender)

Fired when a widget loses keyboard focus.

Parameters
sender the widget losing focus.