Search in sources :

Example 1 with ResourcePage

use of org.activityinfo.ui.client.page.resource.ResourcePage in project activityinfo by bedatadriven.

the class FormPageLoader method load.

@Override
public void load(final PageId pageId, final PageState pageState, final AsyncCallback<Page> callback) {
    BaseStylesheet.INSTANCE.ensureInjected();
    GWT.runAsync(new RunAsyncCallback() {

        @Override
        public void onSuccess() {
            if (pageState instanceof ResourcePlace) {
                ResourcePlace resourcePlace = (ResourcePlace) pageState;
                ResourcePage page = new ResourcePage(eventBus, resourceLocator, resourcePlace.getPageId(), stateProvider);
                page.navigate(pageState);
                callback.onSuccess(page);
            }
        }

        @Override
        public void onFailure(Throwable throwable) {
            callback.onFailure(throwable);
        }
    });
}
Also used : ResourcePlace(org.activityinfo.ui.client.page.resource.ResourcePlace) RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) ResourcePage(org.activityinfo.ui.client.page.resource.ResourcePage)

Aggregations

RunAsyncCallback (com.google.gwt.core.client.RunAsyncCallback)1 ResourcePage (org.activityinfo.ui.client.page.resource.ResourcePage)1 ResourcePlace (org.activityinfo.ui.client.page.resource.ResourcePlace)1