use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class CheckForUpdatesDialog method addTableColumns.
protected void addTableColumns(CellTable<PendingAction> table) {
TextColumn<PendingAction> nameColumn = new TextColumn<PendingAction>() {
public String getValue(PendingAction action) {
return action.getActionInfo().getPackageName();
}
};
table.addColumn(nameColumn, "Package");
table.setColumnWidth(nameColumn, 28, Unit.PCT);
TextColumn<PendingAction> installedColumn = new TextColumn<PendingAction>() {
public String getValue(PendingAction action) {
return action.getActionInfo().getInstalled();
}
};
table.addColumn(installedColumn, "Installed");
table.setColumnWidth(installedColumn, 28, Unit.PCT);
TextColumn<PendingAction> availableColumn = new TextColumn<PendingAction>() {
public String getValue(PendingAction action) {
return action.getActionInfo().getAvailable();
}
};
table.addColumn(availableColumn, "Available");
table.setColumnWidth(availableColumn, 28, Unit.PCT);
ImageButtonColumn<PendingAction> newsColumn = new ImageButtonColumn<PendingAction>(new ImageResource2x(ThemeResources.INSTANCE.newsButton2x()), new OperationWithInput<PendingAction>() {
public void execute(PendingAction action) {
GlobalDisplay.NewWindowOptions options = new GlobalDisplay.NewWindowOptions();
options.setName("_rstudio_package_news");
globalDisplay_.openWindow(action.getActionInfo().getNewsUrl(), options);
}
}, "Show package NEWS") {
@Override
protected boolean showButton(PendingAction action) {
return !StringUtil.isNullOrEmpty(action.getActionInfo().getNewsUrl());
}
};
table.addColumn(newsColumn, "NEWS");
table.setColumnWidth(newsColumn, 16, Unit.PCT);
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class PlotsToolbar method installStandardUI.
private void installStandardUI() {
// plot history navigation
addLeftWidget(commands_.previousPlot().createToolbarButton());
addLeftWidget(commands_.nextPlot().createToolbarButton());
addLeftSeparator();
// popout current plot
addLeftWidget(commands_.zoomPlot().createToolbarButton());
addLeftSeparator();
// export commands
ToolbarPopupMenu exportMenu = new ToolbarPopupMenu();
exportMenu.addItem(commands_.savePlotAsImage().createMenuItem(false));
exportMenu.addItem(commands_.savePlotAsPdf().createMenuItem(false));
exportMenu.addSeparator();
exportMenu.addItem(commands_.copyPlotToClipboard().createMenuItem(false));
ToolbarButton exportButton = new ToolbarButton("Export", new ImageResource2x(StandardIcons.INSTANCE.export_menu2x()), exportMenu);
addLeftWidget(exportButton);
addLeftSeparator();
addLeftWidget(commands_.removePlot().createToolbarButton());
addLeftSeparator();
// clear all plots
addLeftWidget(commands_.clearPlots().createToolbarButton());
// publish
addRightWidget(publishButton_);
// refresh
addRightSeparator();
addRightWidget(commands_.refreshPlot().createToolbarButton());
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class RSConnectDeploy method applySource.
private void applySource() {
// show the description of what we're about to publish
if (source_.isSelfContained() && source_.isStatic() && !source_.isWebsiteRmd()) {
filePanel_.setVisible(false);
descriptionPanel_.setVisible(true);
if (contentType_ == RSConnect.CONTENT_TYPE_PLOT || contentType_ == RSConnect.CONTENT_TYPE_HTML) {
descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewPlot2x()));
} else if (contentType_ == RSConnect.CONTENT_TYPE_PRES) {
descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewPresentation2x()));
} else {
descriptionImage_.setResource(new ImageResource2x(RSConnectResources.INSTANCE.previewDoc2x()));
}
}
// (for apps and documents--other content types use temporary filenames)
if (appName_.getTitle().isEmpty()) {
if (contentType_ == RSConnect.CONTENT_TYPE_APP || contentType_ == RSConnect.CONTENT_TYPE_APP_SINGLE || contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT) {
// set the app name to the filename
String appTitle = FilePathUtils.fileNameSansExtension(source_.getSourceFile());
// as the content name rather than the file
if (contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT && appTitle.toLowerCase().equals("index")) {
appTitle = FilePathUtils.fileNameSansExtension(source_.getDeployDir());
}
setUnsanitizedAppName(appTitle);
} else if (contentType_ == RSConnect.CONTENT_TYPE_WEBSITE) {
setUnsanitizedAppName(FilePathUtils.fileNameSansExtension(source_.getWebsiteDir()));
}
}
ImageResource illustration = null;
if (contentType_ == RSConnect.CONTENT_TYPE_APP)
illustration = new ImageResource2x(RESOURCES.publishShinyIllustration2x());
else if (contentType_ == RSConnect.CONTENT_TYPE_PLOT)
illustration = new ImageResource2x(RESOURCES.publishPlotIllustration2x());
else if (contentType_ == RSConnect.CONTENT_TYPE_DOCUMENT)
illustration = new ImageResource2x(RESOURCES.publishRmdIllustration2x());
else if (contentType_ == RSConnect.CONTENT_TYPE_HTML)
illustration = new ImageResource2x(RESOURCES.publishHTMLIllustration2x());
else if (contentType_ == RSConnect.CONTENT_TYPE_PRES)
illustration = new ImageResource2x(RESOURCES.publishPresentationIllustration2x());
if (illustration != null)
deployIllustration_.setResource(illustration);
}
use of org.rstudio.core.client.resources.ImageResource2x 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.resources.ImageResource2x in project rstudio by rstudio.
the class SVNStatusRenderer method render.
@Override
public SafeHtml render(String str) {
if (str.length() != 1)
return SafeHtmlUtils.fromString(str);
ImageResource2x img = imgForStatus(str.charAt(0));
if (img == null)
return SafeHtmlUtils.fromString(str);
SafeHtmlBuilder builder = new SafeHtmlBuilder();
builder.append(SafeHtmlUtils.fromTrustedString("<span " + "class=\"" + ctRes_.cellTableStyle().status() + "\" " + "title=\"" + SafeHtmlUtils.htmlEscape(descForStatus(str)) + "\">"));
builder.append(img.getSafeHtml());
builder.appendHtmlConstant("</span>");
return builder.toSafeHtml();
}
Aggregations