Search in sources :

Example 1 with ChunkSatellite

use of org.rstudio.studio.client.workbench.views.source.editors.text.ChunkSatellite 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)

Aggregations

RunAsyncCallback (com.google.gwt.core.client.RunAsyncCallback)1 Command (com.google.gwt.user.client.Command)1 SourceSatellite (org.rstudio.studio.client.workbench.views.source.SourceSatellite)1 ChunkSatellite (org.rstudio.studio.client.workbench.views.source.editors.text.ChunkSatellite)1