Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-11 09:07:33 -0500
committerAndre Weinand2002-01-11 09:07:33 -0500
commitebacdd860f9794d7e0478bf8e9d68279016e9c62 (patch)
tree500c56e616fe52d93031aff346447db4ca6823e3 /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parent06ccfeb2a1e12c1cf9b207876309760adf731f4c (diff)
downloadeclipse.platform.team-ebacdd860f9794d7e0478bf8e9d68279016e9c62.tar.gz
eclipse.platform.team-ebacdd860f9794d7e0478bf8e9d68279016e9c62.tar.xz
eclipse.platform.team-ebacdd860f9794d7e0478bf8e9d68279016e9c62.zip
fixed some scrolling/revealing problems
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.java25
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java5
3 files changed, 24 insertions, 16 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 c1cf1ee7b..7b9ff335d 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
@@ -179,29 +179,32 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
*/
public String getName() {
- String s1= null;
+ String right= null;
if (fRight != null)
- s1= fRight.getName();
+ right= fRight.getName();
- String s2= null;
+ String left= null;
if (fLeft != null)
- s2= fLeft.getName();
+ left= fLeft.getName();
- if (s1 == null && s2 == null) {
+ if (right == null && left == null) {
if (fAncestor != null)
return fAncestor.getName();
return Utilities.getString("DiffNode.noName"); //$NON-NLS-1$
}
- if (s1 == null)
- return s2;
- if (s2 == null)
- return s1;
+ if (right == null)
+ return left;
+ if (left == null)
+ return right;
- if (s1.equals(s2))
- return s1;
+ if (right.equals(left))
+ return right;
String fmt= Utilities.getString("DiffNode.nameFormat"); //$NON-NLS-1$
+
+ String s1= right;
+ String s2= left;
return MessageFormat.format(fmt, new String[] { s1, s2 });
}
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 dbec525ba..1e3b22f7a 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
@@ -85,12 +85,17 @@ public class DiffTreeViewer extends TreeViewer {
return getChildren(element);
}
}
-
+
+ /*
+ * Takes care of swapping left and right if fLeftIsLocal
+ * is true.
+ */
class DiffViewerLabelProvider extends LabelProvider {
public String getText(Object element) {
- if (element instanceof IDiffElement)
+ if (element instanceof IDiffElement) {
return ((IDiffElement)element).getName();
+ }
return Utilities.getString(fBundle, "defaultLabel"); //$NON-NLS-1$
}
@@ -176,7 +181,6 @@ public class DiffTreeViewer extends TreeViewer {
fLeftIsLocal= Utilities.getBoolean(configuration, "LEFT_IS_LOCAL", false); //$NON-NLS-1$
-
tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());
Composite parent= tree.getParent();
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 d24276f0c..686489815 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
@@ -346,8 +346,9 @@ public class StructureDiffViewer extends DiffTreeViewer {
super.copySelected(leftToRight);
if (fStructureCreator != null)
- fStructureCreator.save(leftToRight ? fRightStructure : fLeftStructure,
- leftToRight ? fRightInput : fLeftInput);
+ fStructureCreator.save(
+ leftToRight ? fRightStructure : fLeftStructure,
+ leftToRight ? fRightInput : fLeftInput);
}
}

Back to the top