use of org.rstudio.core.client.widget.ToolbarPopupMenu 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.ToolbarPopupMenu in project rstudio by rstudio.
the class FilesPane method showDataImportFileChoice.
@Override
public void showDataImportFileChoice(FileSystemItem file, Command onView, Command onImport) {
final ToolbarPopupMenu menu = new ToolbarPopupMenu();
String editLabel = AppCommand.formatMenuLabel(commands_.renameFile().getImageResource(), "View File", null);
String importLabel = AppCommand.formatMenuLabel(new ImageResource2x(StandardIcons.INSTANCE.import_dataset2x()), "Import Dataset...", null);
menu.addItem(new MenuItem(editLabel, true, onView));
menu.addItem(new MenuItem(importLabel, true, onImport));
menu.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
Event event = Event.getCurrentEvent();
PopupPositioner.setPopupPosition(menu, event.getClientX(), event.getClientY());
}
});
}
use of org.rstudio.core.client.widget.ToolbarPopupMenu in project rstudio by rstudio.
the class FilesPane method showHtmlFileChoice.
@Override
public void showHtmlFileChoice(FileSystemItem file, Command onEdit, Command onBrowse) {
final ToolbarPopupMenu menu = new ToolbarPopupMenu();
String editLabel = AppCommand.formatMenuLabel(commands_.renameFile().getImageResource(), "Open in Editor", null);
String openLabel = AppCommand.formatMenuLabel(commands_.openHtmlExternal().getImageResource(), "View in Web Browser", null);
menu.addItem(new MenuItem(editLabel, true, onEdit));
menu.addItem(new MenuItem(openLabel, true, onBrowse));
menu.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
Event event = Event.getCurrentEvent();
PopupPositioner.setPopupPosition(menu, event.getClientX(), event.getClientY());
}
});
}
use of org.rstudio.core.client.widget.ToolbarPopupMenu 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.ToolbarPopupMenu in project rstudio by rstudio.
the class SVNReviewPanel method showContextMenu.
@Override
public void showContextMenu(final int clientX, final int clientY) {
final ToolbarPopupMenu menu = new ToolbarPopupMenu();
menu.addItem(commands_.vcsAddFiles().createMenuItem(false));
menu.addItem(commands_.vcsRemoveFiles().createMenuItem(false));
menu.addSeparator();
menu.addItem(commands_.vcsRevert().createMenuItem(false));
menu.addItem(commands_.vcsIgnore().createMenuItem(false));
menu.addSeparator();
menu.addItem(commands_.vcsResolve().createMenuItem(false));
menu.addSeparator();
menu.addItem(commands_.vcsOpen().createMenuItem(false));
menu.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
menu.setPopupPosition(clientX, clientY);
}
});
}
Aggregations