private <H extends EventHandler> void registerVisibleHandler(HandlerInformation<H> handlerInformation) { HandlerRegistration handlerRegistration = getEventBus().addHandler(handlerInformation.type, handlerInformation.eventHandler); visibleHandlerRegistrations.add(handlerRegistration); }
/** * Fires the given event to the handlers listening to the event's type. * <p> * Any exceptions thrown by handlers will be bundled into a * {@link com.google.gwt.event.shared.UmbrellaException UmbrellaException} and then re-thrown after all handlers have * completed. An exception thrown by a handler will not prevent other handlers * from executing. * * @param event the event */ public void fireEvent(Event<?> event) { getEventBus().fireEventFromSource(event, this); }
/** * Registers an event handler towards the {@link EventBus} and registers it to be automatically removed when {@link * #unbind()} is called. This is usually the desired behavior, but if you want to unregister handlers manually use * {@link EventBus#addHandler} instead. * * @param <H> The handler type. * @param type See {@link Type}. * @param handler The handler to register. * * @see #addVisibleHandler(Type, EventHandler) */ protected <H extends EventHandler> void addRegisteredHandler(Type<H> type, H handler) { registerHandler(getEventBus().addHandler(type, handler)); }