Search in sources :

Example 1 with SafeHtml

use of com.google.gwtexpui.safehtml.client.SafeHtml in project gerrit by GerritCodeReview.

the class Reviewers method display.

private void display(ChangeInfo info) {
    Map<ReviewerState, List<AccountInfo>> reviewers = info.reviewers();
    Map<Integer, AccountInfo> r = byAccount(reviewers, ReviewerState.REVIEWER);
    Map<Integer, AccountInfo> cc = byAccount(reviewers, ReviewerState.CC);
    for (Integer i : r.keySet()) {
        cc.remove(i);
    }
    cc.remove(info.owner()._accountId());
    Set<Integer> removable = info.removableReviewerIds();
    Map<Integer, VotableInfo> votable = votable(info);
    SafeHtml rHtml = Labels.formatUserList(style, r.values(), removable, null, votable);
    SafeHtml ccHtml = Labels.formatUserList(style, cc.values(), removable, null, votable);
    reviewersText.setInnerSafeHtml(rHtml);
    ccText.setInnerSafeHtml(ccHtml);
    if (Gerrit.isSignedIn()) {
        int currentUser = Gerrit.getUserAccount()._accountId();
        boolean showAddMeButton = info.owner()._accountId() != currentUser && !cc.containsKey(currentUser) && !r.containsKey(currentUser);
        addMe.setVisible(showAddMeButton);
    }
}
Also used : ReviewerState(com.google.gerrit.extensions.client.ReviewerState) SafeHtml(com.google.gwtexpui.safehtml.client.SafeHtml) List(java.util.List) AccountInfo(com.google.gerrit.client.info.AccountInfo)

Example 2 with SafeHtml

use of com.google.gwtexpui.safehtml.client.SafeHtml in project gerrit by GerritCodeReview.

the class Unified method setLineNumber.

private void setLineNumber(DisplaySide side, int cmLine, Integer line, String styleName) {
    SafeHtml html = SafeHtml.asis(line != null ? line.toString() : "&nbsp;");
    InlineHTML gutter = new InlineHTML(html);
    diffTable.add(gutter);
    gutter.setStyleName(styleName);
    cm.setGutterMarker(cmLine, side == DisplaySide.A ? UnifiedTable.style.lineNumbersLeft() : UnifiedTable.style.lineNumbersRight(), gutter.getElement());
}
Also used : SafeHtml(com.google.gwtexpui.safehtml.client.SafeHtml) InlineHTML(com.google.gwt.user.client.ui.InlineHTML)

Aggregations

SafeHtml (com.google.gwtexpui.safehtml.client.SafeHtml)2 AccountInfo (com.google.gerrit.client.info.AccountInfo)1 ReviewerState (com.google.gerrit.extensions.client.ReviewerState)1 InlineHTML (com.google.gwt.user.client.ui.InlineHTML)1 List (java.util.List)1