Search in sources :

Example 1 with DiffObject

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));
}
Also used : InlineHyperlink(com.google.gerrit.client.ui.InlineHyperlink) DiffObject(com.google.gerrit.client.DiffObject)

Example 2 with DiffObject

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;
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) DiffObject(com.google.gerrit.client.DiffObject) ImageResourceRenderer(com.google.gwt.user.client.ui.ImageResourceRenderer)

Aggregations

DiffObject (com.google.gerrit.client.DiffObject)2 InlineHyperlink (com.google.gerrit.client.ui.InlineHyperlink)1 Anchor (com.google.gwt.user.client.ui.Anchor)1 ImageResourceRenderer (com.google.gwt.user.client.ui.ImageResourceRenderer)1