use of org.eclipse.mylyn.internal.tasks.ui.editors.CommentGroupStrategy.CommentGroup in project linuxtools by eclipse.
the class OSIOWorkitemLinkAttributeEditor method getCommentGroupViewers.
public List<CommentGroupViewer> getCommentGroupViewers() {
if (commentGroupViewers != null) {
return commentGroupViewers;
}
// group comments
List<ITaskComment> comments = new ArrayList<ITaskComment>();
for (TaskAttribute commentAttribute : this.commentAttributes) {
comments.add(convertToTaskComment(getModel(), commentAttribute));
}
String currentPersonId = getModel().getTaskRepository().getUserName();
List<CommentGroup> commentGroups = getCommentGroupStrategy().groupComments(comments, currentPersonId);
commentGroupViewers = new ArrayList<CommentGroupViewer>(commentGroups.size());
if (commentGroups.size() > 0) {
for (int i = 0; i < commentGroups.size(); i++) {
CommentGroupViewer viewer = new CommentGroupViewer(commentGroups.get(i));
boolean isLastGroup = i == commentGroups.size() - 1;
viewer.setRenderedInSubSection(!isLastGroup);
commentGroupViewers.add(viewer);
}
}
return commentGroupViewers;
}
Aggregations