use of com.google.gwt.user.client.ui.ImageResourceRenderer in project gerrit by GerritCodeReview.
the class EditScreen method renderLinksToDiff.
private void renderLinksToDiff() {
InlineHyperlink sbs = new InlineHyperlink();
sbs.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.sideBySideDiff()));
sbs.setTargetHistoryToken(Dispatcher.toPatch("sidebyside", null, new Patch.Key(revision, path)));
sbs.setTitle(PatchUtil.C.sideBySideDiff());
linkPanel.add(sbs);
InlineHyperlink unified = new InlineHyperlink();
unified.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.unifiedDiff()));
unified.setTargetHistoryToken(Dispatcher.toPatch("unified", null, new Patch.Key(revision, path)));
unified.setTitle(PatchUtil.C.unifiedDiff());
linkPanel.add(unified);
}
use of com.google.gwt.user.client.ui.ImageResourceRenderer in project gerrit by GerritCodeReview.
the class PatchSetSelectBox method createEditIcon.
private Widget createEditIcon() {
PatchSet.Id id = idActive.isBaseOrAutoMerge() ? other.idActive.asPatchSetId() : idActive.asPatchSetId();
Anchor anchor = new Anchor(new ImageResourceRenderer().render(Gerrit.RESOURCES.edit()), "#" + Dispatcher.toEditScreen(id, path));
anchor.setTitle(PatchUtil.C.edit());
return anchor;
}
use of com.google.gwt.user.client.ui.ImageResourceRenderer in project gerrit by GerritCodeReview.
the class Hashtags method formatHashtags.
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) {
SafeHtmlBuilder html = new SafeHtmlBuilder();
Iterator<String> itr = Natives.asList(hashtags).iterator();
while (itr.hasNext()) {
String hashtagName = itr.next();
html.openSpan().setAttribute(DATA_ID, hashtagName).setStyleName(style.hashtagName()).openAnchor().setAttribute("href", "#" + PageLinks.toChangeQuery("hashtag:\"" + hashtagName + "\"")).setAttribute("role", "listitem").openSpan().setStyleName(style.hashtagIcon()).append(new ImageResourceRenderer().render(Gerrit.RESOURCES.hashtag())).closeSpan().append(" ").append(hashtagName).closeAnchor();
if (canEdit) {
html.openElement("button").setAttribute("title", "Remove hashtag").setAttribute("onclick", REMOVE + "(event)").append("×").closeElement("button");
}
html.closeSpan();
if (itr.hasNext()) {
html.append(' ');
}
}
return html;
}
use of com.google.gwt.user.client.ui.ImageResourceRenderer in project gerrit by GerritCodeReview.
the class PatchSetSelectBox method createBlameIcon.
private Anchor createBlameIcon() {
Anchor anchor = new Anchor(new ImageResourceRenderer().render(Gerrit.RESOURCES.blame()));
anchor.setTitle(PatchUtil.C.blame());
return anchor;
}
use of com.google.gwt.user.client.ui.ImageResourceRenderer in project gerrit by GerritCodeReview.
the class PatchSetSelectBox method createDownloadLink.
private Anchor createDownloadLink() {
DiffObject diffObject = idActive.isBaseOrAutoMerge() ? other.idActive : idActive;
String sideURL = idActive.isBaseOrAutoMerge() ? "1" : "0";
String base = GWT.getHostPageBaseURL() + "cat/";
Anchor anchor = new Anchor(new ImageResourceRenderer().render(Gerrit.RESOURCES.downloadIcon()), base + KeyUtil.encode(diffObject.asPatchSetId() + "," + path) + "^" + sideURL);
anchor.setTitle(PatchUtil.C.download());
return anchor;
}
Aggregations