summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Munteanu2011-10-12 15:41:21 (EDT)
committerSteffen Pingel2011-10-12 15:43:31 (EDT)
commitae56d42b584d66f561df06588116c0033b2671ab (patch)
treeadd1fea3f40c6a9c64ec0913eee23e725e5cee1a
parente1835d63153fcf619820fe2ee3cd50a88d8ce773 (diff)
downloadorg.eclipse.mylyn.reviews-ae56d42b584d66f561df06588116c0033b2671ab.zip
org.eclipse.mylyn.reviews-ae56d42b584d66f561df06588116c0033b2671ab.tar.gz
org.eclipse.mylyn.reviews-ae56d42b584d66f561df06588116c0033b2671ab.tar.bz2
bug 360549: AbstractCommentPart.createReadOnlyText hardcodes the task
repository lookup
-rw-r--r--framework/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/AbstractCommentPart.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/framework/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/AbstractCommentPart.java b/framework/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/AbstractCommentPart.java
index c8a2d41..202a940 100644
--- a/framework/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/AbstractCommentPart.java
+++ b/framework/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/AbstractCommentPart.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Atlassian - initial API and implementation
+ * Robert Munteanu - fix for bug 360549
******************************************************************************/
package org.eclipse.mylyn.internal.reviews.ui.editors.parts;
@@ -16,6 +17,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
@@ -26,7 +28,10 @@ import org.eclipse.mylyn.internal.reviews.ui.IReviewActionListener;
import org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions;
import org.eclipse.mylyn.reviews.core.model.IComment;
+import org.eclipse.mylyn.reviews.ui.ReviewBehavior;
+import org.eclipse.mylyn.reviews.ui.ReviewUi;
import org.eclipse.mylyn.reviews.ui.SizeCachingComposite;
+import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorExtension;
@@ -181,11 +186,14 @@ public abstract class AbstractCommentPart<V extends ExpandablePart<IComment, V>>
private Control createReadOnlyText(FormToolkit toolkit, Composite composite, String value) {
int style = SWT.FLAT | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP;
- // FIXME
- TaskRepository repository = TasksUi.getRepositoryManager()
- .getRepositories("org.eclipse.mylyn.gerrit")
- .iterator()
- .next();
+
+ ReviewBehavior activeReview = ReviewUi.getActiveReview();
+ Assert.isNotNull(activeReview, "No active review.");
+
+ ITask task = activeReview.getTask();
+
+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(task.getConnectorKind(),
+ task.getRepositoryUrl());
AbstractTaskEditorExtension extension = TaskEditorExtensions.getTaskEditorExtension(repository);