Search in sources :

Example 6 with RunAsyncCallback

use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.

the class ReportLoader method load.

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

        @Override
        public void onFailure(Throwable reason) {
            callback.onFailure(reason);
        }

        @Override
        public void onSuccess() {
            if (ReportsPage.PAGE_ID.equals(pageId)) {
                callback.onSuccess(reportsPage.get());
            } else if (ReportDesignPage.PAGE_ID.equals(pageId)) {
                ReportDesignPage page = reportDesignPage.get();
                page.navigate(pageState);
                callback.onSuccess(page);
            } else {
                GWT.log("ReportLoader received a request it didn't know how to handle: " + pageState.toString(), null);
            }
        }
    });
}
Also used : RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback)

Example 7 with RunAsyncCallback

use of com.google.gwt.core.client.RunAsyncCallback in project pentaho-platform by pentaho.

the class MantleController method activateWaitingSecurityPanel.

public void activateWaitingSecurityPanel(boolean activate) {
    if (activate && (adminPanelAwaitingActivation != null)) {
        for (int i = 0; i < MantleXul.getInstance().getAdminContentDeck().getWidgetCount(); i++) {
            Widget w = MantleXul.getInstance().getAdminContentDeck().getWidget(i);
            if (adminPanelAwaitingActivation.id.equals(w.getElement().getId())) {
                ISysAdminPanel sysAdminPanel = sysAdminPanelsMap.get(adminPanelAwaitingActivation.id);
                if (sysAdminPanel != null) {
                    sysAdminPanel.activate();
                }
                break;
            }
        }
        GWT.runAsync(new RunAsyncCallback() {

            public void onSuccess() {
                if (UserRolesAdminPanelController.getInstance().getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadUserRolesAdminPanel();
                    UserRolesAdminPanelController.getInstance().getElement().setId((UserRolesAdminPanelController.getInstance()).getId());
                } else if ((EmailAdminPanelController.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadEmailAdminPanel();
                    EmailAdminPanelController.getInstance().getElement().setId((EmailAdminPanelController.getInstance()).getId());
                } else if ((ContentCleanerPanel.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadSettingsPanel();
                    ContentCleanerPanel.getInstance().getElement().setId((ContentCleanerPanel.getInstance()).getId());
                } else {
                    model.loadAdminContent(adminPanelAwaitingActivation.id, adminPanelAwaitingActivation.url);
                }
            }

            public void onFailure(Throwable reason) {
            }
        });
    } else if (!activate) {
        adminPanelAwaitingActivation = null;
    }
}
Also used : RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) Widget(com.google.gwt.user.client.ui.Widget) ISysAdminPanel(org.pentaho.mantle.client.admin.ISysAdminPanel)

Example 8 with RunAsyncCallback

use of com.google.gwt.core.client.RunAsyncCallback in project rstudio by rstudio.

the class RStudio method delayLoadApplication.

private void delayLoadApplication(final Command dismissProgressAnimation) {
    final RunAsyncCallback runCallback = new RunAsyncCallback() {

        public void onFailure(Throwable reason) {
            dismissProgressAnimation.execute();
            Window.alert("Error: " + reason.getMessage());
        }

        public void onSuccess() {
            // TODO (gary) This early loading of XTermWidget dependencies needs to be
            // removed once I figure out why XTermWidget.load in 
            // TerminalPane:createMainWidget) isn't sufficient. Suspect due to xterm.js
            // loading its add-ons (fit.js) but need to investigate. 
            XTermWidget.load(new Command() {

                public void execute() {
                    AceEditor.load(new Command() {

                        public void execute() {
                            ensureStylesInjected();
                            String view = Window.Location.getParameter("view");
                            if (VCSApplication.NAME.equals(view)) {
                                RStudioGinjector.INSTANCE.getVCSApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else if (HTMLPreviewApplication.NAME.equals(view)) {
                                RStudioGinjector.INSTANCE.getHTMLPreviewApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else if (ShinyApplicationSatellite.NAME.equals(view)) {
                                RStudioGinjector.INSTANCE.getShinyApplicationSatellite().go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else if (RmdOutputSatellite.NAME.equals(view)) {
                                RStudioGinjector.INSTANCE.getRmdOutputSatellite().go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else if (view != null && view.startsWith(SourceSatellite.NAME_PREFIX)) {
                                SourceSatellite satellite = new SourceSatellite(view);
                                satellite.go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else if (view != null && view.startsWith(ChunkSatellite.NAME_PREFIX)) {
                                ChunkSatellite satellite = new ChunkSatellite(view);
                                satellite.go(RootLayoutPanel.get(), dismissProgressAnimation);
                            } else {
                                RStudioGinjector.INSTANCE.getApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
                            }
                        }
                    });
                }
            });
        }
    };
    GWT.runAsync(runCallback);
}
Also used : RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) Command(com.google.gwt.user.client.Command) SourceSatellite(org.rstudio.studio.client.workbench.views.source.SourceSatellite) ChunkSatellite(org.rstudio.studio.client.workbench.views.source.editors.text.ChunkSatellite)

Example 9 with RunAsyncCallback

use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.

the class LocalController method loadSynchronizerImpl.

private void loadSynchronizerImpl(final AsyncCallback<Synchronizer> callback) {
    Log.trace("loadSynchronizerImpl() starting...");
    GWT.runAsync(new RunAsyncCallback() {

        @Override
        public void onFailure(Throwable throwable) {
            Log.trace("loadSynchronizerImpl() failed");
            callback.onFailure(throwable);
        }

        @Override
        public void onSuccess() {
            Log.trace("loadSynchronizerImpl() succeeded");
            Synchronizer impl = null;
            try {
                impl = synchronizerProvider.get();
            } catch (Exception caught) {
                Log.error("SynchronizationImpl constructor threw exception", caught);
                callback.onFailure(caught);
                return;
            }
            callback.onSuccess(impl);
        }
    });
}
Also used : RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) PermissionRefusedException(org.activityinfo.ui.client.local.capability.PermissionRefusedException)

Example 10 with RunAsyncCallback

use of com.google.gwt.core.client.RunAsyncCallback 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)13 Request (com.google.gwt.http.client.Request)1 RequestBuilder (com.google.gwt.http.client.RequestBuilder)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 Command (com.google.gwt.user.client.Command)1 DeckPanel (com.google.gwt.user.client.ui.DeckPanel)1 RootLayoutPanel (com.google.gwt.user.client.ui.RootLayoutPanel)1 Widget (com.google.gwt.user.client.ui.Widget)1 PermissionRefusedException (org.activityinfo.client.local.capability.PermissionRefusedException)1 Synchronizer (org.activityinfo.client.local.sync.Synchronizer)1 Page (org.activityinfo.client.page.Page)1 IndicatorLinkPage (org.activityinfo.client.page.config.link.IndicatorLinkPage)1 GetSchema (org.activityinfo.legacy.shared.command.GetSchema)1 SchemaDTO (org.activityinfo.legacy.shared.model.SchemaDTO)1 GetSchema (org.activityinfo.shared.command.GetSchema)1 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)1 PermissionRefusedException (org.activityinfo.ui.client.local.capability.PermissionRefusedException)1 IndicatorLinkPage (org.activityinfo.ui.client.page.config.link.IndicatorLinkPage)1