Search in sources :

Example 1 with CommentLinkProcessor

use of com.google.gerrit.client.ui.CommentLinkProcessor in project gerrit by GerritCodeReview.

the class Message method renderComments.

private void renderComments(List<CommentInfo> list) {
    CommentLinkProcessor clp = history.getCommentLinkProcessor();
    PatchSet.Id ps = new PatchSet.Id(history.getChangeId(), info._revisionNumber());
    TreeMap<String, List<CommentInfo>> m = byPath(list);
    List<CommentInfo> l = m.remove(Patch.COMMIT_MSG);
    if (l != null) {
        comments.add(new FileComments(clp, ps, Util.C.commitMessage(), l));
    }
    l = m.remove(Patch.MERGE_LIST);
    if (l != null) {
        comments.add(new FileComments(clp, ps, Util.C.mergeList(), l));
    }
    for (Map.Entry<String, List<CommentInfo>> e : m.entrySet()) {
        comments.add(new FileComments(clp, ps, e.getKey(), e.getValue()));
    }
}
Also used : CommentLinkProcessor(com.google.gerrit.client.ui.CommentLinkProcessor) PatchSet(com.google.gerrit.reviewdb.client.PatchSet) ArrayList(java.util.ArrayList) List(java.util.List) CommentInfo(com.google.gerrit.client.changes.CommentInfo) Map(java.util.Map) TreeMap(java.util.TreeMap)

Aggregations

CommentInfo (com.google.gerrit.client.changes.CommentInfo)1 CommentLinkProcessor (com.google.gerrit.client.ui.CommentLinkProcessor)1 PatchSet (com.google.gerrit.reviewdb.client.PatchSet)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1