summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2012-09-27 13:11:00 (EDT)
committer Miles Parker2012-09-27 13:11:00 (EDT)
commit4ac24dc60f9c5f5c4b9892cb0eeb5d502e7583a7 (patch)
treef31d306ce3e4cc328d89607f4f7a53592cf072c3
parente494e0633495be1a8679558c464dfcfb7faf2990 (diff)
downloadorg.eclipse.mylyn.reviews-4ac24dc60f9c5f5c4b9892cb0eeb5d502e7583a7.zip
org.eclipse.mylyn.reviews-4ac24dc60f9c5f5c4b9892cb0eeb5d502e7583a7.tar.gz
org.eclipse.mylyn.reviews-4ac24dc60f9c5f5c4b9892cb0eeb5d502e7583a7.tar.bz2
324327: Rename and change cardinality of topic location from 0..1 torefs/changes/08/7908/6
0..* Change-Id: I07b2092753173b6cd8e39f7d1e74bb64375f0e3d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=324327
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritUtil.java2
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java2
-rw-r--r--org.eclipse.mylyn.gerrit.feature/org.eclipse.mylyn.gerrit.launch200
-rw-r--r--org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/GerritSynchronizationTest.java3
-rw-r--r--org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java17
-rw-r--r--org.eclipse.mylyn.reviews.core/model/reviews.ecore4
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/ITopic.java22
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java22
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/Topic.java75
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/ReviewAnnotationModel.java60
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareInputListener.java19
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java2
12 files changed, 100 insertions, 328 deletions
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritUtil.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritUtil.java
index 8c3ced8..f5a19ce 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritUtil.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritUtil.java
@@ -181,7 +181,7 @@ public class GerritUtil {
topic.setId(comment.getKey().get());
topic.setAuthor(author);
topic.setCreationDate(comment.getWrittenOn());
- topic.setLocation(location);
+ topic.getLocations().add(location);
topic.setItem(revision);
topic.setDraft(PatchLineComment.Status.DRAFT == comment.getStatus());
topic.setDescription(comment.getMessage());
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java
index 3c46706..bfd416c 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java
@@ -667,7 +667,7 @@ public class GerritClient {
ITopic topic = FACTORY.createTopic();
topic.setAuthor(author);
topic.setCreationDate(comment.getWrittenOn());
- topic.setLocation(location);
+ topic.getLocations().add(location);
topic.setItem(revision);
topic.setDescription(comment.getMessage());
topic.getComments().add(topicComment);
diff --git a/org.eclipse.mylyn.gerrit.feature/org.eclipse.mylyn.gerrit.launch b/org.eclipse.mylyn.gerrit.feature/org.eclipse.mylyn.gerrit.launch
deleted file mode 100644
index 554959c..0000000
--- a/org.eclipse.mylyn.gerrit.feature/org.eclipse.mylyn.gerrit.launch
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
-<setAttribute key="additional_plugins"/>
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="true"/>
-<booleanAttribute key="automaticAdd" value="false"/>
-<booleanAttribute key="automaticValidate" value="true"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="false"/>
-<booleanAttribute key="clearws" value="false"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/reviews"/>
-<booleanAttribute key="default" value="false"/>
-<stringAttribute key="featureDefaultLocation" value="workspace"/>
-<stringAttribute key="featurePluginResolution" value="workspace"/>
-<booleanAttribute key="includeOptional" value="false"/>
-<stringAttribute key="location" value="${workspace_loc}/../workspace-runtime-gerrit"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<setAttribute key="selected_features">
-<setEntry value="com.atlassian.connector.commons:default"/>
-<setEntry value="com.atlassian.connector.eclipse.bamboo:default"/>
-<setEntry value="com.atlassian.connector.eclipse.commons:default"/>
-<setEntry value="com.atlassian.connector.eclipse.crucible:default"/>
-<setEntry value="com.atlassian.connector.eclipse.jira:default"/>
-<setEntry value="com.atlassian.connector.eclipse.monitor:default"/>
-<setEntry value="com.atlassian.connector.eclipse:default"/>
-<setEntry value="com.mountainminds.eclemma.feature:default"/>
-<setEntry value="edu.umd.cs.findbugs.plugin.eclipse:default"/>
-<setEntry value="org.eclipse.cvs:default"/>
-<setEntry value="org.eclipse.datatools.common.doc.user:default"/>
-<setEntry value="org.eclipse.datatools.connectivity.doc.user:default"/>
-<setEntry value="org.eclipse.datatools.connectivity.feature:default"/>
-<setEntry value="org.eclipse.datatools.connectivity.oda.designer.core.feature:default"/>
-<setEntry value="org.eclipse.datatools.connectivity.oda.designer.feature:default"/>
-<setEntry value="org.eclipse.datatools.connectivity.oda.feature:default"/>
-<setEntry value="org.eclipse.datatools.doc.user:default"/>
-<setEntry value="org.eclipse.datatools.enablement.apache.derby.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.hsqldb.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.ibm.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.ingres.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.jdbc.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.jdt.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.msft.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.mysql.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.oda.designer.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.oda.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.oracle.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.postgresql.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.sap.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.sqlite.feature:default"/>
-<setEntry value="org.eclipse.datatools.enablement.sybase.feature:default"/>
-<setEntry value="org.eclipse.datatools.intro:default"/>
-<setEntry value="org.eclipse.datatools.modelbase.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.data.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.ddl.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.ddlgen.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.parsers.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.results.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.schemaobjecteditor.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqldevtools.sqlbuilder.feature:default"/>
-<setEntry value="org.eclipse.datatools.sqltools.doc.user:default"/>
-<setEntry value="org.eclipse.draw2d:default"/>
-<setEntry value="org.eclipse.egit.mylyn:default"/>
-<setEntry value="org.eclipse.egit.source:default"/>
-<setEntry value="org.eclipse.egit:default"/>
-<setEntry value="org.eclipse.emf.codegen.ecore.ui:default"/>
-<setEntry value="org.eclipse.emf.codegen.ecore:default"/>
-<setEntry value="org.eclipse.emf.codegen.ui:default"/>
-<setEntry value="org.eclipse.emf.codegen:default"/>
-<setEntry value="org.eclipse.emf.common.ui:default"/>
-<setEntry value="org.eclipse.emf.common:default"/>
-<setEntry value="org.eclipse.emf.converter:default"/>
-<setEntry value="org.eclipse.emf.databinding.edit:default"/>
-<setEntry value="org.eclipse.emf.databinding:default"/>
-<setEntry value="org.eclipse.emf.ecore.edit:default"/>
-<setEntry value="org.eclipse.emf.ecore.editor:default"/>
-<setEntry value="org.eclipse.emf.ecore:default"/>
-<setEntry value="org.eclipse.emf.edit.ui:default"/>
-<setEntry value="org.eclipse.emf.edit:default"/>
-<setEntry value="org.eclipse.emf.mapping.ecore.editor:default"/>
-<setEntry value="org.eclipse.emf.mapping.ecore:default"/>
-<setEntry value="org.eclipse.emf.mapping.ui:default"/>
-<setEntry value="org.eclipse.emf.mapping:default"/>
-<setEntry value="org.eclipse.emf:default"/>
-<setEntry value="org.eclipse.epp.mpc:default"/>
-<setEntry value="org.eclipse.epp.package.common.feature:default"/>
-<setEntry value="org.eclipse.epp.package.jee.feature:default"/>
-<setEntry value="org.eclipse.epp.usagedata.feature:default"/>
-<setEntry value="org.eclipse.equinox.p2.discovery.feature:default"/>
-<setEntry value="org.eclipse.equinox.p2.user.ui:default"/>
-<setEntry value="org.eclipse.gef:default"/>
-<setEntry value="org.eclipse.help:default"/>
-<setEntry value="org.eclipse.jdt:default"/>
-<setEntry value="org.eclipse.jgit.source:default"/>
-<setEntry value="org.eclipse.jgit:default"/>
-<setEntry value="org.eclipse.jpt.dbws.eclipselink.feature:default"/>
-<setEntry value="org.eclipse.jpt.jaxb.eclipselink.feature:default"/>
-<setEntry value="org.eclipse.jpt.jaxb.feature:default"/>
-<setEntry value="org.eclipse.jpt.jpa.eclipselink.feature:default"/>
-<setEntry value="org.eclipse.jpt.jpa.feature:default"/>
-<setEntry value="org.eclipse.jsf.feature:default"/>
-<setEntry value="org.eclipse.jst.common.fproj.enablement.jdt:default"/>
-<setEntry value="org.eclipse.jst.enterprise_core.feature:default"/>
-<setEntry value="org.eclipse.jst.enterprise_ui.feature:default"/>
-<setEntry value="org.eclipse.jst.enterprise_userdoc.feature:default"/>
-<setEntry value="org.eclipse.jst.jsf.apache.trinidad.tagsupport.feature:default"/>
-<setEntry value="org.eclipse.jst.server_adapters.ext.feature:default"/>
-<setEntry value="org.eclipse.jst.server_adapters.feature:default"/>
-<setEntry value="org.eclipse.jst.server_core.feature:default"/>
-<setEntry value="org.eclipse.jst.server_ui.feature:default"/>
-<setEntry value="org.eclipse.jst.server_userdoc.feature:default"/>
-<setEntry value="org.eclipse.jst.web_core.feature:default"/>
-<setEntry value="org.eclipse.jst.web_ui.feature:default"/>
-<setEntry value="org.eclipse.jst.web_userdoc.feature:default"/>
-<setEntry value="org.eclipse.jst.webpageeditor.feature:default"/>
-<setEntry value="org.eclipse.jst.ws.axis2tools.feature:default"/>
-<setEntry value="org.eclipse.jst.ws.cxf.feature:default"/>
-<setEntry value="org.eclipse.jst.ws.jaxws.dom.feature:default"/>
-<setEntry value="org.eclipse.jst.ws.jaxws.feature:default"/>
-<setEntry value="org.eclipse.jst.ws.jaxws_userdoc.feature:default"/>
-<setEntry value="org.eclipse.m2e.feature:default"/>
-<setEntry value="org.eclipse.mylyn.bugzilla_feature:default"/>
-<setEntry value="org.eclipse.mylyn.builds:default"/>
-<setEntry value="org.eclipse.mylyn.commons:default"/>
-<setEntry value="org.eclipse.mylyn.context_feature:default"/>
-<setEntry value="org.eclipse.mylyn.gerrit.feature:default"/>
-<setEntry value="org.eclipse.mylyn.hudson:default"/>
-<setEntry value="org.eclipse.mylyn.ide_feature:default"/>
-<setEntry value="org.eclipse.mylyn.java_feature:default"/>
-<setEntry value="org.eclipse.mylyn.jira_feature:default"/>
-<setEntry value="org.eclipse.mylyn.pde_feature:default"/>
-<setEntry value="org.eclipse.mylyn.reviews.feature:default"/>
-<setEntry value="org.eclipse.mylyn.reviews.sdk.feature:default"/>
-<setEntry value="org.eclipse.mylyn.sdk_feature:default"/>
-<setEntry value="org.eclipse.mylyn.team_feature:default"/>
-<setEntry value="org.eclipse.mylyn.test_feature:default"/>
-<setEntry value="org.eclipse.mylyn.trac_feature:default"/>
-<setEntry value="org.eclipse.mylyn.versions:default"/>
-<setEntry value="org.eclipse.mylyn.wikitext.sdk:default"/>
-<setEntry value="org.eclipse.mylyn.wikitext_feature:default"/>
-<setEntry value="org.eclipse.mylyn_feature:default"/>
-<setEntry value="org.eclipse.pde:default"/>
-<setEntry value="org.eclipse.platform:default"/>
-<setEntry value="org.eclipse.rcp:default"/>
-<setEntry value="org.eclipse.rse.core:default"/>
-<setEntry value="org.eclipse.rse.dstore:default"/>
-<setEntry value="org.eclipse.rse.ftp:default"/>
-<setEntry value="org.eclipse.rse.local:default"/>
-<setEntry value="org.eclipse.rse.ssh:default"/>
-<setEntry value="org.eclipse.rse.telnet:default"/>
-<setEntry value="org.eclipse.rse.terminals:default"/>
-<setEntry value="org.eclipse.rse.useractions:default"/>
-<setEntry value="org.eclipse.rse:default"/>
-<setEntry value="org.eclipse.tm.terminal.ssh:default"/>
-<setEntry value="org.eclipse.tm.terminal.telnet:default"/>
-<setEntry value="org.eclipse.tm.terminal.view:default"/>
-<setEntry value="org.eclipse.tm.terminal:default"/>
-<setEntry value="org.eclipse.wst.common.fproj:default"/>
-<setEntry value="org.eclipse.wst.common_core.feature:default"/>
-<setEntry value="org.eclipse.wst.common_ui.feature:default"/>
-<setEntry value="org.eclipse.wst.jsdt.feature:default"/>
-<setEntry value="org.eclipse.wst.server_adapters.feature:default"/>
-<setEntry value="org.eclipse.wst.server_core.feature:default"/>
-<setEntry value="org.eclipse.wst.server_ui.feature:default"/>
-<setEntry value="org.eclipse.wst.server_userdoc.feature:default"/>
-<setEntry value="org.eclipse.wst.web_core.feature:default"/>
-<setEntry value="org.eclipse.wst.web_ui.feature:default"/>
-<setEntry value="org.eclipse.wst.web_userdoc.feature:default"/>
-<setEntry value="org.eclipse.wst.ws_core.feature:default"/>
-<setEntry value="org.eclipse.wst.ws_ui.feature:default"/>
-<setEntry value="org.eclipse.wst.ws_userdoc.feature:default"/>
-<setEntry value="org.eclipse.wst.ws_wsdl15.feature:default"/>
-<setEntry value="org.eclipse.wst.xml.xpath2.processor.feature:default"/>
-<setEntry value="org.eclipse.wst.xml_core.feature:default"/>
-<setEntry value="org.eclipse.wst.xml_ui.feature:default"/>
-<setEntry value="org.eclipse.wst.xml_userdoc.feature:default"/>
-<setEntry value="org.eclipse.wst.xsl.feature:default"/>
-</setAttribute>
-<stringAttribute key="selected_target_plugins" value="com.google.gerrit.common@default:default,com.google.gerrit.prettify@default:default,com.google.gerrit.reviewdb@default:default,com.google.gson@default:default,com.google.gwt.servlet@default:default,com.google.gwtjsonrpc@default:default,com.google.gwtorm@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.sun.syndication@default:default,com.thoughtworks.qdox@default:default,javax.activation@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml.bind@default:default,javax.xml.stream@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.codec@default:default,org.apache.commons.el@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.jasper@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.lucene.highlighter@default:default,org.apache.lucene.memory@default:default,org.apache.lucene.misc@default:default,org.apache.lucene.queries@default:default,org.apache.lucene.snowball@default:default,org.apache.lucene.spellchecker@default:default,org.apache.lucene@default:default,org.apache.ws.commons.util@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.apache.xmlrpc@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.egit.core@default:default,org.eclipse.egit.doc@default:default,org.eclipse.egit.mylyn.ui@default:default,org.eclipse.egit.ui@default:default,org.eclipse.egit@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jgit@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.mylyn.commons.core@default:default,org.eclipse.mylyn.commons.identity.core@default:default,org.eclipse.mylyn.commons.identity@default:default,org.eclipse.mylyn.commons.net@default:default,org.eclipse.mylyn.commons.notifications.core@default:default,org.eclipse.mylyn.commons.notifications.feed@default:default,org.eclipse.mylyn.commons.notifications.ui@default:default,org.eclipse.mylyn.commons.repositories.core@default:default,org.eclipse.mylyn.commons.repositories.ui@default:default,org.eclipse.mylyn.commons.repositories@default:default,org.eclipse.mylyn.commons.screenshots@default:default,org.eclipse.mylyn.commons.sdk.util@default:default,org.eclipse.mylyn.commons.team@default:default,org.eclipse.mylyn.commons.ui@default:default,org.eclipse.mylyn.commons.workbench@default:default,org.eclipse.mylyn.context.core@default:default,org.eclipse.mylyn.context.ui@default:default,org.eclipse.mylyn.discovery.core@default:default,org.eclipse.mylyn.discovery.ui@default:default,org.eclipse.mylyn.monitor.core@default:default,org.eclipse.mylyn.monitor.ui@default:default,org.eclipse.mylyn.resources.ui@default:default,org.eclipse.mylyn.tasks.bugs@default:default,org.eclipse.mylyn.tasks.core@default:default,org.eclipse.mylyn.tasks.search@default:default,org.eclipse.mylyn.tasks.ui@default:default,org.eclipse.mylyn.team.ui@default:default,org.eclipse.mylyn.tests.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.platform@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.team.core@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.net@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.update.configurator@3:true,org.hamcrest.core@default:default,org.hamcrest.generator@default:default,org.hamcrest.integration@default:default,org.hamcrest.library@default:default,org.hamcrest.text@default:default,org.hamcrest@default:default,org.jdom@default:default,org.junit*4.8.2.v4_8_2_v20110321-1705@default:default,org.junit4@default:default,org.mockito@default:default,org.mortbay.jetty.server@default:default,org.mortbay.jetty.util@default:default,org.objectweb.asm@default:default,org.objenesis@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.mylyn.gerrit.core.tests@default:false,org.eclipse.mylyn.gerrit.core@default:default,org.eclipse.mylyn.gerrit.ui.tests@default:false,org.eclipse.mylyn.gerrit.ui@default:default,org.eclipse.mylyn.reviews.core@default:default,org.eclipse.mylyn.reviews.ui@default:default"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
diff --git a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/GerritSynchronizationTest.java b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/GerritSynchronizationTest.java
index 66a28db..8b0900e 100644
--- a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/GerritSynchronizationTest.java
+++ b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/gerrit/tests/core/GerritSynchronizationTest.java
@@ -132,7 +132,8 @@ public class GerritSynchronizationTest extends TestCase {
List<TaskAttribute> comments = taskData.getAttributeMapper().getAttributesByType(taskData,
TaskAttribute.TYPE_COMMENT);
TaskCommentMapper lastComment = TaskCommentMapper.createFrom(comments.get(comments.size() - 1));
- assertEquals("Patch Set 1:\n\n" + message, lastComment.getText()); //$NON-NLS-1$
+ assertEquals(
+ "Failure on " + GerritFixture.current().getRepositoryUrl() + "/" + task.getTaskId(), "Patch Set 1:\n\n" + message, lastComment.getText()); //$NON-NLS-1$
}
private ITask assertTaskListHasOneTask() throws CoreException {
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 6d8989d..52c4127 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
@@ -17,6 +17,7 @@ import org.eclipse.mylyn.internal.gerrit.core.GerritOperationFactory;
import org.eclipse.mylyn.internal.gerrit.core.operations.GerritOperation;
import org.eclipse.mylyn.internal.gerrit.core.operations.SaveDraftRequest;
import org.eclipse.mylyn.reviews.core.model.ILineLocation;
+import org.eclipse.mylyn.reviews.core.model.ILocation;
import org.eclipse.mylyn.reviews.core.model.IReviewItem;
import org.eclipse.mylyn.reviews.core.model.ITopic;
import org.eclipse.mylyn.reviews.ui.ReviewBehavior;
@@ -48,11 +49,19 @@ public class GerritReviewBehavior extends ReviewBehavior {
side = 0;
}
Patch.Key key = Patch.Key.parse(id);
- SaveDraftRequest request = new SaveDraftRequest(key, ((ILineLocation) topic.getLocation()).getTotalMin(), side);
- request.setMessage(topic.getDescription());
+ for (ILocation location : topic.getLocations()) {
+ if (location instanceof ILineLocation) {
+ ILineLocation lineLocation = (ILineLocation) location;
+ SaveDraftRequest request = new SaveDraftRequest(key, lineLocation.getTotalMin(), side);
+ request.setMessage(topic.getDescription());
- GerritOperation<PatchLineComment> operation = getOperationFactory().createSaveDraftOperation(getTask(), request);
- return operation.run(monitor);
+ GerritOperation<PatchLineComment> operation = getOperationFactory().createSaveDraftOperation(getTask(),
+ request);
+ return operation.run(monitor);
+ }
+ }
+ //We'll only get here if there is something really broken in calling code or model. Gerrit has one and only one comment per location.
+ throw new RuntimeException("Internal Exception. No line location for comment. Topic: " + topic.getId());
}
}
diff --git a/org.eclipse.mylyn.reviews.core/model/reviews.ecore b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
index 199b8f4..c2f33e4 100644
--- a/org.eclipse.mylyn.reviews.core/model/reviews.ecore
+++ b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
@@ -56,8 +56,8 @@
<eClassifiers xsi:type="ecore:EClass" name="Topic" eSuperTypes="#//Comment">
<eStructuralFeatures xsi:type="ecore:EReference" name="task" eType="#//TaskReference"
containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="location" eType="#//Location"
- containment="true"/>
+ <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"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="review" lowerBound="1"
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 ccad55f..f666d2b 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
@@ -21,7 +21,7 @@ import java.util.List;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getTask <em>Task</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getLocation <em>Location</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getLocations <em>Locations</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getComments <em>Comments</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getReview <em>Review</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.ITopic#getTitle <em>Title</em>}</li>
@@ -57,28 +57,18 @@ public interface ITopic extends IComment {
void setTask(ITaskReference value);
/**
- * Returns the value of the '<em><b>Location</b></em>' containment reference.
+ * Returns the value of the '<em><b>Locations</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.mylyn.reviews.core.model.ILocation}.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Location</em>' containment reference list isn't clear,
+ * If the meaning of the '<em>Locations</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Location</em>' containment reference.
- * @see #setLocation(ILocation)
+ * @return the value of the '<em>Locations</em>' containment reference list.
* @generated
*/
- ILocation getLocation();
-
- /**
- * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.ITopic#getLocation <em>Location</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Location</em>' containment reference.
- * @see #getLocation()
- * @generated
- */
- void setLocation(ILocation value);
+ List<ILocation> getLocations();
/**
* Returns the value of the '<em><b>Comments</b></em>' reference list.
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 a9faa0c..e1ce7f7 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
@@ -654,13 +654,13 @@ public class ReviewsPackage extends EPackageImpl {
public static final int TOPIC__TASK = COMMENT_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Location</b></em>' containment reference.
+ * The feature id for the '<em><b>Locations</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int TOPIC__LOCATION = COMMENT_FEATURE_COUNT + 1;
+ public static final int TOPIC__LOCATIONS = COMMENT_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Comments</b></em>' reference list.
@@ -1688,15 +1688,15 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.mylyn.reviews.core.model.ITopic#getLocation <em>Location</em>}'.
+ * Returns the meta object for the containment reference list '{@link org.eclipse.mylyn.reviews.core.model.ITopic#getLocations <em>Locations</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Location</em>'.
- * @see org.eclipse.mylyn.reviews.core.model.ITopic#getLocation()
+ * @return the meta object for the containment reference list '<em>Locations</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.ITopic#getLocations()
* @see #getTopic()
* @generated
*/
- public EReference getTopic_Location() {
+ public EReference getTopic_Locations() {
return (EReference) topicEClass.getEStructuralFeatures().get(1);
}
@@ -2043,7 +2043,7 @@ public class ReviewsPackage extends EPackageImpl {
topicEClass = createEClass(TOPIC);
createEReference(topicEClass, TOPIC__TASK);
- createEReference(topicEClass, TOPIC__LOCATION);
+ createEReference(topicEClass, TOPIC__LOCATIONS);
createEReference(topicEClass, TOPIC__COMMENTS);
createEReference(topicEClass, TOPIC__REVIEW);
createEAttribute(topicEClass, TOPIC__TITLE);
@@ -2257,10 +2257,10 @@ public class ReviewsPackage extends EPackageImpl {
null,
"task", 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_Location(),
+ getTopic_Locations(),
this.getLocation(),
null,
- "location", 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$
+ "locations", 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_Comments(),
this.getComment(),
@@ -2691,12 +2691,12 @@ public class ReviewsPackage extends EPackageImpl {
public static final EReference TOPIC__TASK = eINSTANCE.getTopic_Task();
/**
- * The meta object literal for the '<em><b>Location</b></em>' containment reference feature.
+ * The meta object literal for the '<em><b>Locations</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EReference TOPIC__LOCATION = eINSTANCE.getTopic_Location();
+ public static final EReference TOPIC__LOCATIONS = eINSTANCE.getTopic_Locations();
/**
* The meta object literal for the '<em><b>Comments</b></em>' reference list feature.
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 534a04b..9715d89 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
@@ -43,7 +43,7 @@ import org.eclipse.mylyn.reviews.core.model.ITopic;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getTask <em>Task</em>}</li>
- * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getLocation <em>Location</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getLocations <em>Locations</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getComments <em>Comments</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getReview <em>Review</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.Topic#getTitle <em>Title</em>}</li>
@@ -65,14 +65,14 @@ public class Topic extends Comment implements ITopic {
protected ITaskReference task;
/**
- * The cached value of the '{@link #getLocation() <em>Location</em>}' containment reference.
+ * The cached value of the '{@link #getLocations() <em>Locations</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getLocation()
+ * @see #getLocations()
* @generated
* @ordered
*/
- protected ILocation location;
+ protected EList<ILocation> locations;
/**
* The cached value of the '{@link #getComments() <em>Comments</em>}' reference list.
@@ -197,49 +197,11 @@ public class Topic extends Comment implements ITopic {
* <!-- end-user-doc -->
* @generated
*/
- public ILocation getLocation() {
- return location;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetLocation(ILocation newLocation, NotificationChain msgs) {
- ILocation oldLocation = location;
- location = newLocation;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ReviewsPackage.TOPIC__LOCATION, oldLocation, newLocation);
- if (msgs == null)
- msgs = notification;
- else
- msgs.add(notification);
+ public List<ILocation> getLocations() {
+ if (locations == null) {
+ locations = new EObjectContainmentEList<ILocation>(ILocation.class, this, ReviewsPackage.TOPIC__LOCATIONS);
}
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setLocation(ILocation newLocation) {
- if (newLocation != location) {
- NotificationChain msgs = null;
- if (location != null)
- msgs = ((InternalEObject) location).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ReviewsPackage.TOPIC__LOCATION, null, msgs);
- if (newLocation != null)
- msgs = ((InternalEObject) newLocation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ReviewsPackage.TOPIC__LOCATION, null, msgs);
- msgs = basicSetLocation(newLocation, msgs);
- if (msgs != null)
- msgs.dispatch();
- } else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.TOPIC__LOCATION, newLocation,
- newLocation));
+ return locations;
}
/**
@@ -407,8 +369,8 @@ public class Topic extends Comment implements ITopic {
switch (featureID) {
case ReviewsPackage.TOPIC__TASK:
return basicSetTask(null, msgs);
- case ReviewsPackage.TOPIC__LOCATION:
- return basicSetLocation(null, msgs);
+ case ReviewsPackage.TOPIC__LOCATIONS:
+ return ((InternalEList<?>) getLocations()).basicRemove(otherEnd, msgs);
case ReviewsPackage.TOPIC__ITEM:
return basicSetItem(null, msgs);
}
@@ -425,8 +387,8 @@ public class Topic extends Comment implements ITopic {
switch (featureID) {
case ReviewsPackage.TOPIC__TASK:
return getTask();
- case ReviewsPackage.TOPIC__LOCATION:
- return getLocation();
+ case ReviewsPackage.TOPIC__LOCATIONS:
+ return getLocations();
case ReviewsPackage.TOPIC__COMMENTS:
return getComments();
case ReviewsPackage.TOPIC__REVIEW:
@@ -455,8 +417,9 @@ public class Topic extends Comment implements ITopic {
case ReviewsPackage.TOPIC__TASK:
setTask((ITaskReference) newValue);
return;
- case ReviewsPackage.TOPIC__LOCATION:
- setLocation((ILocation) newValue);
+ case ReviewsPackage.TOPIC__LOCATIONS:
+ getLocations().clear();
+ getLocations().addAll((Collection<? extends ILocation>) newValue);
return;
case ReviewsPackage.TOPIC__COMMENTS:
getComments().clear();
@@ -486,8 +449,8 @@ public class Topic extends Comment implements ITopic {
case ReviewsPackage.TOPIC__TASK:
setTask((ITaskReference) null);
return;
- case ReviewsPackage.TOPIC__LOCATION:
- setLocation((ILocation) null);
+ case ReviewsPackage.TOPIC__LOCATIONS:
+ getLocations().clear();
return;
case ReviewsPackage.TOPIC__COMMENTS:
getComments().clear();
@@ -515,8 +478,8 @@ public class Topic extends Comment implements ITopic {
switch (featureID) {
case ReviewsPackage.TOPIC__TASK:
return task != null;
- case ReviewsPackage.TOPIC__LOCATION:
- return location != null;
+ case ReviewsPackage.TOPIC__LOCATIONS:
+ return locations != null && !locations.isEmpty();
case ReviewsPackage.TOPIC__COMMENTS:
return comments != null && !comments.isEmpty();
case ReviewsPackage.TOPIC__REVIEW:
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 28db0c8..aff5484 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
@@ -36,7 +36,7 @@ import org.eclipse.jface.text.source.IAnnotationModelListenerExtension;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.reviews.ui.ReviewsUiPlugin;
import org.eclipse.mylyn.reviews.core.model.ILineLocation;
-import org.eclipse.mylyn.reviews.core.model.ILineRange;
+import org.eclipse.mylyn.reviews.core.model.ILocation;
import org.eclipse.mylyn.reviews.core.model.IReviewItem;
import org.eclipse.mylyn.reviews.core.model.ITopic;
import org.eclipse.mylyn.reviews.ui.ReviewBehavior;
@@ -76,7 +76,7 @@ public class ReviewAnnotationModel implements IAnnotationModel {
if (notification.getEventType() == Notification.ADD) {
AnnotationModelEvent event = new AnnotationModelEvent(ReviewAnnotationModel.this);
if (notification.getNewValue() instanceof ITopic) {
- createCommentAnnotation(document, event, (ITopic) notification.getNewValue());
+ createCommentAnnotations(document, event, (ITopic) notification.getNewValue());
}
fireModelChanged(event);
}
@@ -202,34 +202,36 @@ public class ReviewAnnotationModel implements IAnnotationModel {
}
}
- private void createCommentAnnotation(IDocument document, AnnotationModelEvent event, ITopic comment) {
- try {
-
- int startLine = 0;
- int endLine = 0;
-
- ILineLocation location = (ILineLocation) comment.getLocation();
- final List<ILineRange> lineRanges = location.getRanges();
- startLine = location.getTotalMin();
- endLine = location.getTotalMax();
-
- int offset = 0;
- int length = 0;
- if (startLine != 0) {
- offset = document.getLineOffset(startLine - 1);
- if (endLine == 0) {
- endLine = startLine;
+ private void createCommentAnnotations(IDocument document, AnnotationModelEvent event, ITopic topic) {
+ int startLine = 0;
+ int endLine = 0;
+ //TODO We need to ensure that this works properly with cases where 0 or many locations exist.
+ for (ILocation location : topic.getLocations()) {
+ if (location instanceof ILineLocation) {
+ ILineLocation lineLocation = (ILineLocation) location;
+ try {
+ startLine = lineLocation.getTotalMin();
+ endLine = lineLocation.getTotalMax();
+
+ int offset = 0;
+ int length = 0;
+ if (startLine != 0) {
+ offset = document.getLineOffset(startLine - 1);
+ if (endLine == 0) {
+ endLine = startLine;
+ }
+ length = Math.max(document.getLineOffset(endLine - 1) - offset, 0);
+
+ }
+ length = Math.max(1, length);
+ CommentAnnotation ca = new CommentAnnotation(offset, length, topic);
+ annotations.add(ca);
+ event.annotationAdded(ca);
+ } catch (BadLocationException e) {
+ StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Unable to add annotation.",
+ e));
}
- length = Math.max(document.getLineOffset(endLine - 1) - offset, 0);
-
}
- length = Math.max(1, length);
- CommentAnnotation ca = new CommentAnnotation(offset, length, comment);
- annotations.add(ca);
- event.annotationAdded(ca);
-
- } catch (BadLocationException e) {
- StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Unable to add annotation.", e));
}
}
@@ -265,7 +267,7 @@ public class ReviewAnnotationModel implements IAnnotationModel {
if (document != null && reviewItem != null) {
for (ITopic comment : reviewItem.getTopics()) {
- createCommentAnnotation(document, event, comment);
+ createCommentAnnotations(document, event, comment);
}
}
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 7f60b87..2ec7701 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
@@ -96,12 +96,19 @@ class ReviewCompareInputListener implements ITextInputListener, IReviewCompareSo
int startLine;
int endLine;
ITopic comment = annotation.getTopic();
- startLine = ((ILineLocation) comment.getLocation()).getTotalMin();
- endLine = ((ILineLocation) comment.getLocation()).getTotalMax();
- if (lineNr >= startLine && lineNr <= endLine) {
- AnnotationPreference pref = new AnnotationPreferenceLookup().getAnnotationPreference(annotation);
- if (pref.getHighlightPreferenceValue()) {
- event.lineBackground = colorCommented;
+ //TODO This code assumes that we have one comment per annotation. That won't work for r4E.
+ if (comment.getLocations().size() == 1) {
+ ILocation location = comment.getLocations().get(0);
+ if (location instanceof ILineLocation) {
+ ILineLocation lineLocation = (ILineLocation) location;
+ startLine = lineLocation.getTotalMin();
+ endLine = lineLocation.getTotalMax();
+ if (lineNr >= startLine && lineNr <= endLine) {
+ AnnotationPreference pref = new AnnotationPreferenceLookup().getAnnotationPreference(annotation);
+ if (pref.getHighlightPreferenceValue()) {
+ event.lineBackground = colorCommented;
+ }
+ }
}
}
}
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
index 0e75b82..e73a9b7 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
@@ -97,7 +97,7 @@ public class AddCommentDialog extends ProgressDialog {
user.setDisplayName("Me");
topic.setAuthor(user);
topic.setDescription(commentEditor.getText());
- topic.setLocation(getLocation());
+ topic.getLocations().add(getLocation());
topic.setItem(item);
IComment comment = ReviewsFactory.eINSTANCE.createComment();