Example usage for com.google.gwt.event.shared EventBus addHandlerToSource

List of usage examples for com.google.gwt.event.shared EventBus addHandlerToSource

Introduction

In this page you can find the example usage for com.google.gwt.event.shared EventBus addHandlerToSource.

Prototype

public abstract <H extends EventHandler> HandlerRegistration addHandlerToSource(GwtEvent.Type<H> type,
            Object source, H handler);

Source Link

Usage

From source file:mx.org.pescadormvp.examples.jsonp.client.query.QueryActivityImpl.java

License:Open Source License

/**
 * Called when the activity starts./*from  w  w  w  . j  a v a2s . c o  m*/
 */
@Override
public void start(AcceptsOneWidget container, EventBus eventBus) {

    // Attach the view to the container for this region of the layout.
    // (In this example there's only one region.)
    QueryView view = getView();
    container.setWidget(view);

    // Make sure the view's query area is set up
    if (!view.isQueryAreaRendered()) {

        view.renderQueryArea(messages.beforeQueryTextBox(), messages.afterQueryTextBox());
    }

    // Register to receive events from the view. The view is the first
    // object to hear about user interactions, and mainly it just passes
    // them on here.
    linkHandlerReg = eventBus.addHandlerToSource(PlaceRequestEvent.TYPE, view, this);

    doQuery();
}