Adds a {@link FocusEvent} handler.

@param handler the handler
@return returns the handler registration
11183
@Override
    public HandlerRegistration addFocusHandler(FocusHandler handler) {
	return ensureHandlers().addHandler(FocusEvent.getType(), handler);
    }
323078
function( type, handler ) {

      if( handler === void 0 || handler === null )
        throw new Error( 'Missing argument "handler"' )

      if( typeof handler !== 'function' && typeof handler.handleEvent !== 'function' )
        throw new TypeError( 'Handler must be a function.' )

      this._events[ type ] ?
        this._events[ type ].push( handler ) :
        this._events[ type ] = [ handler ]

      if( Emitter.warn && this._events[ type ].length > this._maxListeners ) {
        if( this._maxListeners > 0 && !this._memLeakDetected ) {
          this._memLeakDetected = true
          console.warn(
            'WARNING: Possible event emitter memory leak detected.',
            this._events[ type ].length, 'event handlers added.',
            'Use emitter.setMaxListeners() to increase the threshold.'
          )
          console.trace()
        }
      }

      return this

    }
1303837
def add_handler(self, handler):
        ''' 
        '''
        handler['logger'] = self._get_logger(handler)
        handler['reads'] = 0
        handler['data_read'] = 0

        self.capture_handlers.append(handler)
544909
public void addHandler(final Handler handler, final boolean wait) throws InterruptedException, CouldNotPerformException {
        try {
            listener.addHandler(handler, wait);
        } catch (CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not register Handler!", ex);
        }
    }
650348
@Api
	public final HandlerRegistration addMapModelHandler(final MapModelHandler handler) {
		return handlerManager.addHandler(MapModelEvent.TYPE, handler);
	}
761182
@Override
  public void registerErrorHandler(final EventHandler<Exception> handler) {
    this.clientEventListener.registerErrorHandler(handler);
    this.serverEventListener.registerErrorHandler(handler);
  }
445573
public JsHandlerRegistration addGeometryEditMoveHandler(final GeometryEditMoveHandler handler) {
		org.geomajas.plugin.editing.client.event.GeometryEditMoveHandler h;
		h = new org.geomajas.plugin.editing.client.event.GeometryEditMoveHandler() {

			public void onGeometryEditMove(GeometryEditMoveEvent event) {
				List<GeometryIndex> indices = event.getIndices();
				handler.onGeometryEditMove(new org.geomajas.plugin.editing.jsapi.client.event.GeometryEditMoveEvent(
						event.getGeometry(), indices.toArray(new GeometryIndex[indices.size()])));
			}
		};
		HandlerRegistration registration = delegate.addGeometryEditMoveHandler(h);
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
371168
public HandlerRegistration addIconClickHandler(final ClickHandler handler) {

        final HandlerRegistration internalHandlerRegistration = m_iconPanel.addDomHandler(
            handler,
            ClickEvent.getType());
        m_iconClickHandlers.add(handler);
        HandlerRegistration result = new HandlerRegistration() {

            public void removeHandler() {

                internalHandlerRegistration.removeHandler();
                m_iconClickHandlers.remove(handler);
            }
        };
        return result;
    }
580574
function (eventType, handler) {
		// simplest possible event model for internal use
		this.element['on' + eventType] = function () {
			var evt = win.event;
			evt.target = evt.srcElement;
			handler(evt);
		};
		return this;
	}
1200725
@Api
	public final HandlerRegistration addMapModelChangedHandler(final MapModelChangedHandler handler) {
		return handlerManager.addHandler(MapModelChangedHandler.TYPE, handler);
	}
299175
public HandlerRegistration addInputHandler(JQMInputHandler handler) {
	    if (handler == null) return null;
	    return JQMHandlerRegistration.registerJQueryHandler(new WidgetHandlerCounter() {
            @Override
            public int getHandlerCountForWidget(GwtEvent.Type<?> type) {
                return getHandlerCount(type);
            }
        }, this, handler, JQMComponentEvents.INPUT,
        JQMEventFactory.getType(JQMComponentEvents.INPUT, JQMInputHandler.class));
	}
689446
public JsHandlerRegistration addGeometryEditInsertHandler(final GeometryEditInsertHandler handler) {
		org.geomajas.plugin.editing.client.event.GeometryEditInsertHandler h;
		h = new org.geomajas.plugin.editing.client.event.GeometryEditInsertHandler() {

			public void onGeometryEditInsert(GeometryEditInsertEvent event) {
				org.geomajas.plugin.editing.jsapi.client.event.GeometryEditInsertEvent e;
				List<GeometryIndex> indices = event.getIndices();
				e = new org.geomajas.plugin.editing.jsapi.client.event.GeometryEditInsertEvent(event.getGeometry(),
						indices.toArray(new GeometryIndex[indices.size()]));
				handler.onGeometryEditInsert(e);
			}
		};
		HandlerRegistration registration = delegate.addGeometryEditInsertHandler(h);
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
1118772
public JsHandlerRegistration addGeometryEditRemoveHandler(final GeometryEditRemoveHandler handler) {
		org.geomajas.plugin.editing.client.event.GeometryEditRemoveHandler h;
		h = new org.geomajas.plugin.editing.client.event.GeometryEditRemoveHandler() {

			public void onGeometryEditRemove(GeometryEditRemoveEvent event) {
				List<GeometryIndex> indices = event.getIndices();
				handler.onGeometryEditRemove(new org.geomajas.plugin.editing.jsapi.client.event.GeometryEditRemoveEvent(
						event.getGeometry(), indices.toArray(new GeometryIndex[indices.size()])));
			}
		};
		HandlerRegistration registration = delegate.addGeometryEditRemoveHandler(h);
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
897257
public static ClickHandler chain (final ClickHandler... handlers)
    {
        return new ClickHandler() {
            public void onClick (ClickEvent event) {
                for (ClickHandler handler : handlers) {
                    try {
                        handler.onClick(event);
                    } catch (Exception e) {
                        Console.log("Chained click handler failed", "handler", handler, e);
                    }
                }
            }
        };
    }
412156
public static HandlerRegistration bind (HasKeyDownHandlers target, ClickHandler onEnter)
    {
        return target.addKeyDownHandler(new EnterClickAdapter(onEnter));
    }
602551
@SuppressWarnings("unchecked")
    public <E> MessageHandler<? super E> addSentMessageHandler(Class<E> type,
            MessageHandler<? super E> handler) {
        sentMessageHandlerCache.clear();
        return (MessageHandler<? super E>) sentMessageHandlers.put(type, handler);
    }
641342
public void addHandler(Handler handler) {
        if (null == handlers) {
            handlers = new ArrayList<>();
        }
        handlers.add(handler);
    }