summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2012-12-11 20:50:04 (EST)
committer Miles Parker2013-01-09 15:10:28 (EST)
commitb26108c7b04aa412183a64b29bc0111d8697d0f1 (patch)
tree7722faf65def49214b7c8a7dcf2384b282125559
parent6fd452e6360f5278dd7184b0b2626e15203d7ce8 (diff)
downloadorg.eclipse.mylyn.reviews-b26108c7b04aa412183a64b29bc0111d8697d0f1.zip
org.eclipse.mylyn.reviews-b26108c7b04aa412183a64b29bc0111d8697d0f1.tar.gz
org.eclipse.mylyn.reviews-b26108c7b04aa412183a64b29bc0111d8697d0f1.tar.bz2
394925: [navigator] extend model to support common navigatorrefs/changes/75/9175/6
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394925 •Create TopicContainer to encapsulate all items that can contain topics, that is Reviews and ReviewItems. •Created a derived "allComments" reference for TopicContainers. This represents all comments contained (reachable) from the container, e.g. Reviews contain all PatchSets comments, which contain all Artifact comments. •Move createTopicComment operation to TopicContainer, so Review instances provide this behavior. •Created a directTopics reference that isn't derived. In the base case this simply shadows topics. This change is temporary to support R4E until we can change topics to be non-derived. •Created an opposite reference from Comment "parentTopic" to Topic "comments". •Created an "owner" reference for Reviews. •Added a reference to FileItem (file) from File Revision. •Added rangeMin and rangeMax derived values for line locations. •Created an Indexed interface to allow items to place themselves in an arbitrary ordered space. (e.g. linenumber for comments) •Created a Dated interface to support all classes that have creation and update dates. Change-Id: Ief29de10dfdaf27e252f1782ebd111d351f92232 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=394925
-rw-r--r--org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java2
-rw-r--r--org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/IndexedTest.java101
-rw-r--r--org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/ReviewItemTest.java86
-rw-r--r--org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/TopicContainerTest.java222
-rw-r--r--org.eclipse.mylyn.reviews.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--org.eclipse.mylyn.reviews.core/model/reviews.ecore51
-rw-r--r--org.eclipse.mylyn.reviews.core/model/reviews.genmodel2
-rw-r--r--org.eclipse.mylyn.reviews.core/plugin.properties12
-rw-r--r--org.eclipse.mylyn.reviews.core/plugin.xml7
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IComment.java59
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IDated.java80
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IFileRevision.java27
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IIndexed.java50
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IItem.java76
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILineLocation.java28
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILocation.java4
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReview.java43
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItem.java28
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItemSet.java6
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java16
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopicContainer.java80
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Comment.java321
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileItem.java26
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileRevision.java64
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/LineLocation.java88
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Location.java51
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Review.java260
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItem.java101
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItemSet.java201
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java55
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java1009
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java92
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java56
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/TopicContainer.java245
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java4
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java8
36 files changed, 2917 insertions, 647 deletions
diff --git a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java
index 52c4127..0dd7181 100644
--- a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java
+++ b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java
@@ -52,7 +52,7 @@ public class GerritReviewBehavior extends ReviewBehavior {
for (ILocation location : topic.getLocations()) {
if (location instanceof ILineLocation) {
ILineLocation lineLocation = (ILineLocation) location;
- SaveDraftRequest request = new SaveDraftRequest(key, lineLocation.getTotalMin(), side);
+ SaveDraftRequest request = new SaveDraftRequest(key, lineLocation.getRangeMin(), side);
request.setMessage(topic.getDescription());
GerritOperation<PatchLineComment> operation = getOperationFactory().createSaveDraftOperation(getTask(),
diff --git a/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/IndexedTest.java b/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/IndexedTest.java
new file mode 100644
index 0000000..3eca86d
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/IndexedTest.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2012 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.sameInstance;
+import static org.junit.Assert.assertThat;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.mylyn.reviews.internal.core.model.ReviewsFactory;
+import org.junit.Before;
+import org.junit.Test;
+
+public class IndexedTest {
+
+ private ILineLocation l1;
+
+ private ILineLocation l2;
+
+ @Before
+ public void setup() {
+ l1 = ReviewsFactory.eINSTANCE.createLineLocation();
+ ILineRange l1r1 = ReviewsFactory.eINSTANCE.createLineRange();
+ l1r1.setStart(100);
+ l1r1.setEnd(100);
+ l1.getRanges().add(l1r1);
+ ILineRange l1r2 = ReviewsFactory.eINSTANCE.createLineRange();
+ l1r2.setStart(200);
+ l1r2.setEnd(200);
+ l1.getRanges().add(l1r2);
+ assertThat(l1.getRangeMin(), is(100));
+ assertThat(l1.getRangeMax(), is(200));
+
+ l2 = ReviewsFactory.eINSTANCE.createLineLocation();
+ ILineRange l2r1 = ReviewsFactory.eINSTANCE.createLineRange();
+ l2r1.setStart(10000);
+ l2r1.setEnd(10000);
+ l2.getRanges().add(l2r1);
+ ILineRange l2r2 = ReviewsFactory.eINSTANCE.createLineRange();
+ l2r2.setStart(30);
+ l2r2.setEnd(30);
+ l2.getRanges().add(l2r2);
+ assertThat(l2.getRangeMin(), is(30));
+ assertThat(l2.getRangeMax(), is(10000));
+ }
+
+ @Test
+ public void testLineLocation() {
+ List<ILineLocation> orderable = new ArrayList<ILineLocation>();
+ orderable.add(l1);
+ orderable.add(l2);
+ Collections.sort(orderable, IIndexed.COMPARATOR);
+ assertThat(orderable.get(0), sameInstance(l2));
+ assertThat(orderable.get(1), sameInstance(l1));
+ }
+
+ @Test
+ public void testTopic() {
+ ITopic t1 = ReviewsFactory.eINSTANCE.createTopic();
+ t1.getLocations().add(l1);
+ ITopic t2 = ReviewsFactory.eINSTANCE.createTopic();
+ t2.getLocations().add(l2);
+ List<ITopic> orderable = new ArrayList<ITopic>();
+ orderable.add(t1);
+ orderable.add(t2);
+
+ Collections.sort(orderable, IIndexed.COMPARATOR);
+ assertThat(orderable.get(0), sameInstance(t2));
+ assertThat(orderable.get(1), sameInstance(t1));
+ }
+
+ @Test
+ public void testComment() {
+ IComment c1 = ReviewsFactory.eINSTANCE.createComment();
+ IComment c2 = ReviewsFactory.eINSTANCE.createComment();
+ ITopic t1 = ReviewsFactory.eINSTANCE.createTopic();
+ t1.getComments().add(c1);
+ t1.getLocations().add(l1);
+ ITopic t2 = ReviewsFactory.eINSTANCE.createTopic();
+ t2.getComments().add(c2);
+ t2.getLocations().add(l2);
+ List<IComment> orderable = new ArrayList<IComment>();
+ orderable.add(c1);
+ orderable.add(c2);
+
+ Collections.sort(orderable, IIndexed.COMPARATOR);
+ assertThat(orderable.get(0), sameInstance(c2));
+ assertThat(orderable.get(1), sameInstance(c1));
+ }
+}
diff --git a/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/ReviewItemTest.java b/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/ReviewItemTest.java
deleted file mode 100644
index 19d2dfc..0000000
--- a/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/ReviewItemTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2012 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- */
-package org.eclipse.mylyn.reviews.core.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-
-import org.eclipse.mylyn.reviews.internal.core.model.ReviewsFactory;
-import org.junit.Test;
-
-/**
- * <!-- begin-user-doc --> A test case for the model object '<em><b>Review Item</b></em>'. <!-- end-user-doc -->
- * <p>
- * The following operations are tested:
- * <ul>
- * <li>
- * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation, java.lang.String)
- * <em>Create Topic Comment</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ReviewItemTest {
-
- /**
- * Tests the '
- * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation, java.lang.String)
- * <em>Create Topic Comment</em>}' operation. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation,
- * java.lang.String)
- * @generated NOT
- */
- @Test
- public void testCreateTopicComment() {
- IReviewItem item = ReviewsFactory.eINSTANCE.createReviewItem();
- ILineLocation location = ReviewsFactory.eINSTANCE.createLineLocation();
- IUser definedUser = ReviewsFactory.eINSTANCE.createUser();
- definedUser.setDisplayName("Some User");
- item.setAddedBy(definedUser);
- ITopic topic = item.createTopicComment(location, "My Comment");
- assertTrue(item.getTopics().contains(topic));
- assertSame(topic.getItem(), item);
- //TODO Is this really what we want here - do topic comments stay in sync w/ Comment comments? Why do we have this redundancy in model?
- assertEquals("My Comment", topic.getDescription());
- assertEquals(1, topic.getComments().size());
- IComment comment = topic.getComments().get(0);
- assertEquals("Some User", comment.getAuthor().getDisplayName());
- assertEquals("Some User", topic.getAuthor().getDisplayName());
- assertTrue(new Date().getTime() - 10000 < topic.getCreationDate().getTime());
- assertEquals("My Comment", comment.getDescription());
- }
-
- /**
- * Tests the '
- * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation, java.lang.String)
- * <em>Create Topic Comment</em>}' operation. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation,
- * java.lang.String)
- * @generated NOT
- */
- @Test
- public void testCreateTopicCommentNoUser() {
- IReviewItem item = ReviewsFactory.eINSTANCE.createReviewItem();
- ILineLocation location = ReviewsFactory.eINSTANCE.createLineLocation();
- ITopic topic = item.createTopicComment(location, "My Comment");
- assertEquals(1, topic.getComments().size());
- IComment comment = topic.getComments().get(0);
- assertEquals("<Undefined>", comment.getAuthor().getDisplayName());
- assertEquals("<Undefined>", topic.getAuthor().getDisplayName());
- }
-
-} //ReviewItemTest
diff --git a/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/TopicContainerTest.java b/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/TopicContainerTest.java
new file mode 100644
index 0000000..87b4047
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core.tests/src/org/eclipse/mylyn/reviews/core/model/TopicContainerTest.java
@@ -0,0 +1,222 @@
+/**
+ * Copyright (c) 2012 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.sameInstance;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.mylyn.reviews.internal.core.model.ReviewsFactory;
+import org.junit.Test;
+
+/**
+ * <!-- begin-user-doc --> A test case for the model object '<em><b>Review Item</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following operations are tested:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#createTopicComment(org.eclipse.mylyn.reviews.core.model.ILocation, java.lang.String)
+ * <em>Create Topic Comment</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TopicContainerTest {
+
+ @Test
+ public void testGetAllCommentsFileItems() {
+ IFileItem f1 = ReviewsFactory.eINSTANCE.createFileItem();
+ ITopic topic0 = ReviewsFactory.eINSTANCE.createTopic();
+ f1.getTopics().add(topic0);
+ ITopic topic1 = ReviewsFactory.eINSTANCE.createTopic();
+ f1.getTopics().add(topic1);
+ f1.setBase(ReviewsFactory.eINSTANCE.createFileRevision());
+ f1.setTarget(ReviewsFactory.eINSTANCE.createFileRevision());
+ ITopic topic2 = ReviewsFactory.eINSTANCE.createTopic();
+ f1.getBase().getTopics().add(topic2);
+ ITopic topic3 = ReviewsFactory.eINSTANCE.createTopic();
+ f1.getTarget().getTopics().add(topic3);
+ assertThat(f1.getAllComments().size(), is(4));
+ assertThat((ITopic) f1.getAllComments().get(0), sameInstance(topic0));
+ assertThat((ITopic) f1.getAllComments().get(1), sameInstance(topic1));
+ assertThat((ITopic) f1.getAllComments().get(2), sameInstance(topic2));
+ assertThat((ITopic) f1.getAllComments().get(3), sameInstance(topic3));
+ }
+
+ @Test
+ public void testGetAllCommentsReviewItems() {
+ IReviewItem i1 = ReviewsFactory.eINSTANCE.createReviewItem();
+ i1.getTopics().add(ReviewsFactory.eINSTANCE.createTopic());
+ i1.getTopics().add(ReviewsFactory.eINSTANCE.createTopic());
+ assertThat(i1.getAllComments().size(), is(2));
+ }
+
+ @Test
+ public void testGetAllCommentsReviewItemSet() {
+ IReviewItemSet itemSet = ReviewsFactory.eINSTANCE.createReviewItemSet();
+ IReviewItem i1 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t0 = ReviewsFactory.eINSTANCE.createTopic();
+ i1.getTopics().add(t0);
+ ITopic t1 = ReviewsFactory.eINSTANCE.createTopic();
+ i1.getTopics().add(t1);
+ itemSet.getItems().add(i1);
+ assertThat(itemSet.getAllComments().size(), is(2));
+
+ IReviewItem i2 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t2 = ReviewsFactory.eINSTANCE.createTopic();
+ i2.getTopics().add(t2);
+ ITopic t3 = ReviewsFactory.eINSTANCE.createTopic();
+ i2.getTopics().add(t3);
+ itemSet.getItems().add(i2);
+ assertThat(itemSet.getAllComments().size(), is(4));
+
+ IReviewItemSet subSet = ReviewsFactory.eINSTANCE.createReviewItemSet();
+ IReviewItem i3 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t4 = ReviewsFactory.eINSTANCE.createTopic();
+ i3.getTopics().add(t4);
+ subSet.getItems().add(i3);
+ itemSet.getItems().add(subSet);
+ assertThat(itemSet.getAllComments().size(), is(5));
+ assertThat((ITopic) itemSet.getAllComments().get(0), is(t0));
+ assertThat((ITopic) itemSet.getAllComments().get(1), is(t1));
+ assertThat((ITopic) itemSet.getAllComments().get(2), is(t2));
+ assertThat((ITopic) itemSet.getAllComments().get(3), is(t3));
+ assertThat((ITopic) itemSet.getAllComments().get(4), is(t4));
+ }
+
+ @Test
+ public void testGetAllCommentsReview() {
+ IReview review = ReviewsFactory.eINSTANCE.createReview();
+ ITopic t0 = ReviewsFactory.eINSTANCE.createTopic();
+ review.getTopics().add(t0);
+ assertThat(review.getAllComments().size(), is(1));
+
+ IReviewItemSet itemSet = ReviewsFactory.eINSTANCE.createReviewItemSet();
+ review.getItems().add(itemSet);
+ IReviewItem i1 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t1 = ReviewsFactory.eINSTANCE.createTopic();
+ i1.getTopics().add(t1);
+ ITopic t2 = ReviewsFactory.eINSTANCE.createTopic();
+ i1.getTopics().add(t2);
+ itemSet.getItems().add(i1);
+ assertThat(review.getAllComments().size(), is(3));
+
+ IReviewItem i2 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t3 = ReviewsFactory.eINSTANCE.createTopic();
+ i2.getTopics().add(t3);
+ ITopic t4 = ReviewsFactory.eINSTANCE.createTopic();
+ i2.getTopics().add(t4);
+ itemSet.getItems().add(i2);
+ assertThat(review.getAllComments().size(), is(5));
+
+ IReviewItemSet subSet = ReviewsFactory.eINSTANCE.createReviewItemSet();
+ IReviewItem i3 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t5 = ReviewsFactory.eINSTANCE.createTopic();
+ i3.getTopics().add(t5);
+ t5.setId("5");
+ subSet.getItems().add(i3);
+ itemSet.getItems().add(subSet);
+ assertThat(review.getAllComments().size(), is(6));
+
+ IReviewItemSet reviewSubSet = ReviewsFactory.eINSTANCE.createReviewItemSet();
+ IReviewItem i4 = ReviewsFactory.eINSTANCE.createReviewItem();
+ ITopic t6 = ReviewsFactory.eINSTANCE.createTopic();
+ i4.getTopics().add(t6);
+ t6.setId("6");
+ reviewSubSet.getItems().add(i4);
+ review.getItems().add(reviewSubSet);
+ assertThat(review.getAllComments().size(), is(7));
+
+ assertThat((ITopic) review.getAllComments().get(0), is(t0));
+ assertThat((ITopic) review.getAllComments().get(1), is(t1));
+ assertThat((ITopic) review.getAllComments().get(2), is(t2));
+ assertThat((ITopic) review.getAllComments().get(3), is(t3));
+ assertThat((ITopic) review.getAllComments().get(4), is(t4));
+ assertThat((ITopic) review.getAllComments().get(5), is(t5));
+ assertThat((ITopic) review.getAllComments().get(6), is(t6));
+ }
+
+ @Test
+ public void testGetAllCommentReplies() {
+ IReview review = ReviewsFactory.eINSTANCE.createReview();
+ ITopic mainTopic = ReviewsFactory.eINSTANCE.createTopic();
+ review.getTopics().add(mainTopic);
+ List<IComment> allComments = review.getAllComments();
+ assertThat(allComments.size(), is(1));
+
+ IComment comment0 = ReviewsFactory.eINSTANCE.createComment();
+ mainTopic.getReplies().add(comment0);
+
+ allComments = review.getAllComments();
+ assertThat(allComments.size(), is(2));
+ assertThat((ITopic) allComments.get(0), is(mainTopic));
+ assertThat(allComments.get(1), is(comment0));
+ }
+
+ @Test
+ public void testCreateReviewItemTopicComment() {
+ IReviewItem item = ReviewsFactory.eINSTANCE.createReviewItem();
+ ILineLocation location = ReviewsFactory.eINSTANCE.createLineLocation();
+ IUser definedUser = ReviewsFactory.eINSTANCE.createUser();
+ definedUser.setDisplayName("Some User");
+ item.setAddedBy(definedUser);
+ ITopic topic = item.createTopicComment(location, "My Comment");
+ assertTrue(item.getTopics().contains(topic));
+ assertSame(topic.getItem(), item);
+ //TODO Is this really what we want here - do topic comments stay in sync w/ Comment comments? Why do we have this redundancy in model?
+ assertThat(topic.getDescription(), is("My Comment"));
+ assertThat(topic.getComments().size(), is(1));
+ IComment comment = topic.getComments().get(0);
+ assertThat(comment.getAuthor().getDisplayName(), is("Some User"));
+ assertThat(topic.getAuthor().getDisplayName(), is("Some User"));
+ assertTrue(new Date().getTime() - 10000 < topic.getCreationDate().getTime());
+ assertThat(comment.getDescription(), is("My Comment"));
+ }
+
+ @Test
+ public void testCreateReviewItemTopicCommentNoUser() {
+ IReviewItem item = ReviewsFactory.eINSTANCE.createReviewItem();
+ ILineLocation location = ReviewsFactory.eINSTANCE.createLineLocation();
+ ITopic topic = item.createTopicComment(location, "My Comment");
+ assertThat(item.getTopics().size(), is(1));
+ assertThat(topic.getComments().size(), is(1));
+ IComment comment = topic.getComments().get(0);
+ assertThat(comment.getAuthor().getDisplayName(), is("<Undefined>"));
+ assertThat(topic.getAuthor().getDisplayName(), is("<Undefined>"));
+ }
+
+ @Test
+ public void testCreateReviewTopicCommentNoUser() {
+ IReview review = ReviewsFactory.eINSTANCE.createReview();
+ ILineLocation location = ReviewsFactory.eINSTANCE.createLineLocation();
+ ITopic topic = review.createTopicComment(location, "My Comment");
+ assertThat(review.getTopics().size(), is(1));
+ assertThat(topic.getComments().size(), is(1));
+ IComment comment = topic.getComments().get(0);
+ assertNull(comment.getAuthor());
+ }
+
+ @Test
+ public void testDerivedTopicContainer() {
+ final ITopic topic = ReviewsFactory.eINSTANCE.createTopic();
+ IReview review = ReviewsFactory.eINSTANCE.createReview();
+ review.getDirectTopics().add(topic);
+ assertThat(review.getTopics().size(), is(1));
+ assertThat(review.getTopics().get(0), is(topic));
+ }
+} //ReviewItemTest
diff --git a/org.eclipse.mylyn.reviews.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.mylyn.reviews.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 325dab4..0000000
--- a/org.eclipse.mylyn.reviews.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sat Feb 05 01:34:50 PST 2011
-eclipse.preferences.version=1
-encoding//model/reviews.ecorediag=UTF-8
diff --git a/org.eclipse.mylyn.reviews.core/model/reviews.ecore b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
index 46314f5..f940be9 100644
--- a/org.eclipse.mylyn.reviews.core/model/reviews.ecore
+++ b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
@@ -1,9 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="reviews" nsURI="http://eclipse.org/mylyn/reviews/core/1.0" nsPrefix="reviews">
- <eClassifiers xsi:type="ecore:EClass" name="Review" eSuperTypes="#//ReviewComponent">
+ <eClassifiers xsi:type="ecore:EClass" name="TopicContainer" abstract="true" eSuperTypes="#//ReviewComponent">
+ <eOperations name="createTopicComment" eType="#//Topic">
+ <eParameters name="initalLocation" eType="#//Location"/>
+ <eParameters name="commentText" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="allComments" upperBound="-1"
+ eType="#//Comment" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="topics" upperBound="-1"
eType="#//Topic" transient="true" derived="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="directTopics" upperBound="-1"
+ eType="#//Topic" eOpposite="#//Topic/item"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Review" eSuperTypes="#//TopicContainer #//Dated">
<eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1"
eType="#//ReviewItem" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="reviewTask" eType="#//TaskReference"
@@ -11,34 +21,30 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="state" lowerBound="1" eType="#//ReviewState"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="owner" eType="#//User"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Comment" eSuperTypes="#//ReviewComponent">
+ <eClassifiers xsi:type="ecore:EClass" name="Comment" eSuperTypes="#//ReviewComponent #//Indexed #//Dated">
<eStructuralFeatures xsi:type="ecore:EReference" name="author" lowerBound="1"
eType="#//User" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//CommentType"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="replies" upperBound="-1"
eType="#//Comment" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="draft" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parentTopic" eType="#//Topic"
+ transient="true" eOpposite="#//Topic/comments"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ReviewItem" eSuperTypes="#//ReviewComponent">
- <eOperations name="createTopicComment" eType="#//Topic">
- <eParameters name="initalLocation" eType="#//Location"/>
- <eParameters name="commentText" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
+ <eClassifiers xsi:type="ecore:EClass" name="ReviewItem" eSuperTypes="#//TopicContainer">
<eStructuralFeatures xsi:type="ecore:EReference" name="addedBy" lowerBound="1"
eType="#//User"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="review" lowerBound="1"
eType="#//Review"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="topics" upperBound="-1"
- eType="#//Topic" eOpposite="#//Topic/item"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Location" abstract="true"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Location" abstract="true" eSuperTypes="#//Indexed"/>
<eClassifiers xsi:type="ecore:EClass" name="User">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="email" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
@@ -63,12 +69,12 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="locations" upperBound="-1"
eType="#//Location" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="comments" upperBound="-1"
- eType="#//Comment" transient="true" derived="true"/>
+ eType="#//Comment" transient="true" derived="true" eOpposite="#//Comment/parentTopic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="review" lowerBound="1"
eType="#//Review"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="item" eType="#//ReviewItem"
- eOpposite="#//ReviewItem/topics"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="item" eType="#//TopicContainer"
+ eOpposite="#//TopicContainer/directTopics"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ReviewComponent">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="enabled" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
@@ -84,7 +90,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="base" eType="#//FileRevision"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//FileRevision"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ReviewItemSet" eSuperTypes="#//ReviewItem">
+ <eClassifiers xsi:type="ecore:EClass" name="ReviewItemSet" eSuperTypes="#//ReviewItem #//Dated">
<eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1"
eType="#//ReviewItem"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="revision" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
@@ -93,6 +99,12 @@
<eClassifiers xsi:type="ecore:EClass" name="LineLocation" eSuperTypes="#//Location">
<eStructuralFeatures xsi:type="ecore:EReference" name="ranges" upperBound="-1"
eType="#//LineRange" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rangeMin" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" changeable="false"
+ volatile="true" transient="true" derived="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rangeMax" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" changeable="false"
+ volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LineRange">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="start" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
@@ -102,9 +114,18 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="revision" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="file" eType="#//FileItem"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ModelVersioning" abstract="true" interface="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="fragmentVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="1.0.0"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Indexed" abstract="true" interface="true">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="index" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
+ changeable="false" volatile="true" transient="true" derived="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Dated" abstract="true" interface="true">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="modificationDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/org.eclipse.mylyn.reviews.core/model/reviews.genmodel b/org.eclipse.mylyn.reviews.core/model/reviews.genmodel
index c2416c9..e31ae99 100644
--- a/org.eclipse.mylyn.reviews.core/model/reviews.genmodel
+++ b/org.eclipse.mylyn.reviews.core/model/reviews.genmodel
@@ -36,7 +36,7 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference reviews.ecore#//ReviewItem/addedBy"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference reviews.ecore#//ReviewItem/review"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute reviews.ecore#//ReviewItem/name"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference reviews.ecore#//ReviewItem/topics"/>
+ <genFeatures createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference reviews.ecore#//ReviewItem/topics"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute reviews.ecore#//ReviewItem/id"/>
<genOperations ecoreOperation="reviews.ecore#//ReviewItem/createTopicComment">
<genParameters ecoreParameter="reviews.ecore#//ReviewItem/createTopicComment/initalLocation"/>
diff --git a/org.eclipse.mylyn.reviews.core/plugin.properties b/org.eclipse.mylyn.reviews.core/plugin.properties
new file mode 100644
index 0000000..7389d8e
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/plugin.properties
@@ -0,0 +1,12 @@
+# Copyright (c) 2012 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Tasktop Technologies - initial API and implementation
+
+#Note, these values are not actually used any where but we add them to avoid EMF regenrating with bogus defaults
+pluginName = Mylyn Reviews
+providerName = Eclipse Mylyn
diff --git a/org.eclipse.mylyn.reviews.core/plugin.xml b/org.eclipse.mylyn.reviews.core/plugin.xml
index ae0190e..b41878b 100644
--- a/org.eclipse.mylyn.reviews.core/plugin.xml
+++ b/org.eclipse.mylyn.reviews.core/plugin.xml
@@ -21,4 +21,11 @@
genModel="model/reviews.genmodel"/>
</extension>
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <!-- @generated reviews -->
+ <parser
+ type="xml"
+ class="org.eclipse.mylyn.reviews.internal.core.model.ReviewsResourceFactory"/>
+ </extension>
+
</plugin>
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IComment.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IComment.java
index 7ef7696..0ad1c06 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IComment.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IComment.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.mylyn.reviews.core.model;
-import java.util.Date;
import java.util.List;
/**
@@ -21,16 +20,16 @@ import java.util.List;
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getAuthor <em>Author</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getCreationDate <em>Creation Date</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getReplies <em>Replies</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#isDraft <em>Draft</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic <em>Parent Topic</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public interface IComment extends IReviewComponent {
+public interface IComment extends IReviewComponent, IIndexed, IDated {
/**
* Returns the value of the '<em><b>Author</b></em>' reference. <!-- begin-user-doc -->
* <p>
@@ -107,31 +106,6 @@ public interface IComment extends IReviewComponent {
void setDescription(String value);
/**
- * Returns the value of the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Date</em>' attribute isn't clear, there really should be more of a
- * description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Creation Date</em>' attribute.
- * @see #setCreationDate(Date)
- * @generated
- */
- Date getCreationDate();
-
- /**
- * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IComment#getCreationDate
- * <em>Creation Date</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Creation Date</em>' attribute.
- * @see #getCreationDate()
- * @generated
- */
- void setCreationDate(Date value);
-
- /**
* Returns the value of the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Id</em>' attribute isn't clear, there really should be more of a description here...
@@ -159,7 +133,7 @@ public interface IComment extends IReviewComponent {
* Returns the value of the '<em><b>Replies</b></em>' containment reference list. The list contents are of type
* {@link org.eclipse.mylyn.reviews.core.model.IComment}. <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Replies</em>' containment reference isn't clear, there really should be more of a
+ * If the meaning of the '<em>Replies</em>' containment reference list isn't clear, there really should be more of a
* description here...
* </p>
* <!-- end-user-doc -->
@@ -194,4 +168,31 @@ public interface IComment extends IReviewComponent {
*/
void setDraft(boolean value);
+ /**
+ * Returns the value of the '<em><b>Parent Topic</b></em>' reference. It is bidirectional and its opposite is '
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopic#getComments <em>Comments</em>}'. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Parent Topic</em>' reference isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Parent Topic</em>' reference.
+ * @see #setParentTopic(ITopic)
+ * @see org.eclipse.mylyn.reviews.core.model.ITopic#getComments
+ * @generated
+ */
+ ITopic getParentTopic();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic <em>Parent Topic</em>}
+ * ' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Parent Topic</em>' reference.
+ * @see #getParentTopic()
+ * @generated
+ */
+ void setParentTopic(ITopic value);
+
} // IComment
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IDated.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IDated.java
new file mode 100644
index 0000000..f7f0261
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IDated.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2011 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import java.util.Date;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Dated</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IDated#getCreationDate <em>Creation Date</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IDated#getModificationDate <em>Modification Date</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface IDated extends EObject {
+ /**
+ * Returns the value of the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Creation Date</em>' attribute isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Creation Date</em>' attribute.
+ * @see #setCreationDate(Date)
+ * @generated
+ */
+ Date getCreationDate();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IDated#getCreationDate <em>Creation Date</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Creation Date</em>' attribute.
+ * @see #getCreationDate()
+ * @generated
+ */
+ void setCreationDate(Date value);
+
+ /**
+ * Returns the value of the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Modification Date</em>' attribute isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Modification Date</em>' attribute.
+ * @see #setModificationDate(Date)
+ * @generated
+ */
+ Date getModificationDate();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IDated#getModificationDate
+ * <em>Modification Date</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Modification Date</em>' attribute.
+ * @see #getModificationDate()
+ * @generated
+ */
+ void setModificationDate(Date value);
+
+} // IDated
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IFileRevision.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IFileRevision.java
index f844d1d..ea9d18c 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IFileRevision.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IFileRevision.java
@@ -10,8 +10,6 @@
*/
package org.eclipse.mylyn.reviews.core.model;
-import java.util.List;
-
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>File Revision</b></em>'. <!-- end-user-doc -->
* <p>
@@ -20,6 +18,7 @@ import java.util.List;
* <li>{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getPath <em>Path</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getRevision <em>Revision</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getContent <em>Content</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getFile <em>File</em>}</li>
* </ul>
* </p>
*
@@ -100,4 +99,28 @@ public interface IFileRevision extends IReviewItem {
*/
void setContent(String value);
+ /**
+ * Returns the value of the '<em><b>File</b></em>' reference. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>File</em>' reference isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>File</em>' reference.
+ * @see #setFile(IFileItem)
+ * @generated
+ */
+ IFileItem getFile();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getFile <em>File</em>}'
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>File</em>' reference.
+ * @see #getFile()
+ * @generated
+ */
+ void setFile(IFileItem value);
+
} // IFileRevision
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IIndexed.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IIndexed.java
new file mode 100644
index 0000000..8e60cac
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IIndexed.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2011 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import java.util.Comparator;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Indexed</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IIndexed#getIndex <em>Index</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface IIndexed extends EObject {
+
+ public static final Comparator<IIndexed> COMPARATOR = new Comparator<IIndexed>() {
+
+ public int compare(IIndexed o1, IIndexed o2) {
+ return ((Long) o1.getIndex()).compareTo(o2.getIndex());
+ }
+ };
+
+ /**
+ * Returns the value of the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Index</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Index</em>' attribute.
+ * @generated
+ */
+ long getIndex();
+
+} // IIndexed
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IItem.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IItem.java
deleted file mode 100644
index 09340b4..0000000
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IItem.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2011 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- */
-package org.eclipse.mylyn.reviews.core.model;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Item</b></em>'. <!-- end-user-doc -->
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.IItem#getAddedBy <em>Added By</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.IItem#getReview <em>Review</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public interface IItem extends IReviewComponent {
- /**
- * Returns the value of the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Added By</em>' reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Added By</em>' reference.
- * @see #setAddedBy(IUser)
- * @generated
- */
- IUser getAddedBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IItem#getAddedBy <em>Added By</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Added By</em>' reference.
- * @see #getAddedBy()
- * @generated
- */
- void setAddedBy(IUser value);
-
- /**
- * Returns the value of the '<em><b>Review</b></em>' reference. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Review</em>' reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Review</em>' reference.
- * @see #setReview(IReview)
- * @generated
- */
- IReview getReview();
-
- /**
- * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IItem#getReview <em>Review</em>}' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Review</em>' reference.
- * @see #getReview()
- * @generated
- */
- void setReview(IReview value);
-
-} // IItem
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILineLocation.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILineLocation.java
index b6b127b..b911724 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILineLocation.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILineLocation.java
@@ -18,6 +18,8 @@ import java.util.List;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.core.model.ILineLocation#getRanges <em>Ranges</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMin <em>Range Min</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMax <em>Range Max</em>}</li>
* </ul>
* </p>
*
@@ -38,8 +40,30 @@ public interface ILineLocation extends ILocation {
*/
List<ILineRange> getRanges();
- int getTotalMin();
+ /**
+ * Returns the value of the '<em><b>Range Min</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Range Min</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Range Min</em>' attribute.
+ * @generated
+ */
+ int getRangeMin();
- int getTotalMax();
+ /**
+ * Returns the value of the '<em><b>Range Max</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Range Max</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Range Max</em>' attribute.
+ * @generated
+ */
+ int getRangeMax();
} // ILineLocation
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILocation.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILocation.java
index 7a0d6bf..4027a17 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILocation.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ILocation.java
@@ -10,12 +10,10 @@
*/
package org.eclipse.mylyn.reviews.core.model;
-import org.eclipse.emf.ecore.EObject;
-
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>Location</b></em>'. <!-- end-user-doc -->
*
* @generated
*/
-public interface ILocation extends EObject {
+public interface ILocation extends IIndexed {
} // ILocation
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReview.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReview.java
index 6429ee3..0b897f5 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReview.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReview.java
@@ -17,31 +17,17 @@ import java.util.List;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getTopics <em>Topics</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getItems <em>Items</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getReviewTask <em>Review Task</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getState <em>State</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IReview#getOwner <em>Owner</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public interface IReview extends IReviewComponent {
- /**
- * Returns the value of the '<em><b>Topics</b></em>' reference list. The list contents are of type
- * {@link org.eclipse.mylyn.reviews.core.model.ITopic}. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Topics</em>' reference list isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Topics</em>' reference list.
- * @generated
- */
- List<ITopic> getTopics();
-
+public interface IReview extends ITopicContainer, IDated {
/**
* Returns the value of the '<em><b>Items</b></em>' reference list. The list contents are of type
* {@link org.eclipse.mylyn.reviews.core.model.IReviewItem}. <!-- begin-user-doc -->
@@ -130,4 +116,29 @@ public interface IReview extends IReviewComponent {
*/
void setId(String value);
+ /**
+ * Returns the value of the '<em><b>Owner</b></em>' reference. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Owner</em>' reference isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Owner</em>' reference.
+ * @see #setOwner(IUser)
+ * @generated
+ */
+ IUser getOwner();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IReview#getOwner <em>Owner</em>}' reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Owner</em>' reference.
+ * @see #getOwner()
+ * @generated
+ */
+ void setOwner(IUser value);
+
} // IReview
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItem.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItem.java
index 98414e9..b116424 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItem.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItem.java
@@ -10,8 +10,6 @@
*/
package org.eclipse.mylyn.reviews.core.model;
-import java.util.List;
-
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>Review Item</b></em>'. <!-- end-user-doc -->
* <p>
@@ -20,14 +18,13 @@ import java.util.List;
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getAddedBy <em>Added By</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getReview <em>Review</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getTopics <em>Topics</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public interface IReviewItem extends IReviewComponent {
+public interface IReviewItem extends ITopicContainer {
/**
* Returns the value of the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc -->
* <p>
@@ -103,22 +100,6 @@ public interface IReviewItem extends IReviewComponent {
void setName(String value);
/**
- * Returns the value of the '<em><b>Topics</b></em>' reference list. The list contents are of type
- * {@link org.eclipse.mylyn.reviews.core.model.ITopic}. It is bidirectional and its opposite is '
- * {@link org.eclipse.mylyn.reviews.core.model.ITopic#getItem <em>Item</em>}'. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Topics</em>' reference list isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Topics</em>' reference list.
- * @see org.eclipse.mylyn.reviews.core.model.ITopic#getItem
- * @generated
- */
- List<ITopic> getTopics();
-
- /**
* Returns the value of the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Id</em>' attribute isn't clear, there really should be more of a description here...
@@ -142,11 +123,4 @@ public interface IReviewItem extends IReviewComponent {
*/
void setId(String value);
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- ITopic createTopicComment(ILocation initalLocation, String commentText);
-
} // IReviewItem
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItemSet.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItemSet.java
index 70050ab..e2538d7 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItemSet.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IReviewItemSet.java
@@ -24,13 +24,13 @@ import java.util.List;
*
* @generated
*/
-public interface IReviewItemSet extends IReviewItem {
+public interface IReviewItemSet extends IReviewItem, IDated {
/**
* Returns the value of the '<em><b>Items</b></em>' reference list. The list contents are of type
* {@link org.eclipse.mylyn.reviews.core.model.IReviewItem}. <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Items</em>' containment reference list isn't clear, there really should be more of a
- * description here...
+ * If the meaning of the '<em>Items</em>' reference list isn't clear, there really should be more of a description
+ * here...
* </p>
* <!-- end-user-doc -->
*
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java
index 2835751..fd7aa36 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java
@@ -70,7 +70,9 @@ public interface ITopic extends IComment {
/**
* Returns the value of the '<em><b>Comments</b></em>' reference list. The list contents are of type
- * {@link org.eclipse.mylyn.reviews.core.model.IComment}. <!-- begin-user-doc -->
+ * {@link org.eclipse.mylyn.reviews.core.model.IComment}. It is bidirectional and its opposite is '
+ * {@link org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic <em>Parent Topic</em>}'. <!-- begin-user-doc
+ * -->
* <p>
* If the meaning of the '<em>Comments</em>' reference list isn't clear, there really should be more of a
* description here...
@@ -78,6 +80,7 @@ public interface ITopic extends IComment {
* <!-- end-user-doc -->
*
* @return the value of the '<em>Comments</em>' reference list.
+ * @see org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic
* @generated
*/
List<IComment> getComments();
@@ -134,18 +137,19 @@ public interface ITopic extends IComment {
/**
* Returns the value of the '<em><b>Item</b></em>' reference. It is bidirectional and its opposite is '
- * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getTopics <em>Topics</em>}'. <!-- begin-user-doc -->
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getDirectTopics <em>Direct Topics</em>}'. <!--
+ * begin-user-doc -->
* <p>
* If the meaning of the '<em>Item</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
*
* @return the value of the '<em>Item</em>' reference.
- * @see #setItem(IReviewItem)
- * @see org.eclipse.mylyn.reviews.core.model.IReviewItem#getTopics
+ * @see #setItem(ITopicContainer)
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer#getDirectTopics
* @generated
*/
- IReviewItem getItem();
+ ITopicContainer getItem();
/**
* Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.ITopic#getItem <em>Item</em>}' reference. <!--
@@ -156,6 +160,6 @@ public interface ITopic extends IComment {
* @see #getItem()
* @generated
*/
- void setItem(IReviewItem value);
+ void setItem(ITopicContainer value);
} // ITopic
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopicContainer.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopicContainer.java
new file mode 100644
index 0000000..0568efc
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopicContainer.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2011 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Topic Container</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getAllComments <em>All Comments</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getTopics <em>Topics</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getDirectTopics <em>Direct Topics</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface ITopicContainer extends IReviewComponent {
+ /**
+ * Returns the value of the '<em><b>All Comments</b></em>' reference list. The list contents are of type
+ * {@link org.eclipse.mylyn.reviews.core.model.IComment}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>All Comments</em>' reference list isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>All Comments</em>' reference list.
+ * @generated
+ */
+ List<IComment> getAllComments();
+
+ /**
+ * Returns the value of the '<em><b>Topics</b></em>' reference list. The list contents are of type
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopic}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Topics</em>' reference list isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Topics</em>' reference list.
+ * @generated
+ */
+ List<ITopic> getTopics();
+
+ /**
+ * Returns the value of the '<em><b>Direct Topics</b></em>' reference list. The list contents are of type
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopic}. It is bidirectional and its opposite is '
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopic#getItem <em>Item</em>}'. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Direct Topics</em>' reference list isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Direct Topics</em>' reference list.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopic#getItem
+ * @generated
+ */
+ List<ITopic> getDirectTopics();
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ ITopic createTopicComment(ILocation initalLocation, String commentText);
+
+} // ITopicContainer
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Comment.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Comment.java
index b227811..0db87dc 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Comment.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Comment.java
@@ -26,6 +26,9 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.mylyn.reviews.core.model.IComment;
import org.eclipse.mylyn.reviews.core.model.ICommentType;
+import org.eclipse.mylyn.reviews.core.model.IDated;
+import org.eclipse.mylyn.reviews.core.model.IIndexed;
+import org.eclipse.mylyn.reviews.core.model.ITopic;
import org.eclipse.mylyn.reviews.core.model.IUser;
/**
@@ -33,13 +36,16 @@ import org.eclipse.mylyn.reviews.core.model.IUser;
* <p>
* The following features are implemented:
* <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getIndex <em>Index</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getCreationDate <em>Creation Date</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getModificationDate <em>Modification Date</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getAuthor <em>Author</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getCreationDate <em>Creation Date</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getReplies <em>Replies</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#isDraft <em>Draft</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Comment#getParentTopic <em>Parent Topic</em>}</li>
* </ul>
* </p>
*
@@ -47,6 +53,56 @@ import org.eclipse.mylyn.reviews.core.model.IUser;
*/
public class Comment extends ReviewComponent implements IComment {
/**
+ * The default value of the '{@link #getIndex() <em>Index</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getIndex()
+ * @generated
+ * @ordered
+ */
+ protected static final long INDEX_EDEFAULT = 0L;
+
+ /**
+ * The default value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date CREATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date creationDate = CREATION_DATE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModificationDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date MODIFICATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModificationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date modificationDate = MODIFICATION_DATE_EDEFAULT;
+
+ /**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' reference. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -87,26 +143,6 @@ public class Comment extends ReviewComponent implements IComment {
protected String description = DESCRIPTION_EDEFAULT;
/**
- * The default value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getCreationDate()
- * @generated
- * @ordered
- */
- protected static final Date CREATION_DATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getCreationDate()
- * @generated
- * @ordered
- */
- protected Date creationDate = CREATION_DATE_EDEFAULT;
-
- /**
* The default value of the '{@link #getId() <em>Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getId()
@@ -155,6 +191,16 @@ public class Comment extends ReviewComponent implements IComment {
protected boolean draft = DRAFT_EDEFAULT;
/**
+ * The cached value of the '{@link #getParentTopic() <em>Parent Topic</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getParentTopic()
+ * @generated
+ * @ordered
+ */
+ protected ITopic parentTopic;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -176,6 +222,18 @@ public class Comment extends ReviewComponent implements IComment {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
+ * @generated NOT
+ */
+ public long getIndex() {
+ if (getParentTopic() != null) {
+ return getParentTopic().getIndex();
+ }
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public IUser getAuthor() {
@@ -318,6 +376,28 @@ public class Comment extends ReviewComponent implements IComment {
*
* @generated
*/
+ public Date getModificationDate() {
+ return modificationDate;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setModificationDate(Date newModificationDate) {
+ Date oldModificationDate = modificationDate;
+ modificationDate = newModificationDate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.COMMENT__MODIFICATION_DATE,
+ oldModificationDate, modificationDate));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public String getId() {
return id;
}
@@ -373,6 +453,91 @@ public class Comment extends ReviewComponent implements IComment {
*
* @generated
*/
+ public ITopic getParentTopic() {
+ if (parentTopic != null && parentTopic.eIsProxy()) {
+ InternalEObject oldParentTopic = (InternalEObject) parentTopic;
+ parentTopic = (ITopic) eResolveProxy(oldParentTopic);
+ if (parentTopic != oldParentTopic) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewsPackage.COMMENT__PARENT_TOPIC,
+ oldParentTopic, parentTopic));
+ }
+ }
+ return parentTopic;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ITopic basicGetParentTopic() {
+ return parentTopic;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetParentTopic(ITopic newParentTopic, NotificationChain msgs) {
+ ITopic oldParentTopic = parentTopic;
+ parentTopic = newParentTopic;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
+ ReviewsPackage.COMMENT__PARENT_TOPIC, oldParentTopic, newParentTopic);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setParentTopic(ITopic newParentTopic) {
+ if (newParentTopic != parentTopic) {
+ NotificationChain msgs = null;
+ if (parentTopic != null)
+ msgs = ((InternalEObject) parentTopic).eInverseRemove(this, ReviewsPackage.TOPIC__COMMENTS,
+ ITopic.class, msgs);
+ if (newParentTopic != null)
+ msgs = ((InternalEObject) newParentTopic).eInverseAdd(this, ReviewsPackage.TOPIC__COMMENTS,
+ ITopic.class, msgs);
+ msgs = basicSetParentTopic(newParentTopic, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.COMMENT__PARENT_TOPIC, newParentTopic,
+ newParentTopic));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ if (parentTopic != null)
+ msgs = ((InternalEObject) parentTopic).eInverseRemove(this, ReviewsPackage.TOPIC__COMMENTS,
+ ITopic.class, msgs);
+ return basicSetParentTopic((ITopic) otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -380,6 +545,8 @@ public class Comment extends ReviewComponent implements IComment {
return basicSetType(null, msgs);
case ReviewsPackage.COMMENT__REPLIES:
return ((InternalEList<?>) getReplies()).basicRemove(otherEnd, msgs);
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ return basicSetParentTopic(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -392,6 +559,12 @@ public class Comment extends ReviewComponent implements IComment {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
+ case ReviewsPackage.COMMENT__INDEX:
+ return getIndex();
+ case ReviewsPackage.COMMENT__CREATION_DATE:
+ return getCreationDate();
+ case ReviewsPackage.COMMENT__MODIFICATION_DATE:
+ return getModificationDate();
case ReviewsPackage.COMMENT__AUTHOR:
return getAuthor();
case ReviewsPackage.COMMENT__TYPE:
@@ -400,14 +573,16 @@ public class Comment extends ReviewComponent implements IComment {
return basicGetType();
case ReviewsPackage.COMMENT__DESCRIPTION:
return getDescription();
- case ReviewsPackage.COMMENT__CREATION_DATE:
- return getCreationDate();
case ReviewsPackage.COMMENT__ID:
return getId();
case ReviewsPackage.COMMENT__REPLIES:
return getReplies();
case ReviewsPackage.COMMENT__DRAFT:
return isDraft();
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ if (resolve)
+ return getParentTopic();
+ return basicGetParentTopic();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -421,6 +596,12 @@ public class Comment extends ReviewComponent implements IComment {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
+ case ReviewsPackage.COMMENT__CREATION_DATE:
+ setCreationDate((Date) newValue);
+ return;
+ case ReviewsPackage.COMMENT__MODIFICATION_DATE:
+ setModificationDate((Date) newValue);
+ return;
case ReviewsPackage.COMMENT__AUTHOR:
setAuthor((IUser) newValue);
return;
@@ -430,9 +611,6 @@ public class Comment extends ReviewComponent implements IComment {
case ReviewsPackage.COMMENT__DESCRIPTION:
setDescription((String) newValue);
return;
- case ReviewsPackage.COMMENT__CREATION_DATE:
- setCreationDate((Date) newValue);
- return;
case ReviewsPackage.COMMENT__ID:
setId((String) newValue);
return;
@@ -443,6 +621,9 @@ public class Comment extends ReviewComponent implements IComment {
case ReviewsPackage.COMMENT__DRAFT:
setDraft((Boolean) newValue);
return;
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ setParentTopic((ITopic) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -455,6 +636,12 @@ public class Comment extends ReviewComponent implements IComment {
@Override
public void eUnset(int featureID) {
switch (featureID) {
+ case ReviewsPackage.COMMENT__CREATION_DATE:
+ setCreationDate(CREATION_DATE_EDEFAULT);
+ return;
+ case ReviewsPackage.COMMENT__MODIFICATION_DATE:
+ setModificationDate(MODIFICATION_DATE_EDEFAULT);
+ return;
case ReviewsPackage.COMMENT__AUTHOR:
setAuthor((IUser) null);
return;
@@ -464,9 +651,6 @@ public class Comment extends ReviewComponent implements IComment {
case ReviewsPackage.COMMENT__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
- case ReviewsPackage.COMMENT__CREATION_DATE:
- setCreationDate(CREATION_DATE_EDEFAULT);
- return;
case ReviewsPackage.COMMENT__ID:
setId(ID_EDEFAULT);
return;
@@ -476,6 +660,9 @@ public class Comment extends ReviewComponent implements IComment {
case ReviewsPackage.COMMENT__DRAFT:
setDraft(DRAFT_EDEFAULT);
return;
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ setParentTopic((ITopic) null);
+ return;
}
super.eUnset(featureID);
}
@@ -488,20 +675,28 @@ public class Comment extends ReviewComponent implements IComment {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
+ case ReviewsPackage.COMMENT__INDEX:
+ return getIndex() != INDEX_EDEFAULT;
+ case ReviewsPackage.COMMENT__CREATION_DATE:
+ return CREATION_DATE_EDEFAULT == null ? creationDate != null : !CREATION_DATE_EDEFAULT.equals(creationDate);
+ case ReviewsPackage.COMMENT__MODIFICATION_DATE:
+ return MODIFICATION_DATE_EDEFAULT == null
+ ? modificationDate != null
+ : !MODIFICATION_DATE_EDEFAULT.equals(modificationDate);
case ReviewsPackage.COMMENT__AUTHOR:
return author != null;
case ReviewsPackage.COMMENT__TYPE:
return type != null;
case ReviewsPackage.COMMENT__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case ReviewsPackage.COMMENT__CREATION_DATE:
- return CREATION_DATE_EDEFAULT == null ? creationDate != null : !CREATION_DATE_EDEFAULT.equals(creationDate);
case ReviewsPackage.COMMENT__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case ReviewsPackage.COMMENT__REPLIES:
return replies != null && !replies.isEmpty();
case ReviewsPackage.COMMENT__DRAFT:
return draft != DRAFT_EDEFAULT;
+ case ReviewsPackage.COMMENT__PARENT_TOPIC:
+ return parentTopic != null;
}
return super.eIsSet(featureID);
}
@@ -512,15 +707,73 @@ public class Comment extends ReviewComponent implements IComment {
* @generated
*/
@Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == IIndexed.class) {
+ switch (derivedFeatureID) {
+ case ReviewsPackage.COMMENT__INDEX:
+ return ReviewsPackage.INDEXED__INDEX;
+ default:
+ return -1;
+ }
+ }
+ if (baseClass == IDated.class) {
+ switch (derivedFeatureID) {
+ case ReviewsPackage.COMMENT__CREATION_DATE:
+ return ReviewsPackage.DATED__CREATION_DATE;
+ case ReviewsPackage.COMMENT__MODIFICATION_DATE:
+ return ReviewsPackage.DATED__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+ if (baseClass == IIndexed.class) {
+ switch (baseFeatureID) {
+ case ReviewsPackage.INDEXED__INDEX:
+ return ReviewsPackage.COMMENT__INDEX;
+ default:
+ return -1;
+ }
+ }
+ if (baseClass == IDated.class) {
+ switch (baseFeatureID) {
+ case ReviewsPackage.DATED__CREATION_DATE:
+ return ReviewsPackage.COMMENT__CREATION_DATE;
+ case ReviewsPackage.DATED__MODIFICATION_DATE:
+ return ReviewsPackage.COMMENT__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (description: "); //$NON-NLS-1$
- result.append(description);
- result.append(", creationDate: "); //$NON-NLS-1$
+ result.append(" (creationDate: "); //$NON-NLS-1$
result.append(creationDate);
+ result.append(", modificationDate: "); //$NON-NLS-1$
+ result.append(modificationDate);
+ result.append(", description: "); //$NON-NLS-1$
+ result.append(description);
result.append(", id: "); //$NON-NLS-1$
result.append(id);
result.append(", draft: "); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileItem.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileItem.java
index c74774a..e40746d 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileItem.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileItem.java
@@ -10,15 +10,14 @@
*/
package org.eclipse.mylyn.reviews.internal.core.model;
-import org.eclipse.emf.common.notify.Notification;
+import java.util.List;
-import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
+import org.eclipse.mylyn.reviews.core.model.IComment;
import org.eclipse.mylyn.reviews.core.model.IFileItem;
import org.eclipse.mylyn.reviews.core.model.IFileRevision;
@@ -102,6 +101,23 @@ public class FileItem extends ReviewItem implements IFileItem {
}
/**
+ * <!-- begin-user-doc --> Unmodifiable and not updated. <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public List<IComment> getAllComments() {
+ BasicEList<IComment> all = new BasicEList<IComment>(getTopics());
+ if (getBase() != null) {
+ all.addAll(getBase().getTopics());
+ }
+ if (getTarget() != null) {
+ all.addAll(getTarget().getTopics());
+ }
+ return all;
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileRevision.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileRevision.java
index eaa3363..d0a5e31 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileRevision.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/FileRevision.java
@@ -17,7 +17,9 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.mylyn.reviews.core.model.IFileItem;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
@@ -32,6 +34,7 @@ import org.eclipse.mylyn.reviews.core.model.ITopic;
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.FileRevision#getPath <em>Path</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.FileRevision#getRevision <em>Revision</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.FileRevision#getContent <em>Content</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.FileRevision#getFile <em>File</em>}</li>
* </ul>
* </p>
*
@@ -99,6 +102,16 @@ public class FileRevision extends ReviewItem implements IFileRevision {
protected String content = CONTENT_EDEFAULT;
/**
+ * <<<<<<< Upstream, based on origin/master ======= The cached value of the '{@link #getFile() <em>File</em>}'
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFile()
+ * @generated
+ * @ordered
+ */
+ protected IFileItem file;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -187,6 +200,45 @@ public class FileRevision extends ReviewItem implements IFileRevision {
*
* @generated
*/
+ public IFileItem getFile() {
+ if (file != null && file.eIsProxy()) {
+ InternalEObject oldFile = (InternalEObject) file;
+ file = (IFileItem) eResolveProxy(oldFile);
+ if (file != oldFile) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewsPackage.FILE_REVISION__FILE,
+ oldFile, file));
+ }
+ }
+ return file;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IFileItem basicGetFile() {
+ return file;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFile(IFileItem newFile) {
+ IFileItem oldFile = file;
+ file = newFile;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.FILE_REVISION__FILE, oldFile, file));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
@@ -196,6 +248,10 @@ public class FileRevision extends ReviewItem implements IFileRevision {
return getRevision();
case ReviewsPackage.FILE_REVISION__CONTENT:
return getContent();
+ case ReviewsPackage.FILE_REVISION__FILE:
+ if (resolve)
+ return getFile();
+ return basicGetFile();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -218,6 +274,9 @@ public class FileRevision extends ReviewItem implements IFileRevision {
case ReviewsPackage.FILE_REVISION__CONTENT:
setContent((String) newValue);
return;
+ case ReviewsPackage.FILE_REVISION__FILE:
+ setFile((IFileItem) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -239,6 +298,9 @@ public class FileRevision extends ReviewItem implements IFileRevision {
case ReviewsPackage.FILE_REVISION__CONTENT:
setContent(CONTENT_EDEFAULT);
return;
+ case ReviewsPackage.FILE_REVISION__FILE:
+ setFile((IFileItem) null);
+ return;
}
super.eUnset(featureID);
}
@@ -257,6 +319,8 @@ public class FileRevision extends ReviewItem implements IFileRevision {
return REVISION_EDEFAULT == null ? revision != null : !REVISION_EDEFAULT.equals(revision);
case ReviewsPackage.FILE_REVISION__CONTENT:
return CONTENT_EDEFAULT == null ? content != null : !CONTENT_EDEFAULT.equals(content);
+ case ReviewsPackage.FILE_REVISION__FILE:
+ return file != null;
}
return super.eIsSet(featureID);
}
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/LineLocation.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/LineLocation.java
index d1bedd3..7594734 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/LineLocation.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/LineLocation.java
@@ -28,6 +28,8 @@ import org.eclipse.mylyn.reviews.core.model.ILineRange;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.LineLocation#getRanges <em>Ranges</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.LineLocation#getRangeMin <em>Range Min</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.LineLocation#getRangeMax <em>Range Max</em>}</li>
* </ul>
* </p>
*
@@ -45,6 +47,26 @@ public class LineLocation extends Location implements ILineLocation {
protected EList<ILineRange> ranges;
/**
+ * The default value of the '{@link #getRangeMin() <em>Range Min</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getRangeMin()
+ * @generated
+ * @ordered
+ */
+ protected static final int RANGE_MIN_EDEFAULT = 0;
+
+ /**
+ * The default value of the '{@link #getRangeMax() <em>Range Max</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getRangeMax()
+ * @generated
+ * @ordered
+ */
+ protected static final int RANGE_MAX_EDEFAULT = 0;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -79,6 +101,44 @@ public class LineLocation extends Location implements ILineLocation {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
+ * @generated NOT
+ */
+ public int getRangeMin() {
+ int min = -1;
+ for (ILineRange range : getRanges()) {
+ if (min == -1 || range.getStart() < min) {
+ min = range.getStart();
+ }
+ }
+ return (min == -1) ? 0 : min;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public int getRangeMax() {
+ int max = -1;
+ for (ILineRange range : getRanges()) {
+ if (max == -1 || range.getStart() > max) {
+ max = range.getStart();
+ }
+ }
+ return (max == -1) ? 0 : max;
+ }
+
+ /**
+ * @generated NOT
+ */
+ @Override
+ public long getIndex() {
+ return getRangeMin();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -100,6 +160,10 @@ public class LineLocation extends Location implements ILineLocation {
switch (featureID) {
case ReviewsPackage.LINE_LOCATION__RANGES:
return getRanges();
+ case ReviewsPackage.LINE_LOCATION__RANGE_MIN:
+ return getRangeMin();
+ case ReviewsPackage.LINE_LOCATION__RANGE_MAX:
+ return getRangeMax();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -146,28 +210,12 @@ public class LineLocation extends Location implements ILineLocation {
switch (featureID) {
case ReviewsPackage.LINE_LOCATION__RANGES:
return ranges != null && !ranges.isEmpty();
+ case ReviewsPackage.LINE_LOCATION__RANGE_MIN:
+ return getRangeMin() != RANGE_MIN_EDEFAULT;
+ case ReviewsPackage.LINE_LOCATION__RANGE_MAX:
+ return getRangeMax() != RANGE_MAX_EDEFAULT;
}
return super.eIsSet(featureID);
}
- public int getTotalMin() {
- int min = -1;
- for (ILineRange range : getRanges()) {
- if (min == -1 || range.getStart() < min) {
- min = range.getStart();
- }
- }
- return (min == -1) ? 0 : min;
- }
-
- public int getTotalMax() {
- int max = -1;
- for (ILineRange range : getRanges()) {
- if (max == -1 || range.getStart() > max) {
- max = range.getStart();
- }
- }
- return (max == -1) ? 0 : max;
- }
-
} //LineLocation
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Location.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Location.java
index 7db16dd..9c2f432 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Location.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Location.java
@@ -24,12 +24,26 @@ import org.eclipse.mylyn.reviews.core.model.IReviewItem;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Location</b></em>'. <!-- end-user-doc -->
* <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Location#getIndex <em>Index</em>}</li>
+ * </ul>
* </p>
*
* @generated
*/
public abstract class Location extends EObjectImpl implements ILocation {
/**
+ * The default value of the '{@link #getIndex() <em>Index</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getIndex()
+ * @generated
+ * @ordered
+ */
+ protected static final long INDEX_EDEFAULT = 0L;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -48,4 +62,41 @@ public abstract class Location extends EObjectImpl implements ILocation {
return ReviewsPackage.Literals.LOCATION;
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public long getIndex() {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ReviewsPackage.LOCATION__INDEX:
+ return getIndex();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ReviewsPackage.LOCATION__INDEX:
+ return getIndex() != INDEX_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
} //Location
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Review.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Review.java
index c0e47ca..47003ba 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Review.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Review.java
@@ -11,52 +11,83 @@
package org.eclipse.mylyn.reviews.internal.core.model;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-
-import org.eclipse.mylyn.reviews.core.model.IItem;
+import org.eclipse.mylyn.reviews.core.model.IComment;
+import org.eclipse.mylyn.reviews.core.model.IDated;
import org.eclipse.mylyn.reviews.core.model.IReview;
import org.eclipse.mylyn.reviews.core.model.IReviewItem;
import org.eclipse.mylyn.reviews.core.model.IReviewState;
import org.eclipse.mylyn.reviews.core.model.ITaskReference;
import org.eclipse.mylyn.reviews.core.model.ITopic;
+import org.eclipse.mylyn.reviews.core.model.IUser;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Review</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getTopics <em>Topics</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getCreationDate <em>Creation Date</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getModificationDate <em>Modification Date</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getItems <em>Items</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getReviewTask <em>Review Task</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getState <em>State</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Review#getOwner <em>Owner</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class Review extends ReviewComponent implements IReview {
+public class Review extends TopicContainer implements IReview {
/**
- * The cached value of the '{@link #getTopics() <em>Topics</em>}' reference list. <!-- begin-user-doc --> <!--
- * end-user-doc -->
+ * The default value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date CREATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date creationDate = CREATION_DATE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
*
- * @see #getTopics()
+ * @see #getModificationDate()
* @generated
* @ordered
*/
- protected EList<ITopic> topics;
+ protected static final Date MODIFICATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModificationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date modificationDate = MODIFICATION_DATE_EDEFAULT;
/**
* The cached value of the '{@link #getItems() <em>Items</em>}' reference list. <!-- begin-user-doc --> <!--
@@ -107,6 +138,16 @@ public class Review extends ReviewComponent implements IReview {
protected String id = ID_EDEFAULT;
/**
+ * The cached value of the '{@link #getOwner() <em>Owner</em>}' reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getOwner()
+ * @generated
+ * @ordered
+ */
+ protected IUser owner;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -130,11 +171,72 @@ public class Review extends ReviewComponent implements IReview {
*
* @generated
*/
- public List<ITopic> getTopics() {
- if (topics == null) {
- topics = new EObjectResolvingEList<ITopic>(ITopic.class, this, ReviewsPackage.REVIEW__TOPICS);
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCreationDate(Date newCreationDate) {
+ Date oldCreationDate = creationDate;
+ creationDate = newCreationDate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW__CREATION_DATE,
+ oldCreationDate, creationDate));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Date getModificationDate() {
+ return modificationDate;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setModificationDate(Date newModificationDate) {
+ Date oldModificationDate = modificationDate;
+ modificationDate = newModificationDate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW__MODIFICATION_DATE,
+ oldModificationDate, modificationDate));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public Date getLastChangeDate() {
+ if (getModificationDate() != null) {
+ return getModificationDate();
}
- return topics;
+ return getCreationDate();
+ }
+
+ /**
+ * <!-- begin-user-doc --> Unmodifiable and not updated. <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public List<IComment> getAllComments() {
+ BasicEList<IComment> all = new BasicEList<IComment>(getTopics());
+ for (ITopic topic : getTopics()) {
+ all.addAll(topic.getReplies());
+ }
+ for (IReviewItem item : getItems()) {
+ all.addAll(item.getAllComments());
+ }
+ return all;
}
/**
@@ -327,6 +429,45 @@ public class Review extends ReviewComponent implements IReview {
*
* @generated
*/
+ public IUser getOwner() {
+ if (owner != null && owner.eIsProxy()) {
+ InternalEObject oldOwner = (InternalEObject) owner;
+ owner = (IUser) eResolveProxy(oldOwner);
+ if (owner != oldOwner) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewsPackage.REVIEW__OWNER, oldOwner,
+ owner));
+ }
+ }
+ return owner;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IUser basicGetOwner() {
+ return owner;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOwner(IUser newOwner) {
+ IUser oldOwner = owner;
+ owner = newOwner;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW__OWNER, oldOwner, owner));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -346,8 +487,10 @@ public class Review extends ReviewComponent implements IReview {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case ReviewsPackage.REVIEW__TOPICS:
- return getTopics();
+ case ReviewsPackage.REVIEW__CREATION_DATE:
+ return getCreationDate();
+ case ReviewsPackage.REVIEW__MODIFICATION_DATE:
+ return getModificationDate();
case ReviewsPackage.REVIEW__ITEMS:
return getItems();
case ReviewsPackage.REVIEW__REVIEW_TASK:
@@ -360,6 +503,10 @@ public class Review extends ReviewComponent implements IReview {
return basicGetState();
case ReviewsPackage.REVIEW__ID:
return getId();
+ case ReviewsPackage.REVIEW__OWNER:
+ if (resolve)
+ return getOwner();
+ return basicGetOwner();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -373,9 +520,11 @@ public class Review extends ReviewComponent implements IReview {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case ReviewsPackage.REVIEW__TOPICS:
- getTopics().clear();
- getTopics().addAll((Collection<? extends ITopic>) newValue);
+ case ReviewsPackage.REVIEW__CREATION_DATE:
+ setCreationDate((Date) newValue);
+ return;
+ case ReviewsPackage.REVIEW__MODIFICATION_DATE:
+ setModificationDate((Date) newValue);
return;
case ReviewsPackage.REVIEW__ITEMS:
getItems().clear();
@@ -390,6 +539,9 @@ public class Review extends ReviewComponent implements IReview {
case ReviewsPackage.REVIEW__ID:
setId((String) newValue);
return;
+ case ReviewsPackage.REVIEW__OWNER:
+ setOwner((IUser) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -402,8 +554,11 @@ public class Review extends ReviewComponent implements IReview {
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case ReviewsPackage.REVIEW__TOPICS:
- getTopics().clear();
+ case ReviewsPackage.REVIEW__CREATION_DATE:
+ setCreationDate(CREATION_DATE_EDEFAULT);
+ return;
+ case ReviewsPackage.REVIEW__MODIFICATION_DATE:
+ setModificationDate(MODIFICATION_DATE_EDEFAULT);
return;
case ReviewsPackage.REVIEW__ITEMS:
getItems().clear();
@@ -417,6 +572,9 @@ public class Review extends ReviewComponent implements IReview {
case ReviewsPackage.REVIEW__ID:
setId(ID_EDEFAULT);
return;
+ case ReviewsPackage.REVIEW__OWNER:
+ setOwner((IUser) null);
+ return;
}
super.eUnset(featureID);
}
@@ -429,8 +587,12 @@ public class Review extends ReviewComponent implements IReview {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case ReviewsPackage.REVIEW__TOPICS:
- return topics != null && !topics.isEmpty();
+ case ReviewsPackage.REVIEW__CREATION_DATE:
+ return CREATION_DATE_EDEFAULT == null ? creationDate != null : !CREATION_DATE_EDEFAULT.equals(creationDate);
+ case ReviewsPackage.REVIEW__MODIFICATION_DATE:
+ return MODIFICATION_DATE_EDEFAULT == null
+ ? modificationDate != null
+ : !MODIFICATION_DATE_EDEFAULT.equals(modificationDate);
case ReviewsPackage.REVIEW__ITEMS:
return items != null && !items.isEmpty();
case ReviewsPackage.REVIEW__REVIEW_TASK:
@@ -439,6 +601,8 @@ public class Review extends ReviewComponent implements IReview {
return state != null;
case ReviewsPackage.REVIEW__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case ReviewsPackage.REVIEW__OWNER:
+ return owner != null;
}
return super.eIsSet(featureID);
}
@@ -449,12 +613,56 @@ public class Review extends ReviewComponent implements IReview {
* @generated
*/
@Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == IDated.class) {
+ switch (derivedFeatureID) {
+ case ReviewsPackage.REVIEW__CREATION_DATE:
+ return ReviewsPackage.DATED__CREATION_DATE;
+ case ReviewsPackage.REVIEW__MODIFICATION_DATE:
+ return ReviewsPackage.DATED__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+ if (baseClass == IDated.class) {
+ switch (baseFeatureID) {
+ case ReviewsPackage.DATED__CREATION_DATE:
+ return ReviewsPackage.REVIEW__CREATION_DATE;
+ case ReviewsPackage.DATED__MODIFICATION_DATE:
+ return ReviewsPackage.REVIEW__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: "); //$NON-NLS-1$
+ result.append(" (creationDate: "); //$NON-NLS-1$
+ result.append(creationDate);
+ result.append(", modificationDate: "); //$NON-NLS-1$
+ result.append(modificationDate);
+ result.append(", id: "); //$NON-NLS-1$
result.append(id);
result.append(')');
return result.toString();
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItem.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItem.java
index df69351..426cf90 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItem.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItem.java
@@ -10,18 +10,13 @@
*/
package org.eclipse.mylyn.reviews.internal.core.model;
-import java.util.Collection;
-import java.util.Date;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.mylyn.reviews.core.model.IComment;
import org.eclipse.mylyn.reviews.core.model.ILocation;
import org.eclipse.mylyn.reviews.core.model.IReview;
@@ -37,14 +32,13 @@ import org.eclipse.mylyn.reviews.core.model.IUser;
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem#getAddedBy <em>Added By</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem#getReview <em>Review</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem#getTopics <em>Topics</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class ReviewItem extends ReviewComponent implements IReviewItem {
+public class ReviewItem extends TopicContainer implements IReviewItem {
/**
* The cached value of the '{@link #getAddedBy() <em>Added By</em>}' reference. <!-- begin-user-doc --> <!--
* end-user-doc -->
@@ -86,16 +80,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
protected String name = NAME_EDEFAULT;
/**
- * The cached value of the '{@link #getTopics() <em>Topics</em>}' reference list. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @see #getTopics()
- * @generated
- * @ordered
- */
- protected EList<ITopic> topics;
-
- /**
* The default value of the '{@link #getId() <em>Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getId()
@@ -133,6 +117,16 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
}
/**
+ * <!-- begin-user-doc --> Unmodifiable and not updated. <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public List<IComment> getAllComments() {
+ return new BasicEList<IComment>(getTopics());
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -237,19 +231,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
*
* @generated
*/
- public List<ITopic> getTopics() {
- if (topics == null) {
- topics = new EObjectWithInverseResolvingEList<ITopic>(ITopic.class, this,
- ReviewsPackage.REVIEW_ITEM__TOPICS, ReviewsPackage.TOPIC__ITEM);
- }
- return topics;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
public String getId() {
return id;
}
@@ -271,56 +252,19 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
*
* @generated NOT
*/
+ @Override
public ITopic createTopicComment(ILocation initalLocation, String commentText) {
- ITopic topic = ReviewsFactory.eINSTANCE.createTopic();
- topic.setDraft(true);
+ ITopic topic = super.createTopicComment(initalLocation, commentText);
IUser user = getAddedBy();
if (user == null) {
user = ReviewsFactory.eINSTANCE.createUser();
user.setDisplayName("<Undefined>"); //$NON-NLS-1$
}
topic.setAuthor(user);
- topic.setDescription(commentText);
- topic.getLocations().add(initalLocation);
-
- IComment comment = ReviewsFactory.eINSTANCE.createComment();
- comment.setDescription(topic.getDescription());
- comment.setAuthor(topic.getAuthor());
- Date created = new Date();
- comment.setCreationDate(created);
- topic.setCreationDate(created);
- topic.getComments().add(comment);
- getTopics().add(topic);
- return topic;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- return ((InternalEList<InternalEObject>) (InternalEList<?>) getTopics()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- return ((InternalEList<?>) getTopics()).basicRemove(otherEnd, msgs);
+ for (IComment comment : topic.getComments()) {
+ comment.setAuthor(topic.getAuthor());
}
- return super.eInverseRemove(otherEnd, featureID, msgs);
+ return topic;
}
/**
@@ -341,8 +285,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
return basicGetReview();
case ReviewsPackage.REVIEW_ITEM__NAME:
return getName();
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- return getTopics();
case ReviewsPackage.REVIEW_ITEM__ID:
return getId();
}
@@ -367,10 +309,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
case ReviewsPackage.REVIEW_ITEM__NAME:
setName((String) newValue);
return;
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- getTopics().clear();
- getTopics().addAll((Collection<? extends ITopic>) newValue);
- return;
case ReviewsPackage.REVIEW_ITEM__ID:
setId((String) newValue);
return;
@@ -395,9 +333,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
case ReviewsPackage.REVIEW_ITEM__NAME:
setName(NAME_EDEFAULT);
return;
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- getTopics().clear();
- return;
case ReviewsPackage.REVIEW_ITEM__ID:
setId(ID_EDEFAULT);
return;
@@ -419,8 +354,6 @@ public class ReviewItem extends ReviewComponent implements IReviewItem {
return review != null;
case ReviewsPackage.REVIEW_ITEM__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case ReviewsPackage.REVIEW_ITEM__TOPICS:
- return topics != null && !topics.isEmpty();
case ReviewsPackage.REVIEW_ITEM__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
}
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItemSet.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItemSet.java
index 78b2eac..b04a80a 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItemSet.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewItemSet.java
@@ -11,19 +11,17 @@
package org.eclipse.mylyn.reviews.internal.core.model;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.mylyn.reviews.core.model.IComment;
+import org.eclipse.mylyn.reviews.core.model.IDated;
import org.eclipse.mylyn.reviews.core.model.IReviewItem;
import org.eclipse.mylyn.reviews.core.model.IReviewItemSet;
@@ -33,6 +31,9 @@ import org.eclipse.mylyn.reviews.core.model.IReviewItemSet;
* <p>
* The following features are implemented:
* <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItemSet#getCreationDate <em>Creation Date</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItemSet#getModificationDate <em>Modification Date
+ * </em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItemSet#getItems <em>Items</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItemSet#getRevision <em>Revision</em>}</li>
* </ul>
@@ -42,6 +43,46 @@ import org.eclipse.mylyn.reviews.core.model.IReviewItemSet;
*/
public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
/**
+ * The default value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date CREATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCreationDate() <em>Creation Date</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCreationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date creationDate = CREATION_DATE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModificationDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date MODIFICATION_DATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getModificationDate() <em>Modification Date</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModificationDate()
+ * @generated
+ * @ordered
+ */
+ protected Date modificationDate = MODIFICATION_DATE_EDEFAULT;
+
+ /**
* The cached value of the '{@link #getItems() <em>Items</em>}' reference list. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -95,6 +136,64 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
*
* @generated
*/
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCreationDate(Date newCreationDate) {
+ Date oldCreationDate = creationDate;
+ creationDate = newCreationDate;
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE,
+ oldCreationDate, creationDate));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Date getModificationDate() {
+ return modificationDate;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setModificationDate(Date newModificationDate) {
+ Date oldModificationDate = modificationDate;
+ modificationDate = newModificationDate;
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE,
+ oldModificationDate, modificationDate));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public Date getLastChangeDate() {
+ if (getModificationDate() != null) {
+ return getModificationDate();
+ }
+ return getCreationDate();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public List<IReviewItem> getItems() {
if (items == null) {
items = new EObjectResolvingEList<IReviewItem>(IReviewItem.class, this,
@@ -104,6 +203,20 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
}
/**
+ * <!-- begin-user-doc --> Unmodifiable and not updated. <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public List<IComment> getAllComments() {
+ BasicEList<IComment> all = new BasicEList<IComment>(getTopics());
+ for (IReviewItem item : getItems()) {
+ all.addAll(item.getAllComments());
+ }
+ return all;
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -120,9 +233,10 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
public void setRevision(String newRevision) {
String oldRevision = revision;
revision = newRevision;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.REVIEW_ITEM_SET__REVISION,
oldRevision, revision));
+ }
}
/**
@@ -133,6 +247,10 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
+ case ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE:
+ return getCreationDate();
+ case ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE:
+ return getModificationDate();
case ReviewsPackage.REVIEW_ITEM_SET__ITEMS:
return getItems();
case ReviewsPackage.REVIEW_ITEM_SET__REVISION:
@@ -150,6 +268,12 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
+ case ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE:
+ setCreationDate((Date) newValue);
+ return;
+ case ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE:
+ setModificationDate((Date) newValue);
+ return;
case ReviewsPackage.REVIEW_ITEM_SET__ITEMS:
getItems().clear();
getItems().addAll((Collection<? extends IReviewItem>) newValue);
@@ -169,6 +293,12 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
@Override
public void eUnset(int featureID) {
switch (featureID) {
+ case ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE:
+ setCreationDate(CREATION_DATE_EDEFAULT);
+ return;
+ case ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE:
+ setModificationDate(MODIFICATION_DATE_EDEFAULT);
+ return;
case ReviewsPackage.REVIEW_ITEM_SET__ITEMS:
getItems().clear();
return;
@@ -187,6 +317,12 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
+ case ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE:
+ return CREATION_DATE_EDEFAULT == null ? creationDate != null : !CREATION_DATE_EDEFAULT.equals(creationDate);
+ case ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE:
+ return MODIFICATION_DATE_EDEFAULT == null
+ ? modificationDate != null
+ : !MODIFICATION_DATE_EDEFAULT.equals(modificationDate);
case ReviewsPackage.REVIEW_ITEM_SET__ITEMS:
return items != null && !items.isEmpty();
case ReviewsPackage.REVIEW_ITEM_SET__REVISION:
@@ -201,12 +337,57 @@ public class ReviewItemSet extends ReviewItem implements IReviewItemSet {
* @generated
*/
@Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == IDated.class) {
+ switch (derivedFeatureID) {
+ case ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE:
+ return ReviewsPackage.DATED__CREATION_DATE;
+ case ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE:
+ return ReviewsPackage.DATED__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+ if (baseClass == IDated.class) {
+ switch (baseFeatureID) {
+ case ReviewsPackage.DATED__CREATION_DATE:
+ return ReviewsPackage.REVIEW_ITEM_SET__CREATION_DATE;
+ case ReviewsPackage.DATED__MODIFICATION_DATE:
+ return ReviewsPackage.REVIEW_ITEM_SET__MODIFICATION_DATE;
+ default:
+ return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public String toString() {
- if (eIsProxy())
+ if (eIsProxy()) {
return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (revision: "); //$NON-NLS-1$
+ result.append(" (creationDate: "); //$NON-NLS-1$
+ result.append(creationDate);
+ result.append(", modificationDate: "); //$NON-NLS-1$
+ result.append(modificationDate);
+ result.append(", revision: "); //$NON-NLS-1$
result.append(revision);
result.append(')');
return result.toString();
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
index 8d08b8b..4056a8d 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
@@ -71,6 +71,11 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
*/
protected ReviewsSwitch<Adapter> modelSwitch = new ReviewsSwitch<Adapter>() {
@Override
+ public Adapter caseTopicContainer(ITopicContainer object) {
+ return createTopicContainerAdapter();
+ }
+
+ @Override
public Adapter caseReview(IReview object) {
return createReviewAdapter();
}
@@ -156,6 +161,16 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
}
@Override
+ public Adapter caseIndexed(IIndexed object) {
+ return createIndexedAdapter();
+ }
+
+ @Override
+ public Adapter caseDated(IDated object) {
+ return createDatedAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -175,6 +190,20 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.mylyn.reviews.core.model.ITopicContainer
+ * <em>Topic Container</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can
+ * easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!--
+ * end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer
+ * @generated
+ */
+ public Adapter createTopicContainerAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.mylyn.reviews.core.model.IReview
* <em>Review</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore
* cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
@@ -409,6 +438,32 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.mylyn.reviews.core.model.IIndexed
+ * <em>Indexed</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore
+ * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.mylyn.reviews.core.model.IIndexed
+ * @generated
+ */
+ public Adapter createIndexedAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.mylyn.reviews.core.model.IDated <em>Dated</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.mylyn.reviews.core.model.IDated
+ * @generated
+ */
+ public Adapter createDatedAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null.
* <!-- end-user-doc -->
*
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
index c3113a2..3ba8f65 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
@@ -21,11 +21,12 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.mylyn.reviews.core.model.IComment;
import org.eclipse.mylyn.reviews.core.model.ICommentType;
+import org.eclipse.mylyn.reviews.core.model.IDated;
import org.eclipse.mylyn.reviews.core.model.IFileItem;
import org.eclipse.mylyn.reviews.core.model.IFileRevision;
+import org.eclipse.mylyn.reviews.core.model.IIndexed;
import org.eclipse.mylyn.reviews.core.model.ILineLocation;
import org.eclipse.mylyn.reviews.core.model.ILineRange;
-import org.eclipse.mylyn.reviews.core.model.IItem;
import org.eclipse.mylyn.reviews.core.model.ILocation;
import org.eclipse.mylyn.reviews.core.model.IModelVersioning;
import org.eclipse.mylyn.reviews.core.model.IReview;
@@ -37,6 +38,7 @@ import org.eclipse.mylyn.reviews.core.model.IReviewState;
import org.eclipse.mylyn.reviews.core.model.IReviewsFactory;
import org.eclipse.mylyn.reviews.core.model.ITaskReference;
import org.eclipse.mylyn.reviews.core.model.ITopic;
+import org.eclipse.mylyn.reviews.core.model.ITopicContainer;
import org.eclipse.mylyn.reviews.core.model.IUser;
/**
@@ -89,7 +91,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReviewComponent()
* @generated
*/
- public static final int REVIEW_COMPONENT = 10;
+ public static final int REVIEW_COMPONENT = 11;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -109,6 +111,59 @@ public class ReviewsPackage extends EPackageImpl {
public static final int REVIEW_COMPONENT_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.TopicContainer
+ * <em>Topic Container</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.internal.core.model.TopicContainer
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getTopicContainer()
+ * @generated
+ */
+ public static final int TOPIC_CONTAINER = 0;
+
+ /**
+ * The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC_CONTAINER__ENABLED = REVIEW_COMPONENT__ENABLED;
+
+ /**
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC_CONTAINER__ALL_COMMENTS = REVIEW_COMPONENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC_CONTAINER__TOPICS = REVIEW_COMPONENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC_CONTAINER__DIRECT_TOPICS = REVIEW_COMPONENT_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Topic Container</em>' class. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC_CONTAINER_FEATURE_COUNT = REVIEW_COMPONENT_FEATURE_COUNT + 3;
+
+ /**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Review <em>Review</em>}' class.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -116,7 +171,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReview()
* @generated
*/
- public static final int REVIEW = 0;
+ public static final int REVIEW = 1;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -124,7 +179,16 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__ENABLED = REVIEW_COMPONENT__ENABLED;
+ public static final int REVIEW__ENABLED = TOPIC_CONTAINER__ENABLED;
+
+ /**
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW__ALL_COMMENTS = TOPIC_CONTAINER__ALL_COMMENTS;
/**
* The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -132,7 +196,33 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__TOPICS = REVIEW_COMPONENT_FEATURE_COUNT + 0;
+ public static final int REVIEW__TOPICS = TOPIC_CONTAINER__TOPICS;
+
+ /**
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW__DIRECT_TOPICS = TOPIC_CONTAINER__DIRECT_TOPICS;
+
+ /**
+ * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW__CREATION_DATE = TOPIC_CONTAINER_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW__MODIFICATION_DATE = TOPIC_CONTAINER_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Items</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -140,7 +230,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__ITEMS = REVIEW_COMPONENT_FEATURE_COUNT + 1;
+ public static final int REVIEW__ITEMS = TOPIC_CONTAINER_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Review Task</b></em>' containment reference. <!-- begin-user-doc --> <!--
@@ -149,7 +239,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__REVIEW_TASK = REVIEW_COMPONENT_FEATURE_COUNT + 2;
+ public static final int REVIEW__REVIEW_TASK = TOPIC_CONTAINER_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>State</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
@@ -158,7 +248,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__STATE = REVIEW_COMPONENT_FEATURE_COUNT + 3;
+ public static final int REVIEW__STATE = TOPIC_CONTAINER_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -166,7 +256,15 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW__ID = REVIEW_COMPONENT_FEATURE_COUNT + 4;
+ public static final int REVIEW__ID = TOPIC_CONTAINER_FEATURE_COUNT + 5;
+
+ /**
+ * The feature id for the '<em><b>Owner</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW__OWNER = TOPIC_CONTAINER_FEATURE_COUNT + 6;
/**
* The number of structural features of the '<em>Review</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -174,7 +272,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_FEATURE_COUNT = REVIEW_COMPONENT_FEATURE_COUNT + 5;
+ public static final int REVIEW_FEATURE_COUNT = TOPIC_CONTAINER_FEATURE_COUNT + 7;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Comment <em>Comment</em>}'
@@ -184,7 +282,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getComment()
* @generated
*/
- public static final int COMMENT = 1;
+ public static final int COMMENT = 2;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -195,37 +293,54 @@ public class ReviewsPackage extends EPackageImpl {
public static final int COMMENT__ENABLED = REVIEW_COMPONENT__ENABLED;
/**
- * The feature id for the '<em><b>Author</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int COMMENT__AUTHOR = REVIEW_COMPONENT_FEATURE_COUNT + 0;
+ public static final int COMMENT__INDEX = REVIEW_COMPONENT_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Type</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int COMMENT__CREATION_DATE = REVIEW_COMPONENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
- public static final int COMMENT__TYPE = REVIEW_COMPONENT_FEATURE_COUNT + 1;
+ public static final int COMMENT__MODIFICATION_DATE = REVIEW_COMPONENT_FEATURE_COUNT + 2;
/**
- * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Author</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int COMMENT__DESCRIPTION = REVIEW_COMPONENT_FEATURE_COUNT + 2;
+ public static final int COMMENT__AUTHOR = REVIEW_COMPONENT_FEATURE_COUNT + 3;
/**
- * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Type</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int COMMENT__TYPE = REVIEW_COMPONENT_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int COMMENT__CREATION_DATE = REVIEW_COMPONENT_FEATURE_COUNT + 3;
+ public static final int COMMENT__DESCRIPTION = REVIEW_COMPONENT_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -233,7 +348,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int COMMENT__ID = REVIEW_COMPONENT_FEATURE_COUNT + 4;
+ public static final int COMMENT__ID = REVIEW_COMPONENT_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>Replies</b></em>' containment reference list. <!-- begin-user-doc --> <!--
@@ -242,7 +357,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int COMMENT__REPLIES = REVIEW_COMPONENT_FEATURE_COUNT + 5;
+ public static final int COMMENT__REPLIES = REVIEW_COMPONENT_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>Draft</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -250,7 +365,15 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int COMMENT__DRAFT = REVIEW_COMPONENT_FEATURE_COUNT + 6;
+ public static final int COMMENT__DRAFT = REVIEW_COMPONENT_FEATURE_COUNT + 8;
+
+ /**
+ * The feature id for the '<em><b>Parent Topic</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int COMMENT__PARENT_TOPIC = REVIEW_COMPONENT_FEATURE_COUNT + 9;
/**
* The number of structural features of the '<em>Comment</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -258,7 +381,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int COMMENT_FEATURE_COUNT = REVIEW_COMPONENT_FEATURE_COUNT + 7;
+ public static final int COMMENT_FEATURE_COUNT = REVIEW_COMPONENT_FEATURE_COUNT + 10;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem <em>Review Item</em>}
@@ -268,7 +391,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReviewItem()
* @generated
*/
- public static final int REVIEW_ITEM = 2;
+ public static final int REVIEW_ITEM = 3;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -276,39 +399,57 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__ENABLED = REVIEW_COMPONENT__ENABLED;
+ public static final int REVIEW_ITEM__ENABLED = TOPIC_CONTAINER__ENABLED;
/**
- * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__ADDED_BY = REVIEW_COMPONENT_FEATURE_COUNT + 0;
+ public static final int REVIEW_ITEM__ALL_COMMENTS = TOPIC_CONTAINER__ALL_COMMENTS;
/**
- * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__REVIEW = REVIEW_COMPONENT_FEATURE_COUNT + 1;
+ public static final int REVIEW_ITEM__TOPICS = TOPIC_CONTAINER__TOPICS;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__NAME = REVIEW_COMPONENT_FEATURE_COUNT + 2;
+ public static final int REVIEW_ITEM__DIRECT_TOPICS = TOPIC_CONTAINER__DIRECT_TOPICS;
/**
- * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM__ADDED_BY = TOPIC_CONTAINER_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM__REVIEW = TOPIC_CONTAINER_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__TOPICS = REVIEW_COMPONENT_FEATURE_COUNT + 3;
+ public static final int REVIEW_ITEM__NAME = TOPIC_CONTAINER_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -316,7 +457,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM__ID = REVIEW_COMPONENT_FEATURE_COUNT + 4;
+ public static final int REVIEW_ITEM__ID = TOPIC_CONTAINER_FEATURE_COUNT + 3;
/**
* The number of structural features of the '<em>Review Item</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
@@ -325,7 +466,33 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_FEATURE_COUNT = REVIEW_COMPONENT_FEATURE_COUNT + 5;
+ public static final int REVIEW_ITEM_FEATURE_COUNT = TOPIC_CONTAINER_FEATURE_COUNT + 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.mylyn.reviews.core.model.IIndexed <em>Indexed</em>}' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.core.model.IIndexed
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getIndexed()
+ * @generated
+ */
+ public static final int INDEXED = 18;
+
+ /**
+ * The feature id for the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int INDEXED__INDEX = 0;
+
+ /**
+ * The number of structural features of the '<em>Indexed</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int INDEXED_FEATURE_COUNT = 1;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Location <em>Location</em>}'
@@ -335,7 +502,15 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getLocation()
* @generated
*/
- public static final int LOCATION = 3;
+ public static final int LOCATION = 4;
+
+ /**
+ * The feature id for the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int LOCATION__INDEX = INDEXED__INDEX;
/**
* The number of structural features of the '<em>Location</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -343,7 +518,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int LOCATION_FEATURE_COUNT = 0;
+ public static final int LOCATION_FEATURE_COUNT = INDEXED_FEATURE_COUNT + 0;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.User <em>User</em>}' class. <!--
@@ -353,7 +528,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getUser()
* @generated
*/
- public static final int USER = 4;
+ public static final int USER = 5;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -395,7 +570,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getTaskReference()
* @generated
*/
- public static final int TASK_REFERENCE = 5;
+ public static final int TASK_REFERENCE = 6;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -438,7 +613,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReviewState()
* @generated
*/
- public static final int REVIEW_STATE = 6;
+ public static final int REVIEW_STATE = 7;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -465,7 +640,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReviewGroup()
* @generated
*/
- public static final int REVIEW_GROUP = 7;
+ public static final int REVIEW_GROUP = 8;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -518,7 +693,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getCommentType()
* @generated
*/
- public static final int COMMENT_TYPE = 8;
+ public static final int COMMENT_TYPE = 9;
/**
* The number of structural features of the '<em>Comment Type</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
@@ -537,7 +712,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getTopic()
* @generated
*/
- public static final int TOPIC = 9;
+ public static final int TOPIC = 10;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -548,37 +723,54 @@ public class ReviewsPackage extends EPackageImpl {
public static final int TOPIC__ENABLED = COMMENT__ENABLED;
/**
- * The feature id for the '<em><b>Author</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int TOPIC__AUTHOR = COMMENT__AUTHOR;
+ public static final int TOPIC__INDEX = COMMENT__INDEX;
/**
- * The feature id for the '<em><b>Type</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC__CREATION_DATE = COMMENT__CREATION_DATE;
+
+ /**
+ * The feature id for the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
- public static final int TOPIC__TYPE = COMMENT__TYPE;
+ public static final int TOPIC__MODIFICATION_DATE = COMMENT__MODIFICATION_DATE;
/**
- * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Author</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int TOPIC__DESCRIPTION = COMMENT__DESCRIPTION;
+ public static final int TOPIC__AUTHOR = COMMENT__AUTHOR;
/**
- * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Type</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int TOPIC__CREATION_DATE = COMMENT__CREATION_DATE;
+ public static final int TOPIC__TYPE = COMMENT__TYPE;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC__DESCRIPTION = COMMENT__DESCRIPTION;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -606,6 +798,14 @@ public class ReviewsPackage extends EPackageImpl {
public static final int TOPIC__DRAFT = COMMENT__DRAFT;
/**
+ * The feature id for the '<em><b>Parent Topic</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int TOPIC__PARENT_TOPIC = COMMENT__PARENT_TOPIC;
+
+ /**
* The feature id for the '<em><b>Task</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -671,7 +871,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getFileItem()
* @generated
*/
- public static final int FILE_ITEM = 11;
+ public static final int FILE_ITEM = 12;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -682,36 +882,54 @@ public class ReviewsPackage extends EPackageImpl {
public static final int FILE_ITEM__ENABLED = REVIEW_ITEM__ENABLED;
/**
- * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int FILE_ITEM__ADDED_BY = REVIEW_ITEM__ADDED_BY;
+ public static final int FILE_ITEM__ALL_COMMENTS = REVIEW_ITEM__ALL_COMMENTS;
/**
- * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int FILE_ITEM__REVIEW = REVIEW_ITEM__REVIEW;
+ public static final int FILE_ITEM__TOPICS = REVIEW_ITEM__TOPICS;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int FILE_ITEM__NAME = REVIEW_ITEM__NAME;
+ public static final int FILE_ITEM__DIRECT_TOPICS = REVIEW_ITEM__DIRECT_TOPICS;
/**
- * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int FILE_ITEM__TOPICS = REVIEW_ITEM__TOPICS;
+ public static final int FILE_ITEM__ADDED_BY = REVIEW_ITEM__ADDED_BY;
+
+ /**
+ * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int FILE_ITEM__REVIEW = REVIEW_ITEM__REVIEW;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int FILE_ITEM__NAME = REVIEW_ITEM__NAME;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -754,7 +972,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReviewItemSet()
* @generated
*/
- public static final int REVIEW_ITEM_SET = 12;
+ public static final int REVIEW_ITEM_SET = 13;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -765,6 +983,32 @@ public class ReviewsPackage extends EPackageImpl {
public static final int REVIEW_ITEM_SET__ENABLED = REVIEW_ITEM__ENABLED;
/**
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM_SET__ALL_COMMENTS = REVIEW_ITEM__ALL_COMMENTS;
+
+ /**
+ * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM_SET__TOPICS = REVIEW_ITEM__TOPICS;
+
+ /**
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM_SET__DIRECT_TOPICS = REVIEW_ITEM__DIRECT_TOPICS;
+
+ /**
* The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -789,20 +1033,29 @@ public class ReviewsPackage extends EPackageImpl {
public static final int REVIEW_ITEM_SET__NAME = REVIEW_ITEM__NAME;
/**
- * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_SET__TOPICS = REVIEW_ITEM__TOPICS;
+ public static final int REVIEW_ITEM_SET__ID = REVIEW_ITEM__ID;
/**
- * The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_SET__ID = REVIEW_ITEM__ID;
+ public static final int REVIEW_ITEM_SET__CREATION_DATE = REVIEW_ITEM_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int REVIEW_ITEM_SET__MODIFICATION_DATE = REVIEW_ITEM_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Items</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -810,7 +1063,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_SET__ITEMS = REVIEW_ITEM_FEATURE_COUNT + 0;
+ public static final int REVIEW_ITEM_SET__ITEMS = REVIEW_ITEM_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Revision</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -818,7 +1071,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_SET__REVISION = REVIEW_ITEM_FEATURE_COUNT + 1;
+ public static final int REVIEW_ITEM_SET__REVISION = REVIEW_ITEM_FEATURE_COUNT + 3;
/**
* The number of structural features of the '<em>Review Item Set</em>' class. <!-- begin-user-doc --> <!--
@@ -827,7 +1080,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int REVIEW_ITEM_SET_FEATURE_COUNT = REVIEW_ITEM_FEATURE_COUNT + 2;
+ public static final int REVIEW_ITEM_SET_FEATURE_COUNT = REVIEW_ITEM_FEATURE_COUNT + 4;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.LineLocation
@@ -837,7 +1090,15 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getLineLocation()
* @generated
*/
- public static final int LINE_LOCATION = 13;
+ public static final int LINE_LOCATION = 14;
+
+ /**
+ * The feature id for the '<em><b>Index</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int LINE_LOCATION__INDEX = LOCATION__INDEX;
/**
* The feature id for the '<em><b>Ranges</b></em>' containment reference list. <!-- begin-user-doc --> <!--
@@ -849,13 +1110,29 @@ public class ReviewsPackage extends EPackageImpl {
public static final int LINE_LOCATION__RANGES = LOCATION_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Range Min</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int LINE_LOCATION__RANGE_MIN = LOCATION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Range Max</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int LINE_LOCATION__RANGE_MAX = LOCATION_FEATURE_COUNT + 2;
+
+ /**
* The number of structural features of the '<em>Line Location</em>' class. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int LINE_LOCATION_FEATURE_COUNT = LOCATION_FEATURE_COUNT + 1;
+ public static final int LINE_LOCATION_FEATURE_COUNT = LOCATION_FEATURE_COUNT + 3;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.LineRange <em>Line Range</em>}'
@@ -865,7 +1142,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getLineRange()
* @generated
*/
- public static final int LINE_RANGE = 14;
+ public static final int LINE_RANGE = 15;
/**
* The feature id for the '<em><b>Start</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -900,7 +1177,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getFileRevision()
* @generated
*/
- public static final int FILE_REVISION = 15;
+ public static final int FILE_REVISION = 16;
/**
* The feature id for the '<em><b>Enabled</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -911,36 +1188,54 @@ public class ReviewsPackage extends EPackageImpl {
public static final int FILE_REVISION__ENABLED = REVIEW_ITEM__ENABLED;
/**
- * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>All Comments</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int FILE_REVISION__ADDED_BY = REVIEW_ITEM__ADDED_BY;
+ public static final int FILE_REVISION__ALL_COMMENTS = REVIEW_ITEM__ALL_COMMENTS;
/**
- * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int FILE_REVISION__REVIEW = REVIEW_ITEM__REVIEW;
+ public static final int FILE_REVISION__TOPICS = REVIEW_ITEM__TOPICS;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Direct Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
* @generated
* @ordered
*/
- public static final int FILE_REVISION__NAME = REVIEW_ITEM__NAME;
+ public static final int FILE_REVISION__DIRECT_TOPICS = REVIEW_ITEM__DIRECT_TOPICS;
/**
- * The feature id for the '<em><b>Topics</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The feature id for the '<em><b>Added By</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int FILE_REVISION__TOPICS = REVIEW_ITEM__TOPICS;
+ public static final int FILE_REVISION__ADDED_BY = REVIEW_ITEM__ADDED_BY;
+
+ /**
+ * The feature id for the '<em><b>Review</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int FILE_REVISION__REVIEW = REVIEW_ITEM__REVIEW;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int FILE_REVISION__NAME = REVIEW_ITEM__NAME;
/**
* The feature id for the '<em><b>Id</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -975,13 +1270,21 @@ public class ReviewsPackage extends EPackageImpl {
public static final int FILE_REVISION__CONTENT = REVIEW_ITEM_FEATURE_COUNT + 2;
/**
+ * The feature id for the '<em><b>File</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int FILE_REVISION__FILE = REVIEW_ITEM_FEATURE_COUNT + 3;
+
+ /**
* The number of structural features of the '<em>File Revision</em>' class. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
- public static final int FILE_REVISION_FEATURE_COUNT = REVIEW_ITEM_FEATURE_COUNT + 3;
+ public static final int FILE_REVISION_FEATURE_COUNT = REVIEW_ITEM_FEATURE_COUNT + 4;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning
@@ -991,7 +1294,7 @@ public class ReviewsPackage extends EPackageImpl {
* @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getModelVersioning()
* @generated
*/
- public static final int MODEL_VERSIONING = 16;
+ public static final int MODEL_VERSIONING = 17;
/**
* The feature id for the '<em><b>Fragment Version</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
@@ -1012,6 +1315,48 @@ public class ReviewsPackage extends EPackageImpl {
public static final int MODEL_VERSIONING_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.mylyn.reviews.core.model.IDated <em>Dated</em>}' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.core.model.IDated
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getDated()
+ * @generated
+ */
+ public static final int DATED = 19;
+
+ /**
+ * The feature id for the '<em><b>Creation Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int DATED__CREATION_DATE = 0;
+
+ /**
+ * The feature id for the '<em><b>Modification Date</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int DATED__MODIFICATION_DATE = 1;
+
+ /**
+ * The number of structural features of the '<em>Dated</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ public static final int DATED_FEATURE_COUNT = 2;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass topicContainerEClass = null;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -1131,6 +1476,20 @@ public class ReviewsPackage extends EPackageImpl {
private EClass modelVersioningEClass = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass indexedEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass datedEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
* EPackage.Registry} by the package package URI value.
* <p>
@@ -1192,28 +1551,69 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
- * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IReview <em>Review</em>}'. <!--
+ * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.ITopicContainer
+ * <em>Topic Container</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Topic Container</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer
+ * @generated
+ */
+ public EClass getTopicContainer() {
+ return topicContainerEClass;
+ }
+
+ /**
+ * Returns the meta object for the reference list '
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getAllComments <em>All Comments</em>}'. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
- * @return the meta object for class '<em>Review</em>'.
- * @see org.eclipse.mylyn.reviews.core.model.IReview
+ * @return the meta object for the reference list '<em>All Comments</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer#getAllComments()
+ * @see #getTopicContainer()
* @generated
*/
- public EClass getReview() {
- return reviewEClass;
+ public EReference getTopicContainer_AllComments() {
+ return (EReference) topicContainerEClass.getEStructuralFeatures().get(0);
}
/**
- * Returns the meta object for the reference list '{@link org.eclipse.mylyn.reviews.core.model.IReview#getTopics
- * <em>Topics</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Returns the meta object for the reference list '
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getTopics <em>Topics</em>}'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
*
* @return the meta object for the reference list '<em>Topics</em>'.
- * @see org.eclipse.mylyn.reviews.core.model.IReview#getTopics()
- * @see #getReview()
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer#getTopics()
+ * @see #getTopicContainer()
* @generated
*/
- public EReference getReview_Topics() {
- return (EReference) reviewEClass.getEStructuralFeatures().get(0);
+ public EReference getTopicContainer_Topics() {
+ return (EReference) topicContainerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * Returns the meta object for the reference list '
+ * {@link org.eclipse.mylyn.reviews.core.model.ITopicContainer#getDirectTopics <em>Direct Topics</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference list '<em>Direct Topics</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopicContainer#getDirectTopics()
+ * @see #getTopicContainer()
+ * @generated
+ */
+ public EReference getTopicContainer_DirectTopics() {
+ return (EReference) topicContainerEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IReview <em>Review</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Review</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IReview
+ * @generated
+ */
+ public EClass getReview() {
+ return reviewEClass;
}
/**
@@ -1226,7 +1626,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EReference getReview_Items() {
- return (EReference) reviewEClass.getEStructuralFeatures().get(1);
+ return (EReference) reviewEClass.getEStructuralFeatures().get(0);
}
/**
@@ -1240,7 +1640,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EReference getReview_ReviewTask() {
- return (EReference) reviewEClass.getEStructuralFeatures().get(2);
+ return (EReference) reviewEClass.getEStructuralFeatures().get(1);
}
/**
@@ -1254,7 +1654,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EReference getReview_State() {
- return (EReference) reviewEClass.getEStructuralFeatures().get(3);
+ return (EReference) reviewEClass.getEStructuralFeatures().get(2);
}
/**
@@ -1267,7 +1667,20 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EAttribute getReview_Id() {
- return (EAttribute) reviewEClass.getEStructuralFeatures().get(4);
+ return (EAttribute) reviewEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.mylyn.reviews.core.model.IReview#getOwner
+ * <em>Owner</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Owner</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IReview#getOwner()
+ * @see #getReview()
+ * @generated
+ */
+ public EReference getReview_Owner() {
+ return (EReference) reviewEClass.getEStructuralFeatures().get(4);
}
/**
@@ -1323,19 +1736,6 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IComment#getCreationDate
- * <em>Creation Date</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Creation Date</em>'.
- * @see org.eclipse.mylyn.reviews.core.model.IComment#getCreationDate()
- * @see #getComment()
- * @generated
- */
- public EAttribute getComment_CreationDate() {
- return (EAttribute) commentEClass.getEStructuralFeatures().get(3);
- }
-
- /**
* Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IComment#getId
* <em>Id</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1345,7 +1745,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EAttribute getComment_Id() {
- return (EAttribute) commentEClass.getEStructuralFeatures().get(4);
+ return (EAttribute) commentEClass.getEStructuralFeatures().get(3);
}
/**
@@ -1359,7 +1759,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EReference getComment_Replies() {
- return (EReference) commentEClass.getEStructuralFeatures().get(5);
+ return (EReference) commentEClass.getEStructuralFeatures().get(4);
}
/**
@@ -1372,7 +1772,20 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EAttribute getComment_Draft() {
- return (EAttribute) commentEClass.getEStructuralFeatures().get(6);
+ return (EAttribute) commentEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic
+ * <em>Parent Topic</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Parent Topic</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IComment#getParentTopic()
+ * @see #getComment()
+ * @generated
+ */
+ public EReference getComment_ParentTopic() {
+ return (EReference) commentEClass.getEStructuralFeatures().get(6);
}
/**
@@ -1427,20 +1840,6 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
- * Returns the meta object for the reference list '
- * {@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getTopics <em>Topics</em>}'. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @return the meta object for the reference list '<em>Topics</em>'.
- * @see org.eclipse.mylyn.reviews.core.model.IReviewItem#getTopics()
- * @see #getReviewItem()
- * @generated
- */
- public EReference getReviewItem_Topics() {
- return (EReference) reviewItemEClass.getEStructuralFeatures().get(3);
- }
-
- /**
* Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IReviewItem#getId
* <em>Id</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1450,7 +1849,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EAttribute getReviewItem_Id() {
- return (EAttribute) reviewItemEClass.getEStructuralFeatures().get(4);
+ return (EAttribute) reviewItemEClass.getEStructuralFeatures().get(3);
}
/**
@@ -1856,6 +2255,32 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMin
+ * <em>Range Min</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Range Min</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMin()
+ * @see #getLineLocation()
+ * @generated
+ */
+ public EAttribute getLineLocation_RangeMin() {
+ return (EAttribute) lineLocationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMax
+ * <em>Range Max</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Range Max</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ILineLocation#getRangeMax()
+ * @see #getLineLocation()
+ * @generated
+ */
+ public EAttribute getLineLocation_RangeMax() {
+ return (EAttribute) lineLocationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.ILineRange <em>Line Range</em>}'.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1945,6 +2370,19 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
+ * Returns the meta object for the reference '{@link org.eclipse.mylyn.reviews.core.model.IFileRevision#getFile
+ * <em>File</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>File</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IFileRevision#getFile()
+ * @see #getFileRevision()
+ * @generated
+ */
+ public EReference getFileRevision_File() {
+ return (EReference) fileRevisionEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning
* <em>Model Versioning</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1971,6 +2409,70 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
+ * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IIndexed <em>Indexed</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Indexed</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IIndexed
+ * @generated
+ */
+ public EClass getIndexed() {
+ return indexedEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IIndexed#getIndex
+ * <em>Index</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Index</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IIndexed#getIndex()
+ * @see #getIndexed()
+ * @generated
+ */
+ public EAttribute getIndexed_Index() {
+ return (EAttribute) indexedEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IDated <em>Dated</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Dated</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IDated
+ * @generated
+ */
+ public EClass getDated() {
+ return datedEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IDated#getCreationDate
+ * <em>Creation Date</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Creation Date</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IDated#getCreationDate()
+ * @see #getDated()
+ * @generated
+ */
+ public EAttribute getDated_CreationDate() {
+ return (EAttribute) datedEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.mylyn.reviews.core.model.IDated#getModificationDate <em>Modification Date</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Modification Date</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IDated#getModificationDate()
+ * @see #getDated()
+ * @generated
+ */
+ public EAttribute getDated_ModificationDate() {
+ return (EAttribute) datedEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -1999,27 +2501,31 @@ public class ReviewsPackage extends EPackageImpl {
isCreated = true;
// Create classes and their features
+ topicContainerEClass = createEClass(TOPIC_CONTAINER);
+ createEReference(topicContainerEClass, TOPIC_CONTAINER__ALL_COMMENTS);
+ createEReference(topicContainerEClass, TOPIC_CONTAINER__TOPICS);
+ createEReference(topicContainerEClass, TOPIC_CONTAINER__DIRECT_TOPICS);
+
reviewEClass = createEClass(REVIEW);
- createEReference(reviewEClass, REVIEW__TOPICS);
createEReference(reviewEClass, REVIEW__ITEMS);
createEReference(reviewEClass, REVIEW__REVIEW_TASK);
createEReference(reviewEClass, REVIEW__STATE);
createEAttribute(reviewEClass, REVIEW__ID);
+ createEReference(reviewEClass, REVIEW__OWNER);
commentEClass = createEClass(COMMENT);
createEReference(commentEClass, COMMENT__AUTHOR);
createEReference(commentEClass, COMMENT__TYPE);
createEAttribute(commentEClass, COMMENT__DESCRIPTION);
- createEAttribute(commentEClass, COMMENT__CREATION_DATE);
createEAttribute(commentEClass, COMMENT__ID);
createEReference(commentEClass, COMMENT__REPLIES);
createEAttribute(commentEClass, COMMENT__DRAFT);
+ createEReference(commentEClass, COMMENT__PARENT_TOPIC);
reviewItemEClass = createEClass(REVIEW_ITEM);
createEReference(reviewItemEClass, REVIEW_ITEM__ADDED_BY);
createEReference(reviewItemEClass, REVIEW_ITEM__REVIEW);
createEAttribute(reviewItemEClass, REVIEW_ITEM__NAME);
- createEReference(reviewItemEClass, REVIEW_ITEM__TOPICS);
createEAttribute(reviewItemEClass, REVIEW_ITEM__ID);
locationEClass = createEClass(LOCATION);
@@ -2063,6 +2569,8 @@ public class ReviewsPackage extends EPackageImpl {
lineLocationEClass = createEClass(LINE_LOCATION);
createEReference(lineLocationEClass, LINE_LOCATION__RANGES);
+ createEAttribute(lineLocationEClass, LINE_LOCATION__RANGE_MIN);
+ createEAttribute(lineLocationEClass, LINE_LOCATION__RANGE_MAX);
lineRangeEClass = createEClass(LINE_RANGE);
createEAttribute(lineRangeEClass, LINE_RANGE__START);
@@ -2072,9 +2580,17 @@ public class ReviewsPackage extends EPackageImpl {
createEAttribute(fileRevisionEClass, FILE_REVISION__PATH);
createEAttribute(fileRevisionEClass, FILE_REVISION__REVISION);
createEAttribute(fileRevisionEClass, FILE_REVISION__CONTENT);
+ createEReference(fileRevisionEClass, FILE_REVISION__FILE);
modelVersioningEClass = createEClass(MODEL_VERSIONING);
createEAttribute(modelVersioningEClass, MODEL_VERSIONING__FRAGMENT_VERSION);
+
+ indexedEClass = createEClass(INDEXED);
+ createEAttribute(indexedEClass, INDEXED__INDEX);
+
+ datedEClass = createEClass(DATED);
+ createEAttribute(datedEClass, DATED__CREATION_DATE);
+ createEAttribute(datedEClass, DATED__MODIFICATION_DATE);
}
/**
@@ -2105,25 +2621,49 @@ public class ReviewsPackage extends EPackageImpl {
// Set bounds for type parameters
// Add supertypes to classes
- reviewEClass.getESuperTypes().add(this.getReviewComponent());
+ topicContainerEClass.getESuperTypes().add(this.getReviewComponent());
+ reviewEClass.getESuperTypes().add(this.getTopicContainer());
+ reviewEClass.getESuperTypes().add(this.getDated());
commentEClass.getESuperTypes().add(this.getReviewComponent());
- reviewItemEClass.getESuperTypes().add(this.getReviewComponent());
+ commentEClass.getESuperTypes().add(this.getIndexed());
+ commentEClass.getESuperTypes().add(this.getDated());
+ reviewItemEClass.getESuperTypes().add(this.getTopicContainer());
+ locationEClass.getESuperTypes().add(this.getIndexed());
taskReferenceEClass.getESuperTypes().add(this.getReviewComponent());
reviewStateEClass.getESuperTypes().add(this.getReviewComponent());
reviewGroupEClass.getESuperTypes().add(this.getReviewComponent());
topicEClass.getESuperTypes().add(this.getComment());
fileItemEClass.getESuperTypes().add(this.getReviewItem());
reviewItemSetEClass.getESuperTypes().add(this.getReviewItem());
+ reviewItemSetEClass.getESuperTypes().add(this.getDated());
lineLocationEClass.getESuperTypes().add(this.getLocation());
fileRevisionEClass.getESuperTypes().add(this.getReviewItem());
// Initialize classes and features; add operations and parameters
- initEClass(reviewEClass, IReview.class, "Review", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEClass(topicContainerEClass, ITopicContainer.class,
+ "TopicContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEReference(
+ getTopicContainer_AllComments(),
+ this.getComment(),
+ null,
+ "allComments", null, 0, -1, ITopicContainer.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(
- getReview_Topics(),
+ getTopicContainer_Topics(),
this.getTopic(),
null,
- "topics", null, 0, -1, IReview.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ "topics", null, 0, -1, ITopicContainer.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
+ getTopicContainer_DirectTopics(),
+ this.getTopic(),
+ this.getTopic_Item(),
+ "directTopics", null, 0, -1, ITopicContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ EOperation op = addEOperation(topicContainerEClass, this.getTopic(),
+ "createTopicComment", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
+ addEParameter(op, this.getLocation(), "initalLocation", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
+ addEParameter(op, ecorePackage.getEString(), "commentText", 1, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
+
+ initEClass(reviewEClass, IReview.class, "Review", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
initEReference(
getReview_Items(),
this.getReviewItem(),
@@ -2143,6 +2683,11 @@ public class ReviewsPackage extends EPackageImpl {
getReview_Id(),
ecorePackage.getEString(),
"id", null, 0, 1, IReview.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
+ getReview_Owner(),
+ this.getUser(),
+ null,
+ "owner", null, 0, 1, IReview.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEClass(commentEClass, IComment.class, "Comment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
initEReference(
@@ -2160,10 +2705,6 @@ public class ReviewsPackage extends EPackageImpl {
ecorePackage.getEString(),
"description", null, 0, 1, IComment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEAttribute(
- getComment_CreationDate(),
- ecorePackage.getEDate(),
- "creationDate", null, 0, 1, IComment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(
getComment_Id(),
ecorePackage.getEString(),
"id", null, 0, 1, IComment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
@@ -2176,6 +2717,11 @@ public class ReviewsPackage extends EPackageImpl {
getComment_Draft(),
ecorePackage.getEBoolean(),
"draft", null, 0, 1, IComment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
+ getComment_ParentTopic(),
+ this.getTopic(),
+ this.getTopic_Comments(),
+ "parentTopic", null, 0, 1, IComment.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEClass(reviewItemEClass, IReviewItem.class,
"ReviewItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -2193,21 +2739,11 @@ public class ReviewsPackage extends EPackageImpl {
getReviewItem_Name(),
ecorePackage.getEString(),
"name", null, 0, 1, IReviewItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(
- getReviewItem_Topics(),
- this.getTopic(),
- this.getTopic_Item(),
- "topics", null, 0, -1, IReviewItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEAttribute(
getReviewItem_Id(),
ecorePackage.getEString(),
"id", null, 0, 1, IReviewItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- EOperation op = addEOperation(reviewItemEClass, this.getTopic(),
- "createTopicComment", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
- addEParameter(op, this.getLocation(), "initalLocation", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
- addEParameter(op, ecorePackage.getEString(), "commentText", 1, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
-
initEClass(locationEClass, ILocation.class, "Location", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
initEClass(userEClass, IUser.class, "User", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -2272,7 +2808,7 @@ public class ReviewsPackage extends EPackageImpl {
initEReference(
getTopic_Comments(),
this.getComment(),
- null,
+ this.getComment_ParentTopic(),
"comments", null, 0, -1, ITopic.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(
getTopic_Review(),
@@ -2285,8 +2821,8 @@ public class ReviewsPackage extends EPackageImpl {
"title", null, 0, 1, ITopic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(
getTopic_Item(),
- this.getReviewItem(),
- this.getReviewItem_Topics(),
+ this.getTopicContainer(),
+ this.getTopicContainer_DirectTopics(),
"item", null, 0, 1, ITopic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEClass(reviewComponentEClass, IReviewComponent.class,
@@ -2328,6 +2864,14 @@ public class ReviewsPackage extends EPackageImpl {
this.getLineRange(),
null,
"ranges", null, 0, -1, ILineLocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(
+ getLineLocation_RangeMin(),
+ ecorePackage.getEInt(),
+ "rangeMin", null, 1, 1, ILineLocation.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(
+ getLineLocation_RangeMax(),
+ ecorePackage.getEInt(),
+ "rangeMax", null, 1, 1, ILineLocation.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEClass(lineRangeEClass, ILineRange.class,
"LineRange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -2354,6 +2898,11 @@ public class ReviewsPackage extends EPackageImpl {
getFileRevision_Content(),
ecorePackage.getEString(),
"content", null, 0, 1, IFileRevision.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
+ getFileRevision_File(),
+ this.getFileItem(),
+ null,
+ "file", null, 0, 1, IFileRevision.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEClass(modelVersioningEClass, IModelVersioning.class,
"ModelVersioning", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -2362,6 +2911,22 @@ public class ReviewsPackage extends EPackageImpl {
ecorePackage.getEString(),
"fragmentVersion", "1.0.0", 0, 1, IModelVersioning.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$
+ initEClass(indexedEClass, IIndexed.class, "Indexed", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(
+ getIndexed_Index(),
+ ecorePackage.getELong(),
+ "index", null, 1, 1, IIndexed.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ initEClass(datedEClass, IDated.class, "Dated", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(
+ getDated_CreationDate(),
+ ecorePackage.getEDate(),
+ "creationDate", null, 0, 1, IDated.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(
+ getDated_ModificationDate(),
+ ecorePackage.getEDate(),
+ "modificationDate", null, 0, 1, IDated.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
// Create resource
createResource(eNS_URI);
@@ -2398,14 +2963,22 @@ public class ReviewsPackage extends EPackageImpl {
*/
public interface Literals {
/**
- * The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Review <em>Review</em>}
- * ' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.TopicContainer
+ * <em>Topic Container</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @see org.eclipse.mylyn.reviews.internal.core.model.Review
- * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReview()
+ * @see org.eclipse.mylyn.reviews.internal.core.model.TopicContainer
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getTopicContainer()
* @generated
*/
- public static final EClass REVIEW = eINSTANCE.getReview();
+ public static final EClass TOPIC_CONTAINER = eINSTANCE.getTopicContainer();
+
+ /**
+ * The meta object literal for the '<em><b>All Comments</b></em>' reference list feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EReference TOPIC_CONTAINER__ALL_COMMENTS = eINSTANCE.getTopicContainer_AllComments();
/**
* The meta object literal for the '<em><b>Topics</b></em>' reference list feature. <!-- begin-user-doc --> <!--
@@ -2413,7 +2986,25 @@ public class ReviewsPackage extends EPackageImpl {
*
* @generated
*/
- public static final EReference REVIEW__TOPICS = eINSTANCE.getReview_Topics();
+ public static final EReference TOPIC_CONTAINER__TOPICS = eINSTANCE.getTopicContainer_Topics();
+
+ /**
+ * The meta object literal for the '<em><b>Direct Topics</b></em>' reference list feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EReference TOPIC_CONTAINER__DIRECT_TOPICS = eINSTANCE.getTopicContainer_DirectTopics();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Review <em>Review</em>}
+ * ' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.internal.core.model.Review
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getReview()
+ * @generated
+ */
+ public static final EClass REVIEW = eINSTANCE.getReview();
/**
* The meta object literal for the '<em><b>Items</b></em>' reference list feature. <!-- begin-user-doc --> <!--
@@ -2448,6 +3039,14 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute REVIEW__ID = eINSTANCE.getReview_Id();
/**
+ * The meta object literal for the '<em><b>Owner</b></em>' reference feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EReference REVIEW__OWNER = eINSTANCE.getReview_Owner();
+
+ /**
* The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.Comment
* <em>Comment</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2482,14 +3081,6 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute COMMENT__DESCRIPTION = eINSTANCE.getComment_Description();
/**
- * The meta object literal for the '<em><b>Creation Date</b></em>' attribute feature. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final EAttribute COMMENT__CREATION_DATE = eINSTANCE.getComment_CreationDate();
-
- /**
* The meta object literal for the '<em><b>Id</b></em>' attribute feature. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -2514,6 +3105,14 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute COMMENT__DRAFT = eINSTANCE.getComment_Draft();
/**
+ * The meta object literal for the '<em><b>Parent Topic</b></em>' reference feature. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EReference COMMENT__PARENT_TOPIC = eINSTANCE.getComment_ParentTopic();
+
+ /**
* The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.ReviewItem
* <em>Review Item</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2548,14 +3147,6 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute REVIEW_ITEM__NAME = eINSTANCE.getReviewItem_Name();
/**
- * The meta object literal for the '<em><b>Topics</b></em>' reference list feature. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- public static final EReference REVIEW_ITEM__TOPICS = eINSTANCE.getReviewItem_Topics();
-
- /**
* The meta object literal for the '<em><b>Id</b></em>' attribute feature. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -2834,6 +3425,22 @@ public class ReviewsPackage extends EPackageImpl {
public static final EReference LINE_LOCATION__RANGES = eINSTANCE.getLineLocation_Ranges();
/**
+ * The meta object literal for the '<em><b>Range Min</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EAttribute LINE_LOCATION__RANGE_MIN = eINSTANCE.getLineLocation_RangeMin();
+
+ /**
+ * The meta object literal for the '<em><b>Range Max</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EAttribute LINE_LOCATION__RANGE_MAX = eINSTANCE.getLineLocation_RangeMax();
+
+ /**
* The meta object literal for the '{@link org.eclipse.mylyn.reviews.internal.core.model.LineRange
* <em>Line Range</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2894,6 +3501,14 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute FILE_REVISION__CONTENT = eINSTANCE.getFileRevision_Content();
/**
+ * The meta object literal for the '<em><b>File</b></em>' reference feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EReference FILE_REVISION__FILE = eINSTANCE.getFileRevision_File();
+
+ /**
* The meta object literal for the '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning
* <em>Model Versioning</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2911,6 +3526,50 @@ public class ReviewsPackage extends EPackageImpl {
*/
public static final EAttribute MODEL_VERSIONING__FRAGMENT_VERSION = eINSTANCE.getModelVersioning_FragmentVersion();
+ /**
+ * The meta object literal for the '{@link org.eclipse.mylyn.reviews.core.model.IIndexed <em>Indexed</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.core.model.IIndexed
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getIndexed()
+ * @generated
+ */
+ public static final EClass INDEXED = eINSTANCE.getIndexed();
+
+ /**
+ * The meta object literal for the '<em><b>Index</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EAttribute INDEXED__INDEX = eINSTANCE.getIndexed_Index();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.mylyn.reviews.core.model.IDated <em>Dated</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.mylyn.reviews.core.model.IDated
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getDated()
+ * @generated
+ */
+ public static final EClass DATED = eINSTANCE.getDated();
+
+ /**
+ * The meta object literal for the '<em><b>Creation Date</b></em>' attribute feature. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EAttribute DATED__CREATION_DATE = eINSTANCE.getDated_CreationDate();
+
+ /**
+ * The meta object literal for the '<em><b>Modification Date</b></em>' attribute feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final EAttribute DATED__MODIFICATION_DATE = eINSTANCE.getDated_ModificationDate();
+
}
} //ReviewsPackage
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
index c0905c3..96eb4de 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
@@ -81,10 +81,23 @@ public class ReviewsSwitch<T> {
*/
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
+ case ReviewsPackage.TOPIC_CONTAINER: {
+ ITopicContainer topicContainer = (ITopicContainer) theEObject;
+ T result = caseTopicContainer(topicContainer);
+ if (result == null)
+ result = caseReviewComponent(topicContainer);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
case ReviewsPackage.REVIEW: {
IReview review = (IReview) theEObject;
T result = caseReview(review);
if (result == null)
+ result = caseTopicContainer(review);
+ if (result == null)
+ result = caseDated(review);
+ if (result == null)
result = caseReviewComponent(review);
if (result == null)
result = defaultCase(theEObject);
@@ -96,6 +109,10 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseReviewComponent(comment);
if (result == null)
+ result = caseIndexed(comment);
+ if (result == null)
+ result = caseDated(comment);
+ if (result == null)
result = defaultCase(theEObject);
return result;
}
@@ -103,6 +120,8 @@ public class ReviewsSwitch<T> {
IReviewItem reviewItem = (IReviewItem) theEObject;
T result = caseReviewItem(reviewItem);
if (result == null)
+ result = caseTopicContainer(reviewItem);
+ if (result == null)
result = caseReviewComponent(reviewItem);
if (result == null)
result = defaultCase(theEObject);
@@ -112,6 +131,8 @@ public class ReviewsSwitch<T> {
ILocation location = (ILocation) theEObject;
T result = caseLocation(location);
if (result == null)
+ result = caseIndexed(location);
+ if (result == null)
result = defaultCase(theEObject);
return result;
}
@@ -164,6 +185,10 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseReviewComponent(topic);
if (result == null)
+ result = caseIndexed(topic);
+ if (result == null)
+ result = caseDated(topic);
+ if (result == null)
result = defaultCase(theEObject);
return result;
}
@@ -180,6 +205,8 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseReviewItem(fileItem);
if (result == null)
+ result = caseTopicContainer(fileItem);
+ if (result == null)
result = caseReviewComponent(fileItem);
if (result == null)
result = defaultCase(theEObject);
@@ -191,6 +218,10 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseReviewItem(reviewItemSet);
if (result == null)
+ result = caseDated(reviewItemSet);
+ if (result == null)
+ result = caseTopicContainer(reviewItemSet);
+ if (result == null)
result = caseReviewComponent(reviewItemSet);
if (result == null)
result = defaultCase(theEObject);
@@ -202,6 +233,8 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseLocation(lineLocation);
if (result == null)
+ result = caseIndexed(lineLocation);
+ if (result == null)
result = defaultCase(theEObject);
return result;
}
@@ -218,6 +251,8 @@ public class ReviewsSwitch<T> {
if (result == null)
result = caseReviewItem(fileRevision);
if (result == null)
+ result = caseTopicContainer(fileRevision);
+ if (result == null)
result = caseReviewComponent(fileRevision);
if (result == null)
result = defaultCase(theEObject);
@@ -230,12 +265,41 @@ public class ReviewsSwitch<T> {
result = defaultCase(theEObject);
return result;
}
+ case ReviewsPackage.INDEXED: {
+ IIndexed indexed = (IIndexed) theEObject;
+ T result = caseIndexed(indexed);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case ReviewsPackage.DATED: {
+ IDated dated = (IDated) theEObject;
+ T result = caseDated(dated);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
}
/**
+ * <<<<<<< Upstream, based on origin/master ======= Returns the result of interpreting the object as an instance of
+ * '<em>Topic Container</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result
+ * will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Topic Container</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTopicContainer(ITopicContainer object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Review</em>'. <!-- begin-user-doc --> This
* implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
*
@@ -478,6 +542,34 @@ public class ReviewsSwitch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Indexed</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Indexed</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIndexed(IIndexed object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Dated</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Dated</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDated(IDated object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This
* implementation returns null; returning a non-null result will terminate the switch, but this is the last case
* anyway. <!-- end-user-doc -->
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java
index a0315e2..d3677a0 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
@@ -34,6 +35,7 @@ import org.eclipse.mylyn.reviews.core.model.IReview;
import org.eclipse.mylyn.reviews.core.model.IReviewItem;
import org.eclipse.mylyn.reviews.core.model.ITaskReference;
import org.eclipse.mylyn.reviews.core.model.ITopic;
+import org.eclipse.mylyn.reviews.core.model.ITopicContainer;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Topic</b></em>'. <!-- end-user-doc -->
@@ -120,7 +122,7 @@ public class Topic extends Comment implements ITopic {
* @generated
* @ordered
*/
- protected IReviewItem item;
+ protected ITopicContainer item;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -235,7 +237,8 @@ public class Topic extends Comment implements ITopic {
*/
public List<IComment> getComments() {
if (comments == null) {
- comments = new EObjectResolvingEList<IComment>(IComment.class, this, ReviewsPackage.TOPIC__COMMENTS);
+ comments = new EObjectWithInverseResolvingEList<IComment>(IComment.class, this,
+ ReviewsPackage.TOPIC__COMMENTS, ReviewsPackage.COMMENT__PARENT_TOPIC);
}
return comments;
}
@@ -305,10 +308,10 @@ public class Topic extends Comment implements ITopic {
*
* @generated
*/
- public IReviewItem getItem() {
+ public ITopicContainer getItem() {
if (item != null && item.eIsProxy()) {
InternalEObject oldItem = (InternalEObject) item;
- item = (IReviewItem) eResolveProxy(oldItem);
+ item = (ITopicContainer) eResolveProxy(oldItem);
if (item != oldItem) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewsPackage.TOPIC__ITEM, oldItem, item));
@@ -322,7 +325,7 @@ public class Topic extends Comment implements ITopic {
*
* @generated
*/
- public IReviewItem basicGetItem() {
+ public ITopicContainer basicGetItem() {
return item;
}
@@ -331,8 +334,8 @@ public class Topic extends Comment implements ITopic {
*
* @generated
*/
- public NotificationChain basicSetItem(IReviewItem newItem, NotificationChain msgs) {
- IReviewItem oldItem = item;
+ public NotificationChain basicSetItem(ITopicContainer newItem, NotificationChain msgs) {
+ ITopicContainer oldItem = item;
item = newItem;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReviewsPackage.TOPIC__ITEM,
@@ -350,15 +353,15 @@ public class Topic extends Comment implements ITopic {
*
* @generated
*/
- public void setItem(IReviewItem newItem) {
+ public void setItem(ITopicContainer newItem) {
if (newItem != item) {
NotificationChain msgs = null;
if (item != null)
- msgs = ((InternalEObject) item).eInverseRemove(this, ReviewsPackage.REVIEW_ITEM__TOPICS,
- IReviewItem.class, msgs);
+ msgs = ((InternalEObject) item).eInverseRemove(this, ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS,
+ ITopicContainer.class, msgs);
if (newItem != null)
- msgs = ((InternalEObject) newItem).eInverseAdd(this, ReviewsPackage.REVIEW_ITEM__TOPICS,
- IReviewItem.class, msgs);
+ msgs = ((InternalEObject) newItem).eInverseAdd(this, ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS,
+ ITopicContainer.class, msgs);
msgs = basicSetItem(newItem, msgs);
if (msgs != null)
msgs.dispatch();
@@ -367,18 +370,35 @@ public class Topic extends Comment implements ITopic {
}
/**
+ * <!-- begin-user-doc --> Returns 0; base comments aren't ordered. <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public long getIndex() {
+ long index = Long.MAX_VALUE;
+ for (ILocation location : getLocations()) {
+ index = Math.min(index, location.getIndex());
+ }
+ return index;
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
+ case ReviewsPackage.TOPIC__COMMENTS:
+ return ((InternalEList<InternalEObject>) (InternalEList<?>) getComments()).basicAdd(otherEnd, msgs);
case ReviewsPackage.TOPIC__ITEM:
if (item != null)
- msgs = ((InternalEObject) item).eInverseRemove(this, ReviewsPackage.REVIEW_ITEM__TOPICS,
- IReviewItem.class, msgs);
- return basicSetItem((IReviewItem) otherEnd, msgs);
+ msgs = ((InternalEObject) item).eInverseRemove(this, ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS,
+ ITopicContainer.class, msgs);
+ return basicSetItem((ITopicContainer) otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
@@ -395,6 +415,8 @@ public class Topic extends Comment implements ITopic {
return basicSetTask(null, msgs);
case ReviewsPackage.TOPIC__LOCATIONS:
return ((InternalEList<?>) getLocations()).basicRemove(otherEnd, msgs);
+ case ReviewsPackage.TOPIC__COMMENTS:
+ return ((InternalEList<?>) getComments()).basicRemove(otherEnd, msgs);
case ReviewsPackage.TOPIC__ITEM:
return basicSetItem(null, msgs);
}
@@ -458,7 +480,7 @@ public class Topic extends Comment implements ITopic {
setTitle((String) newValue);
return;
case ReviewsPackage.TOPIC__ITEM:
- setItem((IReviewItem) newValue);
+ setItem((ITopicContainer) newValue);
return;
}
super.eSet(featureID, newValue);
@@ -488,7 +510,7 @@ public class Topic extends Comment implements ITopic {
setTitle(TITLE_EDEFAULT);
return;
case ReviewsPackage.TOPIC__ITEM:
- setItem((IReviewItem) null);
+ setItem((ITopicContainer) null);
return;
}
super.eUnset(featureID);
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/TopicContainer.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/TopicContainer.java
new file mode 100644
index 0000000..b86ada3
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/TopicContainer.java
@@ -0,0 +1,245 @@
+/**
+ * Copyright (c) 2011 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.internal.core.model;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.mylyn.reviews.core.model.IComment;
+import org.eclipse.mylyn.reviews.core.model.ILocation;
+import org.eclipse.mylyn.reviews.core.model.ITopic;
+import org.eclipse.mylyn.reviews.core.model.ITopicContainer;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Topic Container</b></em>'. <!-- end-user-doc
+ * -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.TopicContainer#getAllComments <em>All Comments</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.TopicContainer#getTopics <em>Topics</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class TopicContainer extends ReviewComponent implements ITopicContainer {
+ /**
+ * The cached value of the '{@link #getTopics() <em>Topics</em>}' reference list. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getTopics()
+ * @generated
+ * @ordered
+ */
+ protected EList<ITopic> topics;
+
+ /**
+ * The cached value of the '{@link #getDirectTopics() <em>Direct Topics</em>}' reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getDirectTopics()
+ * @generated
+ * @ordered
+ */
+ protected EList<ITopic> directTopics;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TopicContainer() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ReviewsPackage.Literals.TOPIC_CONTAINER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public List<IComment> getAllComments() {
+ // TODO: implement this method to return the 'All Comments' reference list
+ // Ensure that you remove @generated or mark it @generated NOT
+ // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting
+ // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used.
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public List<ITopic> getTopics() {
+ return getDirectTopics();
+ }
+
+ /**
+ * <!-- begin-user-doc -->See Important note in {@link ITopicContainer#getDirectTopics()} <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public List<ITopic> getDirectTopics() {
+ if (directTopics == null) {
+ directTopics = new EObjectWithInverseResolvingEList<ITopic>(ITopic.class, this,
+ ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS, ReviewsPackage.TOPIC__ITEM);
+ }
+ return directTopics;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public ITopic createTopicComment(ILocation initalLocation, String commentText) {
+ ITopic topic = ReviewsFactory.eINSTANCE.createTopic();
+ topic.setDraft(true);
+ topic.setDescription(commentText);
+ if (initalLocation != null) {
+ topic.getLocations().add(initalLocation);
+ }
+
+ IComment comment = ReviewsFactory.eINSTANCE.createComment();
+ comment.setDescription(topic.getDescription());
+ comment.setDraft(true);
+ Date created = new Date();
+ comment.setCreationDate(created);
+ topic.setCreationDate(created);
+ topic.getComments().add(comment);
+ getTopics().add(topic);
+ return topic;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ return ((InternalEList<InternalEObject>) (InternalEList<?>) getDirectTopics()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ return ((InternalEList<?>) getDirectTopics()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__ALL_COMMENTS:
+ return getAllComments();
+ case ReviewsPackage.TOPIC_CONTAINER__TOPICS:
+ return getTopics();
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ return getDirectTopics();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__TOPICS:
+ getTopics().clear();
+ getTopics().addAll((Collection<? extends ITopic>) newValue);
+ return;
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ getDirectTopics().clear();
+ getDirectTopics().addAll((Collection<? extends ITopic>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__TOPICS:
+ getTopics().clear();
+ return;
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ getDirectTopics().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ReviewsPackage.TOPIC_CONTAINER__ALL_COMMENTS:
+ return !getAllComments().isEmpty();
+ case ReviewsPackage.TOPIC_CONTAINER__TOPICS:
+ return topics != null && !topics.isEmpty();
+ case ReviewsPackage.TOPIC_CONTAINER__DIRECT_TOPICS:
+ return directTopics != null && !directTopics.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //TopicContainer
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java
index aff5484..da9c9e8 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java
@@ -210,8 +210,8 @@ public class ReviewAnnotationModel implements IAnnotationModel {
if (location instanceof ILineLocation) {
ILineLocation lineLocation = (ILineLocation) location;
try {
- startLine = lineLocation.getTotalMin();
- endLine = lineLocation.getTotalMax();
+ startLine = lineLocation.getRangeMin();
+ endLine = lineLocation.getRangeMax();
int offset = 0;
int length = 0;
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java
index 2ec7701..6fd70e9 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java
@@ -101,8 +101,8 @@ class ReviewCompareInputListener implements ITextInputListener, IReviewCompareSo
ILocation location = comment.getLocations().get(0);
if (location instanceof ILineLocation) {
ILineLocation lineLocation = (ILineLocation) location;
- startLine = lineLocation.getTotalMin();
- endLine = lineLocation.getTotalMax();
+ startLine = lineLocation.getRangeMin();
+ endLine = lineLocation.getRangeMax();
if (lineNr >= startLine && lineNr <= endLine) {
AnnotationPreference pref = new AnnotationPreferenceLookup().getAnnotationPreference(annotation);
if (pref.getHighlightPreferenceValue()) {
@@ -217,8 +217,8 @@ class ReviewCompareInputListener implements ITextInputListener, IReviewCompareSo
if (range instanceof ILineLocation) {
ILineLocation lineLocation = (ILineLocation) range;
// editors count lines from 0, Crucible counts from 1
- final int startLine = lineLocation.getTotalMin() - 1;
- final int endLine = lineLocation.getTotalMax() - 1;
+ final int startLine = lineLocation.getRangeMin() - 1;
+ final int endLine = lineLocation.getRangeMax() - 1;
if (sourceViewer != null) {
IDocument document = sourceViewer.getDocument();
if (document != null) {