Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-21 11:19:29 -0500
committerAndre Weinand2002-01-21 11:19:29 -0500
commitf8b6ac0ee3f0e7464a704483bfc2281fa5c2fd93 (patch)
treecee1e8b6ae201e34bde23da734d461f2f0e62278 /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parentd9c58e49edc86dceb03b1fd165131aede72b8751 (diff)
downloadeclipse.platform.team-f8b6ac0ee3f0e7464a704483bfc2281fa5c2fd93.tar.gz
eclipse.platform.team-f8b6ac0ee3f0e7464a704483bfc2281fa5c2fd93.tar.xz
eclipse.platform.team-f8b6ac0ee3f0e7464a704483bfc2281fa5c2fd93.zip
#7821: Team 2.0 CVS synchronze bug <no-name> dirs..
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java13
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java6
3 files changed, 14 insertions, 10 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
index d5b322afd..75c91bbe5 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
@@ -35,6 +35,7 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
private ITypedElement fRight;
private boolean fDontExpand;
private ListenerList fListener;
+ private boolean fSwapSides;
/**
@@ -178,10 +179,6 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
* see ITypedElement.getName
*/
public String getName() {
- return internalGetName(false);
- }
-
- String internalGetName(boolean swap) {
String right= null;
if (fRight != null)
right= fRight.getName();
@@ -207,7 +204,7 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
String s1;
String s2;
- if (swap) {
+ if (fSwapSides) {
s1= left;
s2= right;
} else {
@@ -218,7 +215,11 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
String fmt= Utilities.getString("DiffNode.nameFormat"); //$NON-NLS-1$
return MessageFormat.format(fmt, new String[] { s1, s2 });
}
-
+
+ void swapSides(boolean swap) {
+ fSwapSides= swap;
+ }
+
/* (non Javadoc)
* see ITypedElement.getImage
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index cf545282a..6b0405b15 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -94,9 +94,6 @@ public class DiffTreeViewer extends TreeViewer {
public String getText(Object element) {
- if (element instanceof DiffNode)
- return ((DiffNode)element).internalGetName(fLeftIsLocal);
-
if (element instanceof IDiffElement)
return ((IDiffElement)element).getName();
@@ -138,7 +135,7 @@ public class DiffTreeViewer extends TreeViewer {
private ResourceBundle fBundle;
private CompareConfiguration fCompareConfiguration;
- private boolean fLeftIsLocal;
+ /* package */ boolean fLeftIsLocal;
private ViewerFilter fViewerFilter;
private IPropertyChangeListener fPropertyChangeListener;
private IPropertyChangeListener fPreferenceChangeListener;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index 686489815..5aec6901a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -277,6 +277,12 @@ public class StructureDiffViewer extends DiffTreeViewer {
protected boolean contentsEqual(Object o1, Object o2) {
return StructureDiffViewer.this.contentsEqual(o1, o2);
}
+ protected Object visit(Object data, int result, Object ancestor, Object left, Object right) {
+ Object o= super.visit(data, result, ancestor, left, right);
+ if (fLeftIsLocal && o instanceof DiffNode)
+ ((DiffNode)o).swapSides(fLeftIsLocal);
+ return o;
+ }
};
fRoot= (IDiffContainer) fDifferencer.findDifferences(fThreeWay, null, null,

Back to the top