use of org.rstudio.studio.client.workbench.views.plots.ui.PlotsToolbar in project rstudio by rstudio.
the class PlotsPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_PLOT, true, commands_.savePlotAsImage());
publishButton_.setPublishHtmlSource(new PublishHtmlSource() {
@Override
public String getTitle() {
return "Current Plot";
}
@Override
public void generatePublishHtml(final CommandWithArg<String> onComplete) {
dependencies_.withRMarkdown("Publishing plots", new Command() {
@Override
public void execute() {
final Size size = ZoomUtils.getZoomedSize(getPlotFrameSize(), new Size(400, 350), new Size(800, 700));
server_.plotsCreateRPubsHtml("Plot", "", size.width, size.height, new SimpleRequestCallback<String>() {
@Override
public void onResponseReceived(String rpubsHtmlFile) {
onComplete.execute(rpubsHtmlFile);
}
});
}
});
}
});
plotsToolbar_ = new PlotsToolbar(commands_, publishButton_);
return plotsToolbar_;
}
Aggregations