use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class PackagesPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
// install packages
toolbar.addLeftWidget(commands_.installPackage().createToolbarButton());
toolbar.addLeftSeparator();
// update packages
toolbar.addLeftWidget(commands_.updatePackages().createToolbarButton());
prePackratSeparator_ = toolbar.addLeftSeparator();
// packrat (all packrat UI starts out hidden and then appears
// in response to changes in the packages state)
// create packrat bootstrap button
packratBootstrapButton_ = commands_.packratBootstrap().createToolbarButton(false);
toolbar.addLeftWidget(packratBootstrapButton_);
packratBootstrapButton_.setVisible(false);
// create packrat menu + button
ToolbarPopupMenu packratMenu = new ToolbarPopupMenu();
packratMenu.addItem(commands_.packratHelp().createMenuItem(false));
packratMenu.addSeparator();
packratMenu.addItem(commands_.packratClean().createMenuItem(false));
packratMenu.addItem(commands_.packratBundle().createMenuItem(false));
packratMenu.addSeparator();
packratMenu.addItem(commands_.packratOptions().createMenuItem(false));
packratMenuButton_ = new ToolbarButton("Packrat", commands_.packratBootstrap().getImageResource(), packratMenu);
toolbar.addLeftWidget(packratMenuButton_);
packratMenuButton_.setVisible(false);
searchWidget_ = new SearchWidget(new SuggestOracle() {
@Override
public void requestSuggestions(Request request, Callback callback) {
// no suggestions
callback.onSuggestionsReady(request, new Response(new ArrayList<Suggestion>()));
}
});
searchWidget_.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
observer_.onPackageFilterChanged(event.getValue().trim());
}
});
toolbar.addRightWidget(searchWidget_);
toolbar.addRightSeparator();
toolbar.addRightWidget(commands_.refreshPackages().createToolbarButton());
return toolbar;
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class CodeBrowserEditingTargetWidget method createToolbar.
private Toolbar createToolbar() {
Toolbar toolbar = new EditingTargetToolbar(commands_, true);
toolbar.addLeftWidget(commands_.printSourceDoc().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(findReplace_.createFindReplaceButton());
ImageResource icon = new ImageResource2x(ThemeResources.INSTANCE.codeTransform2x());
ToolbarPopupMenu menu = new ToolbarPopupMenu();
menu.addItem(commands_.goToHelp().createMenuItem(false));
menu.addItem(commands_.goToFunctionDefinition().createMenuItem(false));
ToolbarButton codeTools = new ToolbarButton("", icon, menu);
codeTools.setTitle("Code Tools");
toolbar.addLeftWidget(codeTools);
toolbar.addRightWidget(commands_.executeCode().createToolbarButton());
toolbar.addRightSeparator();
toolbar.addRightWidget(commands_.executeLastCode().createToolbarButton());
return toolbar;
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class ViewerPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
toolbar_ = new Toolbar();
// add html widget buttons
toolbar_.addLeftWidget(commands_.viewerBack().createToolbarButton());
toolbar_.addLeftWidget(commands_.viewerForward().createToolbarButton());
toolbar_.addLeftSeparator();
toolbar_.addLeftWidget(commands_.viewerZoom().createToolbarButton());
// export commands
exportButtonSeparator_ = toolbar_.addLeftSeparator();
ToolbarPopupMenu exportMenu = new ToolbarPopupMenu();
exportMenu.addItem(commands_.viewerSaveAsImage().createMenuItem(false));
exportMenu.addItem(commands_.viewerCopyToClipboard().createMenuItem(false));
exportMenu.addSeparator();
exportMenu.addItem(commands_.viewerSaveAsWebPage().createMenuItem(false));
exportButton_ = new ToolbarButton("Export", new ImageResource2x(StandardIcons.INSTANCE.export_menu2x()), exportMenu);
toolbar_.addLeftWidget(exportButton_);
exportButton_.setVisible(false);
exportButtonSeparator_.setVisible(false);
toolbar_.addLeftSeparator();
toolbar_.addLeftWidget(commands_.viewerClear().createToolbarButton());
toolbar_.addLeftSeparator();
toolbar_.addLeftWidget(commands_.viewerClearAll().createToolbarButton());
toolbar_.addLeftSeparator();
toolbar_.addLeftWidget(commands_.viewerPopout().createToolbarButton());
toolbar_.addLeftSeparator();
toolbar_.addLeftWidget(commands_.viewerStop().createToolbarButton());
// add publish button
publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_DOCUMENT, true, null);
toolbar_.addRightWidget(publishButton_);
toolbar_.addRightSeparator();
toolbar_.addRightWidget(commands_.viewerRefresh().createToolbarButton());
// create an HTML generator
publishButton_.setPublishHtmlSource(new PublishHtmlSource() {
@Override
public void generatePublishHtml(final CommandWithArg<String> onCompleted) {
server_.viewerCreateRPubsHtml(getTitle(), "", new ServerRequestCallback<String>() {
@Override
public void onResponseReceived(String htmlFile) {
onCompleted.execute(htmlFile);
}
@Override
public void onError(ServerError error) {
globalDisplay_.showErrorMessage("Could Not Publish", error.getMessage());
}
});
}
@Override
public String getTitle() {
String title = frame_.getTitle();
if (StringUtil.isNullOrEmpty(title))
title = "Viewer Content";
return title;
}
});
return toolbar_;
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class GitPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
moreMenu.addItem(commands_.vcsRevert().createMenuItem(false));
moreMenu.addItem(commands_.vcsIgnore().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.showShellDialog().createMenuItem(false));
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(commands_.vcsDiff().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.vcsCommit().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(pullButton_ = commands_.vcsPull().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(pushButton_ = commands_.vcsPush().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(historyButton_ = commands_.vcsShowHistory().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(moreButton_ = new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu));
toolbar.addRightWidget(createBranchToolbarButton_);
toolbar.addRightSeparator();
toolbar.addRightWidget(switchBranchToolbarButton_);
toolbar.addRightSeparator();
toolbar.addRightWidget(new ToolbarButton(commands_.vcsRefresh().getImageResource(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
table_.showProgress();
commands_.vcsRefresh().execute();
}
}));
return toolbar;
}
Aggregations