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 HTMLPreviewPanel method createToolbar.
private Toolbar createToolbar(Commands commands) {
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(new ToolbarLabel("Preview: "));
fileLabel_ = new ToolbarLabel();
fileLabel_.addStyleName(ThemeStyles.INSTANCE.subtitle());
fileLabel_.getElement().getStyle().setMarginRight(7, Unit.PX);
toolbar.addLeftWidget(fileLabel_);
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands.openHtmlExternal().createToolbarButton());
showLogButtonSeparator_ = toolbar.addLeftSeparator();
showLogButton_ = commands.showHtmlPreviewLog().createToolbarButton();
toolbar.addLeftWidget(showLogButton_);
saveHtmlPreviewAsSeparator_ = toolbar.addLeftSeparator();
if (Desktop.isDesktop()) {
saveHtmlPreviewAs_ = commands.saveHtmlPreviewAs().createToolbarButton();
toolbar.addLeftWidget(saveHtmlPreviewAs_);
} else {
ToolbarPopupMenu menu = new ToolbarPopupMenu();
menu.addItem(commands.saveHtmlPreviewAs().createMenuItem(false));
menu.addItem(commands.saveHtmlPreviewAsLocalFile().createMenuItem(false));
saveHtmlPreviewAs_ = toolbar.addLeftWidget(new ToolbarButton("Save As", commands.saveSourceDoc().getImageResource(), menu));
}
publishButtonSeparator_ = toolbar.addLeftSeparator();
toolbar.addLeftWidget(publishButton_ = new RSConnectPublishButton(RSConnect.CONTENT_TYPE_DOCUMENT, true, null));
findTextBox_ = new FindTextBox("Find");
findTextBox_.setIconVisible(true);
findTextBox_.setOverrideWidth(120);
findTextBox_.getElement().getStyle().setMarginRight(6, Unit.PX);
toolbar.addRightWidget(findTextBox_);
findTextBox_.addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
// enter key triggers a find
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
event.preventDefault();
event.stopPropagation();
findInTopic(findTextBox_.getValue().trim(), findTextBox_);
findTextBox_.focus();
} else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
findTextBox_.setValue("");
}
}
private void findInTopic(String term, CanFocus findInputSource) {
// get content window
WindowEx contentWindow = previewFrame_.getWindow();
if (contentWindow == null)
return;
if (!contentWindow.find(term, false, false, true, false)) {
RStudioGinjector.INSTANCE.getGlobalDisplay().showMessage(MessageDialog.INFO, "Find in Page", "No occurences found", findInputSource);
}
}
});
refreshButtonSeparator_ = toolbar.addRightSeparator();
refreshButton_ = toolbar.addRightWidget(commands.refreshHtmlPreview().createToolbarButton());
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class ConsolePane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
workingDir_ = new Label();
workingDir_.setStyleName(ThemeStyles.INSTANCE.subtitle());
toolbar.addLeftWidget(workingDir_);
toolbar.addLeftWidget(commands_.goToWorkingDir().createToolbarButton());
consoleInterruptButton_ = commands_.interruptR().createToolbarButton();
consoleClearButton_ = commands_.consoleClear().createToolbarButton();
consoleClearButton_.setVisible(false);
profilerInterruptButton_ = ConsoleInterruptProfilerButton.CreateProfilerButton();
profilerInterruptButton_.setVisible(false);
toolbar.addRightWidget(profilerInterruptButton_);
toolbar.addRightWidget(consoleInterruptButton_);
toolbar.addRightWidget(consoleClearButton_);
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class EnvironmentPane method createMainToolbar.
// WorkbenchPane overrides -------------------------------------------------
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(commands_.loadWorkspace().createToolbarButton());
toolbar.addLeftWidget(commands_.saveWorkspace().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(createImportMenu());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.clearWorkspace().createToolbarButton());
ToolbarPopupMenu menu = new ToolbarPopupMenu();
menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_LIST_VIEW));
menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_GRID_VIEW));
viewButton_ = new ToolbarButton(nameOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), imageOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), menu);
toolbar.addRightWidget(viewButton_);
toolbar.addRightSeparator();
toolbar.addRightWidget(commands_.refreshEnvironment().createToolbarButton());
return toolbar;
}
use of org.rstudio.core.client.widget.Toolbar in project rstudio by rstudio.
the class HelpPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(commands_.helpBack().createToolbarButton());
toolbar.addLeftWidget(commands_.helpForward().createToolbarButton());
toolbar.addLeftWidget(commands_.helpHome().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.printHelp().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.helpPopout().createToolbarButton());
toolbar.addRightWidget(searchProvider_.get().getSearchWidget());
toolbar.addRightSeparator();
toolbar.addRightWidget(commands_.refreshHelp().createToolbarButton());
return toolbar;
}
Aggregations