Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-29 19:21:31 +0000
committerAndre Weinand2002-01-29 19:21:31 +0000
commit399203b7cf63434f805a6654dc5054154e24a1b5 (patch)
treef3eb0f79745cf7b25575e61751995526c1ba5236 /bundles/org.eclipse.compare/compare/org/eclipse/compare
parentae0d94e1c2031114fcc3b27cf7876ca9755287f5 (diff)
downloadeclipse.platform.team-399203b7cf63434f805a6654dc5054154e24a1b5.tar.gz
eclipse.platform.team-399203b7cf63434f805a6654dc5054154e24a1b5.tar.xz
eclipse.platform.team-399203b7cf63434f805a6654dc5054154e24a1b5.zip
linked structured compare to content compare in 'Compare from Local History'
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
index 6eeda5d56..91233056d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -682,6 +682,13 @@ public class EditionSelectionDialog extends Dialog {
return null;
}
};
+ fStructuredComparePane.addSelectionChangedListener(
+ new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent e) {
+ feedInput2(e.getSelection());
+ }
+ }
+ );
} else {
// only a single pane showing the editions
fEditionPane= new CompareViewerPane(vsplitter, SWT.BORDER | SWT.FLAT);
@@ -1019,4 +1026,15 @@ public class EditionSelectionDialog extends Dialog {
if (fCommitButton != null)
fCommitButton.setEnabled(isOK && fSelectedItem != null && fTargetPair.getItem() != fSelectedItem);
}
+
+ /*
+ * Feeds selection from structure viewer to content viewer.
+ */
+ private void feedInput2(ISelection sel) {
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection ss= (IStructuredSelection) sel;
+ if (ss.size() == 1)
+ fContentPane.setInput(ss.getFirstElement());
+ }
+ }
}

Back to the top