use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class MiniDialogPopupPanel method commonInit.
private void commonInit() {
addStyleName(ThemeStyles.INSTANCE.miniDialogPopupPanel());
verticalPanel_ = new VerticalPanel();
verticalPanel_.setStyleName(ThemeStyles.INSTANCE.miniDialogContainer());
// title bar
HorizontalPanel titleBar = new HorizontalPanel();
titleBar.setWidth("100%");
captionLabel_ = new Label();
captionLabel_.setStyleName(ThemeStyles.INSTANCE.miniDialogCaption());
titleBar.add(captionLabel_);
titleBar.setCellHorizontalAlignment(captionLabel_, HasHorizontalAlignment.ALIGN_LEFT);
HorizontalPanel toolsPanel = new HorizontalPanel();
toolsPanel.setStyleName(ThemeStyles.INSTANCE.miniDialogTools());
ToolbarButton hideButton = new ToolbarButton(new ImageResource2x(ThemeResources.INSTANCE.closeChevron2x()), new ClickHandler() {
public void onClick(ClickEvent event) {
MiniDialogPopupPanel.this.hideMiniDialog();
}
});
hideButton.setTitle("Close");
toolsPanel.add(hideButton);
titleBar.add(toolsPanel);
titleBar.setCellHorizontalAlignment(toolsPanel, HasHorizontalAlignment.ALIGN_RIGHT);
verticalPanel_.add(titleBar);
// main widget
verticalPanel_.add(createMainWidget());
setWidget(verticalPanel_);
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class ModifyKeyboardShortcutsWidget method addConflictCommandStyles.
private void addConflictCommandStyles(int index, int maskedIndex, KeyboardShortcutEntry conflictsWith) {
Element shortcutCell = table_.getRowElement(index).getChild(1).cast();
embedIcon(shortcutCell, new ImageResource2x(ThemeResources.INSTANCE.syntaxWarning2x()), "Conflicts with command: ", maskedIndex);
shortcutCell.addClassName(RES.dataGridStyle().conflictRow());
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class ModifyKeyboardShortcutsWidget method addMaskedCommandStyles.
private void addMaskedCommandStyles(int index, int maskedIndex, KeyboardShortcutEntry maskedBy) {
Element shortcutCell = table_.getRowElement(index).getChild(1).cast();
embedIcon(shortcutCell, new ImageResource2x(ThemeResources.INSTANCE.syntaxInfo2x()), "Masked by RStudio command: ", maskedIndex);
shortcutCell.addClassName(RES.dataGridStyle().maskedEditorCommandCell());
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class Toolbar method addPopupMenu.
private Widget addPopupMenu(final MenuLabel menuLabel, final MenuSource menuSource, boolean left) {
final Widget label = menuLabel.asWidget();
label.setStylePrimaryName("rstudio-StrongLabel");
label.getElement().getStyle().setCursor(Style.Cursor.DEFAULT);
label.getElement().getStyle().setOverflow(Overflow.HIDDEN);
if (left)
addLeftWidget(label);
else
addRightWidget(label);
Image image = new Image(new ImageResource2x(ThemeResources.INSTANCE.menuDownArrow2x()));
image.getElement().getStyle().setMarginLeft(5, Unit.PX);
image.getElement().getStyle().setMarginRight(8, Unit.PX);
image.getElement().getStyle().setMarginBottom(2, Unit.PX);
if (left)
addLeftWidget(image);
else
addRightWidget(image);
final ClickHandler clickHandler = new ClickHandler() {
public void onClick(ClickEvent event) {
ToolbarPopupMenu menu = menuSource.getMenu();
menu.showRelativeTo(label);
menu.getElement().getStyle().setPaddingTop(3, Style.Unit.PX);
}
};
menuLabel.addClickHandler(clickHandler);
image.addClickHandler(clickHandler);
return image;
}
use of org.rstudio.core.client.resources.ImageResource2x 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