use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class StatusBarElementWidget method setShowArrows.
public void setShowArrows(boolean showArrows) {
if (showArrows ^ arrows_ != null) {
if (showArrows) {
Resources res = GWT.create(Resources.class);
arrows_ = new Image(new ImageResource2x(res.upDownArrow2x()));
add(arrows_);
} else {
arrows_.removeFromParent();
arrows_ = null;
}
}
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class GitPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
ToolbarPopupMenu moreMenu = new ToolbarPopupMenu();
moreMenu.addItem(commands_.vcsRevert().createMenuItem(false));
moreMenu.addItem(commands_.vcsIgnore().createMenuItem(false));
moreMenu.addSeparator();
moreMenu.addItem(commands_.showShellDialog().createMenuItem(false));
Toolbar toolbar = new Toolbar();
toolbar.addLeftWidget(commands_.vcsDiff().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.vcsCommit().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(pullButton_ = commands_.vcsPull().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(pushButton_ = commands_.vcsPush().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(historyButton_ = commands_.vcsShowHistory().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(moreButton_ = new ToolbarButton("More", new ImageResource2x(StandardIcons.INSTANCE.more_actions2x()), moreMenu));
toolbar.addRightWidget(createBranchToolbarButton_);
toolbar.addRightSeparator();
toolbar.addRightWidget(switchBranchToolbarButton_);
toolbar.addRightSeparator();
toolbar.addRightWidget(new ToolbarButton(commands_.vcsRefresh().getImageResource(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
table_.showProgress();
commands_.vcsRefresh().execute();
}
}));
return toolbar;
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class GitReviewPanel method showContextMenu.
@Override
public void showContextMenu(final int clientX, final int clientY, Command openSelectedCommand) {
final ToolbarPopupMenu menu = new ToolbarPopupMenu();
MenuItem stageMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.stage2x()), "Stage", ""), true, new Command() {
@Override
public void execute() {
stageFilesButton_.click();
}
});
if (stageFilesButton_.isEnabled()) {
menu.addItem(stageMenu);
menu.addSeparator();
}
MenuItem revertMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.discard2x()), "Revert...", ""), true, new Command() {
@Override
public void execute() {
revertFilesButton_.click();
}
});
if (revertFilesButton_.isEnabled())
menu.addItem(revertMenu);
MenuItem ignoreMenu = new MenuItem(AppCommand.formatMenuLabel(new ImageResource2x(RES.ignore2x()), "Ignore...", ""), true, new Command() {
@Override
public void execute() {
ignoreButton_.click();
}
});
if (ignoreButton_.isEnabled())
menu.addItem(ignoreMenu);
menu.addSeparator();
MenuItem openMenu = new MenuItem(AppCommand.formatMenuLabel(null, "Open File", ""), true, openSelectedCommand);
menu.addItem(openMenu);
menu.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
menu.setPopupPosition(clientX, clientY);
}
});
}
Aggregations