Search in sources :

Example 6 with ShinyApplicationStatusEvent

use of org.rstudio.studio.client.shiny.events.ShinyApplicationStatusEvent in project rstudio by rstudio.

the class ShinyApplication method setShinyViewerType.

private void setShinyViewerType(int viewerType) {
    UIPrefs prefs = pPrefs_.get();
    prefs.shinyViewerType().setGlobalValue(viewerType);
    prefs.writeUIPrefs();
    // snap the app into the new location
    if (currentViewType_ != viewerType && params_ != null) {
        // the old instance
        if (currentViewType_ == ShinyViewerType.SHINY_VIEWER_PANE || currentViewType_ == ShinyViewerType.SHINY_VIEWER_WINDOW) {
            if (currentViewType_ == ShinyViewerType.SHINY_VIEWER_WINDOW) {
                stopOnNextClose_ = false;
                satelliteManager_.closeSatelliteWindow(ShinyApplicationSatellite.NAME);
            } else {
                eventBus_.fireEvent(new ViewerClearedEvent(false));
            }
        }
        // assign new viewer type
        currentViewType_ = viewerType;
        params_.setViewerType(viewerType);
        if (currentViewType_ == ShinyViewerType.SHINY_VIEWER_PANE || currentViewType_ == ShinyViewerType.SHINY_VIEWER_WINDOW || currentViewType_ == ShinyViewerType.SHINY_VIEWER_BROWSER) {
            eventBus_.fireEvent(new ShinyApplicationStatusEvent(params_));
        }
    }
}
Also used : ViewerClearedEvent(org.rstudio.studio.client.workbench.views.viewer.events.ViewerClearedEvent) ShinyApplicationStatusEvent(org.rstudio.studio.client.shiny.events.ShinyApplicationStatusEvent) UIPrefs(org.rstudio.studio.client.workbench.prefs.model.UIPrefs)

Aggregations

ShinyApplicationStatusEvent (org.rstudio.studio.client.shiny.events.ShinyApplicationStatusEvent)6 JsArray (com.google.gwt.core.client.JsArray)1 Command (com.google.gwt.user.client.Command)1 FileSystemItem (org.rstudio.core.client.files.FileSystemItem)1 JsObject (org.rstudio.core.client.js.JsObject)1 InterruptHandler (org.rstudio.studio.client.application.ApplicationInterrupt.InterruptHandler)1 RVersionsInfo (org.rstudio.studio.client.application.model.RVersionsInfo)1 SaveAction (org.rstudio.studio.client.application.model.SaveAction)1 SessionSerializationAction (org.rstudio.studio.client.application.model.SessionSerializationAction)1 CompileOutput (org.rstudio.studio.client.common.compile.CompileOutput)1 CompilePdfCompletedEvent (org.rstudio.studio.client.common.compilepdf.events.CompilePdfCompletedEvent)1 CompilePdfErrorsEvent (org.rstudio.studio.client.common.compilepdf.events.CompilePdfErrorsEvent)1 CompilePdfOutputEvent (org.rstudio.studio.client.common.compilepdf.events.CompilePdfOutputEvent)1 CompilePdfStartedEvent (org.rstudio.studio.client.common.compilepdf.events.CompilePdfStartedEvent)1 CompilePdfResult (org.rstudio.studio.client.common.compilepdf.model.CompilePdfResult)1 ConsoleProcessCreatedEvent (org.rstudio.studio.client.common.console.ConsoleProcessCreatedEvent)1 ServerConsoleOutputEvent (org.rstudio.studio.client.common.console.ServerConsoleOutputEvent)1 ServerConsolePromptEvent (org.rstudio.studio.client.common.console.ServerConsolePromptEvent)1 ServerProcessExitEvent (org.rstudio.studio.client.common.console.ServerProcessExitEvent)1 ErrorHandlerChangedEvent (org.rstudio.studio.client.common.debugging.events.ErrorHandlerChangedEvent)1