Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.user.client.ui
Class DelegatingFocusListenerCollection

    java.lang.Object
      java.util.AbstractCollection
          java.util.AbstractList
              java.util.ArrayList
                  com.google.gwt.user.client.ui.FocusListenerCollection
                      com.google.gwt.user.client.ui.DelegatingFocusListenerCollection

All Implemented Interfaces:
  FocusListener, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.EventListener, java.util.List, java.util.RandomAccess

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

See Also:
  Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`DelegatingFocusListenerCollection(Widget owner, SourcesFocusEvents delegatedTo)` Constructor for `DelegatingFocusListenerCollection`.

Method Summary
`void` | `onFocus(Widget sender)` Fired when a widget receives keyboard focus.
`void` | `onLostFocus(Widget sender)` Fired when a widget loses keyboard focus.

Methods inherited from class com.google.gwt.user.client.ui.FocusListenerCollection
`fireFocus, fireFocusEvent, fireLostFocus`

Methods inherited from class java.util.ArrayList
`add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize`

Methods inherited from class java.util.AbstractList
`equals, hashCode, iterator, listIterator, listIterator, subList`

Methods inherited from class java.util.AbstractCollection
`containsAll, removeAll, retainAll, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.List
`containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList`

Constructor Detail

### DelegatingFocusListenerCollection

    public DelegatingFocusListenerCollection(Widget owner,
                                             SourcesFocusEvents delegatedTo)

  Constructor for `DelegatingFocusListenerCollection`. *

  Parameters:
    `owner` - owner of listeners
    `delegatedTo` - source of events

Method Detail

### onFocus

    public void onFocus(Widget sender)

  Description copied from interface: `FocusListener`
  Fired when a widget receives keyboard focus.

  Specified by:
    `onFocus` in interface `FocusListener`
  Parameters:
    `sender` - the widget receiving focus.

### onLostFocus

    public void onLostFocus(Widget sender)

  Description copied from interface: `FocusListener`
  Fired when a widget loses keyboard focus.

  Specified by:
    `onLostFocus` in interface `FocusListener`
  Parameters:
    `sender` - the widget losing focus.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD