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_));
}
}
}
Aggregations