Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2017-02-14 21:00:42 -0500
committerGerrit Code Review @ Eclipse.org2017-02-16 18:14:43 -0500
commit4e453840a6abef72154b039b65464da1089e7d40 (patch)
tree165173e63f70851595822d9ec8e0e1516b3979d9 /org.eclipse.mylyn.reviews.ui/src
parent48491e2a938a1a88d18eaf489b091fa41e71e34d (diff)
downloadorg.eclipse.mylyn.reviews-4e453840a6abef72154b039b65464da1089e7d40.tar.gz
org.eclipse.mylyn.reviews-4e453840a6abef72154b039b65464da1089e7d40.tar.xz
org.eclipse.mylyn.reviews-4e453840a6abef72154b039b65464da1089e7d40.zip
512204: sort reviewers list by reviewer name
Change-Id: I956f942934b8f7211ee21444dc51dc53509fe1d7 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=512204 Signed-off-by: Jaxsun McCarthy Huggan <jaxsun.mccarthy@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.reviews.ui/src')
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java
index dcd103bc..ab632e89 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java
@@ -15,7 +15,9 @@ package org.eclipse.mylyn.reviews.ui.spi.editor;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.TreeMap;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.layout.GridDataFactory;
@@ -146,13 +148,17 @@ public abstract class ReviewDetailSection extends AbstractReviewSection {
AbstractUiFactoryProvider<IUser> reviewerUiFactoryProvider = getReviewerUiFactoryProvider();
- for (Entry<IUser, IReviewerEntry> entry : getReview().getReviewerApprovals().entrySet()) {
- IUser currentUser = entry.getKey();
+ Map<IUser, IReviewerEntry> sortedReviewerApprovals = new TreeMap<>(
+ (u1, u2) -> u1.getDisplayName().compareTo(u2.getDisplayName()));
+ sortedReviewerApprovals.putAll(getReview().getReviewerApprovals());
+
+ for (Entry<IUser, IReviewerEntry> approval : sortedReviewerApprovals.entrySet()) {
+ IUser currentUser = approval.getKey();
createReviewerLabelAndControls(composite, reviewerUiFactoryProvider, currentUser);
for (IApprovalType approvalType : approvalTypesWithLabel) {
- Integer value = entry.getValue().getApprovals().get(approvalType);
+ Integer value = approval.getValue().getApprovals().get(approvalType);
Label approvalValueLabel = new Label(composite, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.FILL).applyTo(approvalValueLabel);
String rankingText = " "; //$NON-NLS-1$

Back to the top