Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2015-12-10 16:21:53 -0500
committerSam Davis2015-12-10 16:21:53 -0500
commitf597b1af01f670654b151b1bbc5c22f65cc2fb46 (patch)
treeca3b402a92dc9d9bb0f0775673eb78df7b743170 /org.eclipse.mylyn.reviews.ui/src
parent36d843b3c44f879ce8430fc8f52a2cb2e3ece513 (diff)
downloadorg.eclipse.mylyn.reviews-f597b1af01f670654b151b1bbc5c22f65cc2fb46.tar.gz
org.eclipse.mylyn.reviews-f597b1af01f670654b151b1bbc5c22f65cc2fb46.tar.xz
org.eclipse.mylyn.reviews-f597b1af01f670654b151b1bbc5c22f65cc2fb46.zip
fix review mapping initialization and add status column to table
Diffstat (limited to 'org.eclipse.mylyn.reviews.ui/src')
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewColumnLabelProvider.java36
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java8
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskReview.java5
3 files changed, 20 insertions, 29 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewColumnLabelProvider.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewColumnLabelProvider.java
index 560644dd..5b0678eb 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewColumnLabelProvider.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewColumnLabelProvider.java
@@ -16,8 +16,6 @@ import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.reviews.ui.editors.parts.TaskReview;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
-import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
-import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.swt.graphics.Image;
/**
@@ -29,31 +27,23 @@ public class ReviewColumnLabelProvider extends ColumnLabelProvider {
private final int NOT_VERIFIED = -1;
- private final TaskDataModel model;
+ private static final int DESCRIPTION_COLUMN = 0;
- private final AttributeEditorToolkit attributeEditorToolkit;
+ private static final int CODE_REVIEW_COLUMN = 1;
- private final int DESCRIPTION_COLUMN = 0;
+ private static final int VERIFIED_COLUMN = 2;
- private final int CODE_REVIEW_COLUMN = 1;
+ private static final int STATUS_COLUMN = 3;
- private final int VERIFIED_COLUMN = 2;
+ private static final int MINUS_TWO = -2;
- private final int INCOMING_CHANGES_COLUMN = 3;
+ private static final int MINUS_ONE = -1;
- private final int MINUS_TWO = -2;
+ private static final int PLUS_ONE = 1;
- private final int MINUS_ONE = -1;
+ private static final int PLUS_TWO = 2;
- private final int ZERO = 0;
-
- private final int PLUS_ONE = 1;
-
- private final int PLUS_TWO = 2;
-
- public ReviewColumnLabelProvider(TaskDataModel model, AttributeEditorToolkit attributeEditorToolkit) {
- this.model = model;
- this.attributeEditorToolkit = attributeEditorToolkit;
+ public ReviewColumnLabelProvider() {
}
public Image getColumnImage(Object element, int columnIndex) {
@@ -66,8 +56,6 @@ public class ReviewColumnLabelProvider extends ColumnLabelProvider {
return getReviewStateImage(reviewContainer);
case VERIFIED_COLUMN:
return getVerifiedStateImage(reviewContainer);
- case INCOMING_CHANGES_COLUMN:
- return CommonImages.getImage(CommonImages.OVERLAY_CLEAR);
}
return null;
@@ -118,10 +106,10 @@ public class ReviewColumnLabelProvider extends ColumnLabelProvider {
switch (columnIndex) {
case DESCRIPTION_COLUMN:
return reviewContainer.getSummary();
- case INCOMING_CHANGES_COLUMN:
- return reviewContainer.getIncomingChanges();
+ case STATUS_COLUMN:
+ return reviewContainer.getStatus();
default:
- return "";
+ return ""; //$NON-NLS-1$
}
}
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java
index 4ac1a827..3df250bb 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java
@@ -57,12 +57,11 @@ public class TaskEditorReviewsPart extends AbstractTaskEditorPart {
private Table reviewsTable;
private final String[] REVIEWS_COLUMNS = { Messages.TaskEditorReviewsPart_DescriptionString,
- Messages.TaskEditorReviewsPart_CodeReviewString, Messages.TaskEditorReviewsPart_VerifiedString,
- Messages.TaskEditorReviewsPart_IncomingChangesString };
+ Messages.TaskEditorReviewsPart_CodeReviewString, Messages.TaskEditorReviewsPart_VerifiedString, "Status" };
private SelectionProviderAdapter selectionProvider;
- private final int[] REVIEWS_COLUMNS_WIDTH = { 400, 50, 50, 300, 0 };
+ private final int[] REVIEWS_COLUMNS_WIDTH = { 600, 30, 30, 90, 0 };
private TableViewer reviewsViewer;
@@ -161,8 +160,7 @@ public class TaskEditorReviewsPart extends AbstractTaskEditorPart {
ColumnViewerToolTipSupport.enableFor(reviewsViewer, ToolTip.NO_RECREATE);
reviewsViewer.setContentProvider(new ArrayContentProvider());
- reviewsViewer.setLabelProvider(
- new ReviewColumnLabelProvider(getModel(), getTaskEditorPage().getAttributeEditorToolkit()));
+ reviewsViewer.setLabelProvider(new ReviewColumnLabelProvider());
reviewsViewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskReview.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskReview.java
index 87c917b1..253c7bce 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskReview.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskReview.java
@@ -13,6 +13,7 @@ package org.eclipse.mylyn.internal.reviews.ui.editors.parts;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
public class TaskReview {
@@ -57,4 +58,8 @@ public class TaskReview {
public SynchronizationState getSyncState() {
return review.getSynchronizationState();
}
+
+ public String getStatus() {
+ return review.getAttribute(TaskAttribute.STATUS);
+ }
} \ No newline at end of file

Back to the top