summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-05-21 16:13:43 (EDT)
committer Tomasz Zarna2013-05-21 17:12:28 (EDT)
commitd44163c9b96548867b2422e38223782e0c13a59a (patch)
treed936dda60d6a7aa5b33ab122022faeea2b7270cb
parenta02df0477e9060f1dd3f2a151f853d593dce2c39 (diff)
downloadorg.eclipse.mylyn.reviews-d44163c9b96548867b2422e38223782e0c13a59a.zip
org.eclipse.mylyn.reviews-d44163c9b96548867b2422e38223782e0c13a59a.tar.gz
org.eclipse.mylyn.reviews-d44163c9b96548867b2422e38223782e0c13a59a.tar.bz2
407649: [regression] review editor shows SUBM category that is notrefs/changes/34/13034/2
displayed in web UI Bug: 407649 Change-Id: I0b1e5954cc886164742727dad225bc489cc4655d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=407649
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewDetailSection.java19
1 files changed, 14 insertions, 5 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 507ae6c..e9b217a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Tasktop Technologies and others.
+ * Copyright (c) 2010, 2013 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
package org.eclipse.mylyn.reviews.ui.spi.editor;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
@@ -77,7 +78,15 @@ public abstract class ReviewDetailSection extends AbstractReviewSection {
subSection.setText("Reviewers");
Composite composite = toolkit.createComposite(subSection);
- int numColumns = getModelRepository().getApprovalTypes().size() + 1;
+ List<IApprovalType> approvalTypes = getModelRepository().getApprovalTypes();
+ List<IApprovalType> approvalTypesWithLabel = new ArrayList<IApprovalType>(approvalTypes.size());
+ for (IApprovalType approvalType : approvalTypes) {
+ if (!approvalType.getKey().equals(approvalType.getName())) {
+ approvalTypesWithLabel.add(approvalType);
+ }
+ }
+
+ int numColumns = approvalTypesWithLabel.size() + 1;
GridLayoutFactory.fillDefaults()
.numColumns(numColumns)
.extendedMargins(0, 0, 0, 5)
@@ -86,14 +95,14 @@ public abstract class ReviewDetailSection extends AbstractReviewSection {
.applyTo(composite);
subSection.setClient(composite);
- if (!getModelRepository().getApprovalTypes().isEmpty()) {
+ if (!approvalTypesWithLabel.isEmpty()) {
StringBuilder names = new StringBuilder();
Label headerLabel = new Label(composite, SWT.NONE);
headerLabel.setText(" "); //$NON-NLS-1$
StringBuilder needs = new StringBuilder();
- for (IApprovalType approvalType : getModelRepository().getApprovalTypes()) {
+ for (IApprovalType approvalType : approvalTypesWithLabel) {
IRequirementEntry requirementEntry = getReview().getRequirements().get(approvalType);
Composite headerContainer = new Composite(composite, SWT.NONE);
headerContainer.setForeground(toolkit.getColors().getColor(IFormColors.TB_BG));
@@ -136,7 +145,7 @@ public abstract class ReviewDetailSection extends AbstractReviewSection {
reviewerRowLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
reviewerRowLabel.setText(entry.getKey().getDisplayName());
- for (IApprovalType approvalType : getModelRepository().getApprovalTypes()) {
+ for (IApprovalType approvalType : approvalTypesWithLabel) {
Integer value = entry.getValue().getApprovals().get(approvalType);
Label approvalValueLabel = new Label(composite, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.FILL).applyTo(approvalValueLabel);