use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class PaneManager method createConsole.
private LogicalWindow createConsole() {
PrimaryWindowFrame frame = new PrimaryWindowFrame("Console", null);
ToolbarButton goToWorkingDirButton = commands_.goToWorkingDir().createToolbarButton();
goToWorkingDirButton.addStyleName(ThemeResources.INSTANCE.themeStyles().windowFrameToolbarButton());
LogicalWindow logicalWindow = new LogicalWindow(frame, new MinimizedWindowFrame("Console"));
consoleTabPanel_ = new ConsoleTabPanel(frame, logicalWindow, consolePane_, compilePdfTab_, findOutputTab_, sourceCppTab_, renderRmdTab_, deployContentTab_, markersTab_, terminalTab_, eventBus_, goToWorkingDirButton);
return logicalWindow;
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class WebApplicationHeader method initCommandsPanel.
private void initCommandsPanel(final SessionInfo sessionInfo) {
// add username
if (sessionInfo.getShowIdentity()) {
ToolbarLabel usernameLabel = new ToolbarLabel();
usernameLabel.getElement().getStyle().setMarginRight(2, Unit.PX);
if (!BrowseCap.isFirefox())
usernameLabel.getElement().getStyle().setMarginTop(2, Unit.PX);
String userIdentity = sessionInfo.getUserIdentity();
usernameLabel.setTitle(userIdentity);
userIdentity = userIdentity.split("@")[0];
usernameLabel.setText(userIdentity);
headerBarCommandsPanel_.add(usernameLabel);
ToolbarButton signOutButton = new ToolbarButton(new ImageResource2x(RESOURCES.signOut2x()), new ClickHandler() {
public void onClick(ClickEvent event) {
eventBus_.fireEvent(new LogoutRequestedEvent());
}
});
signOutButton.setTitle("Sign out");
headerBarCommandsPanel_.add(signOutButton);
headerBarCommandsPanel_.add(signOutSeparator_ = createCommandSeparator());
}
overlay_.addCommands(this);
headerBarCommandsPanel_.add(commands_.quitSession().createToolbarButton());
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class CompilePanel method connectToolbar.
public void connectToolbar(Toolbar toolbar) {
Commands commands = RStudioGinjector.INSTANCE.getCommands();
ImageResource stopImage = commands.interruptR().getImageResource();
stopButton_ = new ToolbarButton(stopImage, null);
stopButton_.setVisible(false);
toolbar.addRightWidget(stopButton_);
showOutputButton_ = new LeftRightToggleButton("Output", "Issues", false);
showOutputButton_.setVisible(false);
showOutputButton_.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
showOutputButton_.setVisible(false);
showErrorsButton_.setVisible(true);
panel_.setWidget(outputDisplay_.asWidget());
outputDisplay_.scrollToBottom();
}
});
toolbar.addRightWidget(showOutputButton_);
showErrorsButton_ = new LeftRightToggleButton("Output", "Issues", true);
showErrorsButton_.setVisible(false);
showErrorsButton_.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
showOutputButton_.setVisible(true);
showErrorsButton_.setVisible(false);
panel_.setWidget(errorList_);
}
});
toolbar.addRightWidget(showErrorsButton_);
}
use of org.rstudio.core.client.widget.ToolbarButton in project rstudio by rstudio.
the class PlotsToolbar method installStandardUI.
private void installStandardUI() {
// plot history navigation
addLeftWidget(commands_.previousPlot().createToolbarButton());
addLeftWidget(commands_.nextPlot().createToolbarButton());
addLeftSeparator();
// popout current plot
addLeftWidget(commands_.zoomPlot().createToolbarButton());
addLeftSeparator();
// export commands
ToolbarPopupMenu exportMenu = new ToolbarPopupMenu();
exportMenu.addItem(commands_.savePlotAsImage().createMenuItem(false));
exportMenu.addItem(commands_.savePlotAsPdf().createMenuItem(false));
exportMenu.addSeparator();
exportMenu.addItem(commands_.copyPlotToClipboard().createMenuItem(false));
ToolbarButton exportButton = new ToolbarButton("Export", new ImageResource2x(StandardIcons.INSTANCE.export_menu2x()), exportMenu);
addLeftWidget(exportButton);
addLeftSeparator();
addLeftWidget(commands_.removePlot().createToolbarButton());
addLeftSeparator();
// clear all plots
addLeftWidget(commands_.clearPlots().createToolbarButton());
// publish
addRightWidget(publishButton_);
// refresh
addRightSeparator();
addRightWidget(commands_.refreshPlot().createToolbarButton());
}
use of org.rstudio.core.client.widget.ToolbarButton 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;
}
Aggregations