Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-11 13:11:58 -0500
committerAndre Weinand2002-01-11 13:11:58 -0500
commit56cd0f822a2a02df5d630699837e1c267254ccef (patch)
treecb5cd0e9de4f27de4b80368d774aaf8b28e08334 /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parentb90378cabccfb8e770923cb6fc372f4e66163f53 (diff)
downloadeclipse.platform.team-56cd0f822a2a02df5d630699837e1c267254ccef.tar.gz
eclipse.platform.team-56cd0f822a2a02df5d630699837e1c267254ccef.tar.xz
eclipse.platform.team-56cd0f822a2a02df5d630699837e1c267254ccef.zip
optionally flipping sides in DiffNode.getName
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.java19
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java8
2 files changed, 21 insertions, 6 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 7b9ff335d..d5b322afd 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
@@ -178,7 +178,10 @@ 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();
@@ -201,10 +204,18 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
if (right.equals(left))
return right;
- String fmt= Utilities.getString("DiffNode.nameFormat"); //$NON-NLS-1$
+ String s1;
+ String s2;
- String s1= right;
- String s2= left;
+ if (swap) {
+ s1= left;
+ s2= right;
+ } else {
+ s1= right;
+ s2= left;
+ }
+
+ String fmt= Utilities.getString("DiffNode.nameFormat"); //$NON-NLS-1$
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 1e3b22f7a..cf545282a 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
@@ -93,9 +93,13 @@ public class DiffTreeViewer extends TreeViewer {
class DiffViewerLabelProvider extends LabelProvider {
public String getText(Object element) {
- if (element instanceof IDiffElement) {
+
+ if (element instanceof DiffNode)
+ return ((DiffNode)element).internalGetName(fLeftIsLocal);
+
+ if (element instanceof IDiffElement)
return ((IDiffElement)element).getName();
- }
+
return Utilities.getString(fBundle, "defaultLabel"); //$NON-NLS-1$
}

Back to the top