use of com.google.gerrit.client.DiffObject in project gerrit by GerritCodeReview.
the class PatchSetSelectBox method createLink.
private InlineHyperlink createLink(String label, DiffObject id) {
assert other != null;
if (sideA) {
assert !other.idActive.isBaseOrAutoMerge();
}
DiffObject diffBase = sideA ? id : other.idActive;
DiffObject revision = sideA ? other.idActive : id;
return new InlineHyperlink(label, parent.isSideBySide() ? Dispatcher.toSideBySide(diffBase, revision.asPatchSetId(), path) : Dispatcher.toUnified(diffBase, revision.asPatchSetId(), path));
}
use of com.google.gerrit.client.DiffObject 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