Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Cartaud2016-10-14 10:37:08 -0400
committerMathieu Cartaud2016-10-17 10:40:32 -0400
commit437f8b87681504931f33a4952283625215266ccb (patch)
treefd39e2b38b60ed067ee923ecf0fe948073e5d7ef
parent79a106f3eb0ed4dd7cd00c2cefa5cbf59104fde8 (diff)
downloadorg.eclipse.emf.compare-437f8b87681504931f33a4952283625215266ccb.tar.gz
org.eclipse.emf.compare-437f8b87681504931f33a4952283625215266ccb.tar.xz
org.eclipse.emf.compare-437f8b87681504931f33a4952283625215266ccb.zip
[505986] Fix decorator on conflicting refined diffs
Refined diffs that are not in a conflict but have at least one of their refining diffs (recursively) in a real conflict should have the conflicting decorator. They should have the pseudo conflict decorator if all their atomic refining diffs are in pseudo-conflict. Bug: 505986 Change-Id: I6957e28f05d98ae9c327c0f65fbd5dc29a24d8ec Signed-off-by: Mathieu Cartaud <mathieu.cartaud@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
index d0e5845ea..05eca924a 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 Obeo.
+ * Copyright (c) 2012, 2016 Obeo.
* 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
@@ -11,6 +11,9 @@
package org.eclipse.emf.compare.provider.spec;
import static com.google.common.collect.Lists.newArrayList;
+import static org.eclipse.emf.compare.ConflictKind.REAL;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.canBeConsideredAsPseudoConflicting;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.hasDirectOrIndirectConflict;
import java.util.Collection;
import java.util.List;
@@ -18,8 +21,6 @@ import java.util.List;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Conflict;
-import org.eclipse.emf.compare.ConflictKind;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
@@ -168,18 +169,24 @@ public class OverlayImageProvider {
// Nothing here has to be externalized
@SuppressWarnings("nls")
private String getThreeWayOverlay(final Diff diff) {
- final Conflict conflict = diff.getConflict();
final DifferenceKind diffKind = diff.getKind();
final DifferenceSource source = diff.getSource();
+
String path = "";
- if (conflict != null) {
- if (conflict.getKind() == ConflictKind.PSEUDO) {
- path += "p";
- }
+ if (hasDirectOrIndirectConflict(REAL).apply(diff)) {
+ // The diff or one of its refining diffs are in a pseudo conflict
path += "conf";
if (source == DifferenceSource.RIGHT) {
path += "r_";
}
+ } else if (canBeConsideredAsPseudoConflicting().apply(diff)) {
+ // If the diff is not a refined diff and are in a pseudo conflict
+ // Or if the diff is a refined diff that are not in a direct pseudo conflict, but all its refining
+ // diffs are in pseudo conflicts
+ path += "pconf";
+ if (source == DifferenceSource.RIGHT) {
+ path += "r_";
+ }
} else {
switch (source) {
case LEFT:

Back to the top