use of org.rstudio.studio.client.shiny.model.ShinyViewerType in project rstudio by rstudio.
the class ShinyViewerTypePopupMenu method getDynamicPopupMenu.
@Override
public void getDynamicPopupMenu(final ToolbarPopupMenu.DynamicPopupMenuCallback callback) {
final ToolbarPopupMenu menu = this;
server_.getShinyViewerType(new ServerRequestCallback<ShinyViewerType>() {
@Override
public void onResponseReceived(ShinyViewerType response) {
int viewerType = response.getViewerType();
commands_.shinyRunInPane().setChecked(false);
commands_.shinyRunInViewer().setChecked(false);
commands_.shinyRunInBrowser().setChecked(false);
if (ShinyViewerType.SHINY_VIEWER_PANE == viewerType)
commands_.shinyRunInPane().setChecked(true);
if (ShinyViewerType.SHINY_VIEWER_WINDOW == viewerType)
commands_.shinyRunInViewer().setChecked(true);
if (ShinyViewerType.SHINY_VIEWER_BROWSER == viewerType)
commands_.shinyRunInBrowser().setChecked(true);
callback.onPopupMenu(menu);
}
@Override
public void onError(ServerError error) {
callback.onPopupMenu(menu);
}
});
}
Aggregations