Interface HandlerRegistration


public interface HandlerRegistration
Registration objects returned when an event handler is bound (e.g. via EventBus.addHandler(org.gwtproject.event.shared.Event.Type<H>, H)), used to deregister.

To use com.google.web.bindery.event.shared.HandlerRegistration or com.google.gwt.event.shared.HandlerRegistration in a context where a org.gwtproject.web.bindery.event.shared.HandlerRegistration is needed, or the reverse, use handlerRegistration::removeHandler.

A tip: to make a handler deregister itself try something like the following:

new MyHandler() {
  HandlerRegistration reg = MyEvent.register(eventBus, this);

  public void onMyThing(MyEvent event) {
    // do your thing
    reg.removeHandler();
  }
 };
 
  • Method Summary

    Modifier and Type Method Description
    void removeHandler()
    Deregisters the handler associated with this registration object if the handler is still attached to the event source.
  • Method Details

    • removeHandler

      void removeHandler()
      Deregisters the handler associated with this registration object if the handler is still attached to the event source. If the handler is no longer attached to the event source, this is a no-op.