use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class ChunkContextToolbar method initRunPrevious.
private void initRunPrevious(boolean dark) {
runPrevious_.setTitle(RStudioGinjector.INSTANCE.getCommands().executePreviousChunks().getMenuLabel(false));
runPrevious_.setResource(new ImageResource2x(dark ? RES.runPreviousChunksDark2x() : RES.runPreviousChunksLight2x()));
DOM.sinkEvents(runPrevious_.getElement(), Event.ONCLICK);
DOM.setEventListener(runPrevious_.getElement(), new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {
host_.runPreviousChunks();
}
}
});
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class StatusBarWidget method setScopeType.
public void setScopeType(int type) {
scopeType_ = type;
if (type == StatusBar.SCOPE_TOP_LEVEL || message_.isVisible())
scopeIcon_.setVisible(false);
else
scopeIcon_.setVisible(true);
if (type == StatusBar.SCOPE_CLASS)
scopeIcon_.setResource(new ImageResource2x(CodeIcons.INSTANCE.clazz2x()));
else if (type == StatusBar.SCOPE_NAMESPACE)
scopeIcon_.setResource(new ImageResource2x(CodeIcons.INSTANCE.namespace2x()));
else if (type == StatusBar.SCOPE_LAMBDA)
scopeIcon_.setResource(new ImageResource2x(StandardIcons.INSTANCE.lambdaLetter2x()));
else if (type == StatusBar.SCOPE_ANON)
scopeIcon_.setResource(new ImageResource2x(StandardIcons.INSTANCE.functionLetter2x()));
else if (type == StatusBar.SCOPE_FUNCTION)
scopeIcon_.setResource(new ImageResource2x(StandardIcons.INSTANCE.functionLetter2x()));
else if (type == StatusBar.SCOPE_CHUNK)
scopeIcon_.setResource(new ImageResource2x(RES.chunk2x()));
else if (type == StatusBar.SCOPE_SECTION)
scopeIcon_.setResource(new ImageResource2x(RES.section2x()));
else if (type == StatusBar.SCOPE_SLIDE)
scopeIcon_.setResource(new ImageResource2x(RES.slide2x()));
else
scopeIcon_.setResource(new ImageResource2x(CodeIcons.INSTANCE.function2x()));
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class RMarkdownNoParamsDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
VerticalPanel panel = new VerticalPanel();
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
// add image
MessageDialogImages images = MessageDialogImages.INSTANCE;
Image image = new Image(new ImageResource2x(images.dialog_warning2x()));
horizontalPanel.add(image);
// add message widget
VerticalPanel messagePanel = new VerticalPanel();
Label label = new MultiLineLabel("There are no parameters defined for the current " + "R Markdown document.");
label.setStylePrimaryName(ThemeResources.INSTANCE.themeStyles().dialogMessage());
messagePanel.add(label);
HelpLink helpLink = new HelpLink("Using R Markdown Parameters", "parameterized_reports", false);
Style style = helpLink.getElement().getStyle();
style.setMarginTop(4, Unit.PX);
style.setMarginBottom(12, Unit.PX);
messagePanel.add(helpLink);
horizontalPanel.add(messagePanel);
panel.add(horizontalPanel);
return panel;
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class GitStatusRenderer method render.
@Override
public SafeHtml render(String str) {
if (str.length() != 2)
return null;
ImageResource2x indexImg = imgForStatus(str.charAt(0));
ImageResource2x treeImg = imgForStatus(str.charAt(1));
SafeHtmlBuilder builder = new SafeHtmlBuilder();
builder.append(SafeHtmlUtils.fromTrustedString("<span " + "class=\"" + ctRes_.cellTableStyle().status() + "\" " + "title=\"" + SafeHtmlUtils.htmlEscape(descForStatus(str)) + "\">"));
builder.append(indexImg.getSafeHtml());
builder.append(treeImg.getSafeHtml());
builder.appendHtmlConstant("</span>");
return builder.toSafeHtml();
}
use of org.rstudio.core.client.resources.ImageResource2x in project rstudio by rstudio.
the class DataTable method initToolbar.
public void initToolbar(Toolbar toolbar, boolean isPreview) {
filterButton_ = new LatchingToolbarButton("Filter", new ImageResource2x(DataViewerResources.INSTANCE.filterIcon2x()), new ClickHandler() {
public void onClick(ClickEvent event) {
boolean newFilterState = !filtered_;
// ready/table is not initialized)
if (setFilterUIVisible(newFilterState)) {
filtered_ = newFilterState;
filterButton_.setLatched(filtered_);
}
}
});
toolbar.addLeftWidget(filterButton_);
filterButton_.setVisible(!isPreview);
searchWidget_ = new SearchWidget(new SuggestOracle() {
@Override
public void requestSuggestions(Request request, Callback callback) {
// no suggestions
callback.onSuggestionsReady(request, new Response(new ArrayList<Suggestion>()));
}
});
searchWidget_.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
applySearch(getWindow(), event.getValue());
}
});
toolbar.addRightWidget(searchWidget_);
searchWidget_.setVisible(!isPreview);
if (isPreview) {
ToolbarLabel label = new ToolbarLabel("(Displaying up to 1,000 records)");
label.addStyleName(ThemeStyles.INSTANCE.toolbarInfoLabel());
toolbar.addRightWidget(label);
}
}
Aggregations