use of org.rstudio.studio.client.common.icons.StandardIcons in project rstudio by rstudio.
the class GlobalToolbar method completeInitialization.
public void completeInitialization(SessionInfo sessionInfo) {
StandardIcons icons = StandardIcons.INSTANCE;
if (sessionInfo.isVcsEnabled()) {
addLeftSeparator();
ToolbarPopupMenu vcsMenu = new ToolbarPopupMenu();
vcsMenu.addItem(commands_.vcsFileDiff().createMenuItem(false));
vcsMenu.addItem(commands_.vcsFileLog().createMenuItem(false));
vcsMenu.addItem(commands_.vcsFileRevert().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsViewOnGitHub().createMenuItem(false));
vcsMenu.addItem(commands_.vcsBlameOnGitHub().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsCommit().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsPull().createMenuItem(false));
vcsMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
vcsMenu.addItem(commands_.vcsPush().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
vcsMenu.addSeparator();
vcsMenu.addItem(commands_.versionControlProjectSetup().createMenuItem(false));
ImageResource vcsIcon = null;
if (sessionInfo.getVcsName().equals(VCSConstants.GIT_ID))
vcsIcon = new ImageResource2x(icons.git2x());
else if (sessionInfo.getVcsName().equals(VCSConstants.SVN_ID))
vcsIcon = new ImageResource2x(icons.svn2x());
ToolbarButton vcsButton = new ToolbarButton(null, vcsIcon, vcsMenu);
vcsButton.setTitle("Version control");
addLeftWidget(vcsButton);
}
// zoom button
addLeftSeparator();
ToolbarPopupMenu paneLayoutMenu = new ToolbarPopupMenu();
paneLayoutMenu.addItem(commands_.layoutEndZoom().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutConsoleOnLeft().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutConsoleOnRight().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.paneLayout().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutZoomSource().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomConsole().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomHelp().createMenuItem(false));
paneLayoutMenu.addSeparator();
paneLayoutMenu.addItem(commands_.layoutZoomHistory().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomFiles().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomPlots().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomPackages().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomEnvironment().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomViewer().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomVcs().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomBuild().createMenuItem(false));
paneLayoutMenu.addItem(commands_.layoutZoomConnections().createMenuItem(false));
ImageResource paneLayoutIcon = new ImageResource2x(ThemeResources.INSTANCE.paneLayoutIcon2x());
ToolbarButton paneLayoutButton = new ToolbarButton(null, paneLayoutIcon, paneLayoutMenu);
paneLayoutButton.setTitle("Workspace Panes");
addLeftWidget(paneLayoutButton);
// addins menu
ToolbarPopupMenu addinsMenu = new ToolbarPopupMenu();
addinsMenu.addItem(commands_.addinsMru0().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru1().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru2().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru3().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru4().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru5().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru6().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru7().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru8().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru9().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru10().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru11().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru12().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru13().createMenuItem(false));
addinsMenu.addItem(commands_.addinsMru14().createMenuItem(false));
addinsMenu.addSeparator();
addinsMenu.addItem(commands_.browseAddins().createMenuItem(false));
addLeftSeparator();
ToolbarButton addinsButton = new ToolbarButton("Addins", CoreResources.INSTANCE.iconEmpty(), addinsMenu);
addLeftWidget(addinsButton);
// project popup menu
ProjectPopupMenu projectMenu = new ProjectPopupMenu(sessionInfo, commands_);
addRightWidget(projectMenu.getToolbarButton());
}
Aggregations