use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class PresentationPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
boolean isTutorial = session_.getSessionInfo().getPresentationState().isTutorial();
Toolbar toolbar = new Toolbar();
slideNavigationMenu_ = new SlideNavigationToolbarMenu(toolbar);
slideNavigationMenu_.setEditButtonVisible(!isTutorial);
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.presentationFullscreen().createToolbarButton());
// More
if (!isTutorial) {
ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
moreMenu.addItem(commands_.clearPresentationCache().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.presentationViewInBrowser().createMenuItem(false));
moreMenu.addItem(commands_.presentationSaveAsStandalone().createMenuItem(false));
ToolbarButton moreButton = new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu);
toolbar.addRightWidget(moreButton);
// Create the publish button and wire it to our HTML generator
publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_PRES, false, null);
publishButton_.setPublishHtmlSource(new PublishHtmlSource() {
@Override
public void generatePublishHtml(final CommandWithArg<String> onCompleted) {
server_.createPresentationRPubsSource(new SimpleRequestCallback<PresentationRPubsSource>() {
@Override
public void onResponseReceived(PresentationRPubsSource source) {
onCompleted.execute(source.getSourceFilePath());
}
@Override
public void onError(ServerError error) {
display_.showErrorMessage("Error Saving Presentation", Presentation.getErrorMessage(error));
}
});
}
@Override
public String getTitle() {
return "Presentation:\n" + getPresentationTitle();
}
});
toolbar.addRightSeparator();
toolbar.addRightWidget(publishButton_);
} else {
toolbar.addRightWidget(commands_.tutorialFeedback().createToolbarButton());
}
toolbar.addRightSeparator();
toolbar.addRightWidget(refreshButton_ = commands_.refreshPresentation().createToolbarButton());
progressButton_ = new ToolbarButton(CoreResources.INSTANCE.progress_gray(), new ClickHandler() {
@Override
public void onClick(ClickEvent e) {
}
});
toolbar.addRightWidget(progressButton_);
progressButton_.setVisible(false);
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class ProfilerEditingTargetWidget method createToolbar.
private Toolbar createToolbar(Commands commands, PublishHtmlSource publishHtmlSource) {
Toolbar toolbar = new EditingTargetToolbar(commands, true);
toolbar.addLeftWidget(commands.gotoProfileSource().createToolbarButton());
toolbar.addLeftWidget(commands.saveProfileAs().createToolbarButton());
toolbar.addRightWidget(publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_DOCUMENT, true, null));
publishButton_.setPublishHtmlSource(publishHtmlSource);
publishButton_.setContentType(RSConnect.CONTENT_TYPE_HTML);
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class TerminalPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
activeTerminalToolbarButton_ = new TerminalPopupMenu(terminals_);
toolbar.addLeftWidget(activeTerminalToolbarButton_.getToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.previousTerminal().createToolbarButton());
toolbar.addLeftWidget(commands_.nextTerminal().createToolbarButton());
toolbar.addLeftSeparator();
terminalTitle_ = new Label();
terminalTitle_.setStyleName(ThemeStyles.INSTANCE.subtitle());
toolbar.addLeftWidget(terminalTitle_);
toolbar.addRightWidget(commands_.clearTerminalScrollbackBuffer().createToolbarButton());
commands_.previousTerminal().setEnabled(false);
commands_.nextTerminal().setEnabled(false);
commands_.closeTerminal().setEnabled(false);
commands_.renameTerminal().setEnabled(false);
commands_.closeTerminal().setEnabled(false);
commands_.clearTerminalScrollbackBuffer().setEnabled(false);
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class SVNPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(commands_.vcsDiff().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.vcsAddFiles().createToolbarButton());
toolbar.addLeftWidget(commands_.vcsRemoveFiles().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.vcsCommit().createToolbarButton());
toolbar.addLeftSeparator();
ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
moreMenu.addItem(commands_.vcsRevert().createMenuItem(false));
moreMenu.addItem(commands_.vcsIgnore().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.vcsResolve().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.vcsPull().createMenuItem(false));
moreMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.showShellDialog().createMenuItem(false));
toolbar.addLeftWidget(new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu));
toolbar.addLeftSeparator();
toolbar.addRightWidget(commands_.vcsRefresh().createToolbarButton());
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class ConnectionsPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
toolbar_ = new Toolbar();
searchWidget_ = new SearchWidget(new SuggestOracle() {
@Override
public void requestSuggestions(Request request, Callback callback) {
// no suggestions
callback.onSuggestionsReady(request, new Response(new ArrayList<Suggestion>()));
}
});
backToConnectionsButton_ = new ToolbarButton(commands_.helpBack().getImageResource(), (ClickHandler) null);
backToConnectionsButton_.setTitle("View all connections");
// connect meuu
ToolbarPopupMenu connectMenu = new ToolbarPopupMenu();
connectMenu.addItem(connectMenuItem(commands_.historySendToConsole().getImageResource(), "R Console", ConnectionOptions.CONNECT_R_CONSOLE));
connectMenu.addSeparator();
connectMenu.addItem(connectMenuItem(commands_.newSourceDoc().getImageResource(), "New R Script", ConnectionOptions.CONNECT_NEW_R_SCRIPT));
connectMenu.addItem(connectMenuItem(commands_.newRNotebook().getImageResource(), "New R Notebook", ConnectionOptions.CONNECT_NEW_R_NOTEBOOK));
if (BrowseCap.INSTANCE.canCopyToClipboard()) {
connectMenu.addSeparator();
connectMenu.addItem(connectMenuItem(commands_.copyPlotToClipboard().getImageResource(), "Copy to Clipboard", ConnectionOptions.CONNECT_COPY_TO_CLIPBOARD));
}
connectMenuButton_ = new ToolbarButton("Connect", commands_.newConnection().getImageResource(), connectMenu);
// manage connect menu visibility
connectMenuButton_.setVisible(!commands_.disconnectConnection().isVisible());
commands_.disconnectConnection().addVisibleChangedHandler(new VisibleChangedHandler() {
@Override
public void onVisibleChanged(AppCommand command) {
connectMenuButton_.setVisible(!commands_.disconnectConnection().isVisible());
}
});
installConnectionsToolbar();
return toolbar_;
}
Aggregations