urlBox_.addStyleName(ThemeStyles.INSTANCE.selectableText());
urlBox_.getElement().getStyle().setMarginRight(7, Unit.PX);
toolbar.addLeftWidget(urlBox_);
toolbar.addLeftSeparator();
ToolbarButton popoutButton =
commands.viewerPopout().createToolbarButton();
popoutButton.setText("Open in Browser");
toolbar.addLeftWidget(popoutButton);
deployButtonSeparator_ = toolbar.addLeftSeparator();
deployButton_ = new ToolbarButton("Publish",
commands.shinyAppsDeploy().getImageResource(),
new ClickHandler()
{
@Override
public void onClick(ClickEvent evt)
{
if (appParams_ != null)
{
// we initiate deployment from a specific file; choose server.R
// (it's okay if it doesn't exist since we're just going to
// deploy its parent)
String deployPath = appParams_.getPath();
if (!deployPath.endsWith("/"))
deployPath += "/";
deployPath += "server.R";
events_.fireEvent(new ShinyAppsActionEvent(
ShinyAppsActionEvent.ACTION_TYPE_DEPLOY,
deployPath));
}
}
});
toolbar.addLeftWidget(deployButton_);
ToolbarButton refreshButton =
commands.reloadShinyApp().createToolbarButton();
refreshButton.setLeftImage(commands.viewerRefresh().getImageResource());
refreshButton.getElement().getStyle().setMarginTop(2, Unit.PX);
toolbar.addRightWidget(refreshButton);
}