Example usage for com.google.gwt.activity.shared AbstractActivity AbstractActivity

List of usage examples for com.google.gwt.activity.shared AbstractActivity AbstractActivity

Introduction

In this page you can find the example usage for com.google.gwt.activity.shared AbstractActivity AbstractActivity.

Prototype

AbstractActivity

Source Link

Usage

From source file:com.google.gwt.sample.mobilewebapp.client.activity.AppActivityMapper.java

License:Apache License

public Activity getActivity(final Place place) {
    if (place instanceof TaskListPlace) {
        // The list of tasks.
        return new AbstractActivity() {
            @Override/* w  ww . j  a v  a2s. c  om*/
            public void start(AcceptsOneWidget panel, EventBus eventBus) {
                TaskListPresenter presenter = new TaskListPresenter(clientFactory, (TaskListPlace) place);
                presenter.start(eventBus);
                panel.setWidget(presenter);
            }

            /*
             * Note no call to presenter.stop(). The TaskListViews do that
             * themselves as a side effect of setPresenter.
             */
        };
    }

    if (place instanceof TaskPlace) {
        // Editable view of a task.
        return new TaskActivity(clientFactory, (TaskPlace) place);
    }

    return null;
}