use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class ConsoleInterruptProfilerButton method CreateProfilerButton.
public static Image CreateProfilerButton() {
ImageResource icon = new ImageResource2x(FileIconResources.INSTANCE.iconProfiler2x());
Image button = new Image(icon);
button.addStyleName(ThemeResources.INSTANCE.themeStyles().toolbarButtonLeftImage());
button.getElement().getStyle().setMarginRight(4, Unit.PX);
button.setTitle("Profiling Code");
return button;
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class EnvironmentObjectList method createExpandColumn.
private void createExpandColumn() {
// the column containing the expand command; available only on objects
// with contents (such as lists and data frames).
SafeHtmlRenderer<String> expanderRenderer = new AbstractSafeHtmlRenderer<String>() {
@Override
public SafeHtml render(String object) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
sb.appendHtmlConstant(object);
return sb.toSafeHtml();
}
};
objectExpandColumn_ = new Column<RObjectEntry, String>(new ClickableTextCell(expanderRenderer)) {
@Override
public String getValue(RObjectEntry object) {
String imageUri = "";
String imageStyle = style_.expandIcon();
if (object.canExpand()) {
imageStyle = imageStyle + " " + ThemeStyles.INSTANCE.handCursor();
ImageResource expandImage = object.isExpanding ? CoreResources.INSTANCE.progress() : object.expanded ? new ImageResource2x(EnvironmentResources.INSTANCE.collapseIcon2x()) : new ImageResource2x(EnvironmentResources.INSTANCE.expandIcon2x());
imageUri = expandImage.getSafeUri().asString();
} else if (object.hasTraceInfo()) {
imageUri = new ImageResource2x(EnvironmentResources.INSTANCE.tracedFunction2x()).getSafeUri().asString();
imageStyle += (" " + style_.unclickableIcon());
}
if (imageUri.length() > 0) {
return "<input type=\"image\" src=\"" + imageUri + "\" " + "class=\"" + imageStyle + "\" />";
}
return "";
}
};
objectExpandColumn_.setFieldUpdater(new FieldUpdater<RObjectEntry, String>() {
@Override
public void update(int index, RObjectEntry object, String value) {
if (!object.canExpand())
return;
expandObject(index, object);
}
});
}
use of org.rstudio.core.client.resources.ImageResource2x 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.resources.ImageResource2x in project rstudio by rstudio.
the class FilesList method addIconColumn.
private Column<FileSystemItem, ImageResource> addIconColumn(final FileTypeRegistry fileTypeRegistry) {
Column<FileSystemItem, ImageResource> iconColumn = new Column<FileSystemItem, ImageResource>(new ImageResourceCell()) {
@Override
public ImageResource getValue(FileSystemItem object) {
if (object == parentPath_)
return new ImageResource2x(FileIconResources.INSTANCE.iconUpFolder2x());
else
return fileTypeRegistry.getIconForFile(object);
}
};
iconColumn.setSortable(true);
filesDataGrid_.addColumn(iconColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
filesDataGrid_.setColumnWidth(iconColumn, ICON_COLUMN_WIDTH_PIXELS, Unit.PX);
sortHandler_.setComparator(iconColumn, new FilesListComparator() {
@Override
public int doCompare(FileSystemItem arg0, FileSystemItem arg1) {
if (arg0.isDirectory() && !arg1.isDirectory())
return 1;
else if (arg1.isDirectory() && !arg0.isDirectory())
return -1;
else
return arg0.getExtension().compareTo(arg1.getExtension());
}
});
return iconColumn;
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class CompileOutputPane method createMainToolbar.
@Override
protected Toolbar createMainToolbar() {
Toolbar toolbar = new Toolbar();
fileLabel_ = new ToolbarFileLabel(toolbar, 200);
ImageResource showLogImage = new ImageResource2x(StandardIcons.INSTANCE.show_log2x());
if (hasLogs_) {
showLogButton_ = new ToolbarButton("View Log", showLogImage, (ClickHandler) null);
showLogButton_.getElement().getStyle().setMarginBottom(3, Unit.PX);
showLogButton_.setTitle(logTitle_);
showLogSeparator_ = toolbar.addLeftSeparator();
setShowLogVisible(false);
toolbar.addLeftWidget(showLogButton_);
}
compilePanel_.connectToolbar(toolbar);
return toolbar;
}
Aggregations