summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Munteanu2011-10-12 15:41:21 (EDT)
committerSteffen Pingel2011-10-13 17:27:53 (EDT)
commitfe8ab1edf30587c1dd9cd0378be921225f34fb5f (patch)
tree29d6626c135bfbd9b37077078dced6a76bc443a7
parentf2f1813f7f3d07d733c55ad99592ee6271c5a6c4 (diff)
downloadorg.eclipse.mylyn.reviews-fe8ab1edf30587c1dd9cd0378be921225f34fb5f.zip
org.eclipse.mylyn.reviews-fe8ab1edf30587c1dd9cd0378be921225f34fb5f.tar.gz
org.eclipse.mylyn.reviews-fe8ab1edf30587c1dd9cd0378be921225f34fb5f.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);