Search in sources :

Example 1 with ImageResourceRenderer

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

Example 2 with ImageResourceRenderer

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

Example 3 with ImageResourceRenderer

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;
}
Also used : JsArrayString(com.google.gwt.core.client.JsArrayString) SafeHtmlBuilder(com.google.gwtexpui.safehtml.client.SafeHtmlBuilder) ImageResourceRenderer(com.google.gwt.user.client.ui.ImageResourceRenderer)

Example 4 with ImageResourceRenderer

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

Example 5 with ImageResourceRenderer

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;
}
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

ImageResourceRenderer (com.google.gwt.user.client.ui.ImageResourceRenderer)7 InlineHyperlink (com.google.gerrit.client.ui.InlineHyperlink)3 Anchor (com.google.gwt.user.client.ui.Anchor)3 DiffObject (com.google.gerrit.client.DiffObject)1 PatchSet (com.google.gerrit.reviewdb.client.PatchSet)1 JsArrayString (com.google.gwt.core.client.JsArrayString)1 GlobalKey (com.google.gwtexpui.globalkey.client.GlobalKey)1 SafeHtmlBuilder (com.google.gwtexpui.safehtml.client.SafeHtmlBuilder)1