Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-02-29 22:55:43 +0000
committerAndre Weinand2004-02-29 22:55:43 +0000
commita166977aaffd14f6661b328025c8b43abae36b84 (patch)
treeb375405387327cabf09c1df692c1b493210584c3
parenta8fa788c220f49314ce3c011839d3ca861e6e596 (diff)
downloadeclipse.platform.team-a166977aaffd14f6661b328025c8b43abae36b84.tar.gz
eclipse.platform.team-a166977aaffd14f6661b328025c8b43abae36b84.tar.xz
eclipse.platform.team-a166977aaffd14f6661b328025c8b43abae36b84.zip
fixed #42731
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java20
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html9
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java20
4 files changed, 58 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index d36a9bba8..9206def21 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -11,6 +11,15 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input March 2th 2004
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=42731">#42731</a>: Synchronize horizontal scrolling in compare editor<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2278">#2278</a>: DCR: Would like coupled horizontal scrolling in compare browser (1GEJNHO)<br>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input February 17th 2004
<h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 92cbf4f08..c8b26cca0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -995,6 +995,9 @@ public class TextMergeViewer extends ContentMergeViewer {
fRight.getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);
fRight.addAction(MergeSourceViewer.SAVE_ID, fRightSaveAction);
+ hsynchViewport(fLeft, fRight);
+ hsynchViewport(fRight, fLeft);
+
if (fMarginWidth > 0) {
fRightCanvas= new BufferedCanvas(composite, SWT.NONE) {
public void doPaint(GC gc) {
@@ -1059,6 +1062,23 @@ public class TextMergeViewer extends ContentMergeViewer {
);
}
+ private void hsynchViewport(final TextViewer tv1, final TextViewer tv2) {
+ final StyledText st1= tv1.getTextWidget();
+ final StyledText st2= tv2.getTextWidget();
+ final ScrollBar sb1= st1.getHorizontalBar();
+ final ScrollBar sb2= st2.getHorizontalBar();
+ sb1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ int max= sb1.getMaximum()-sb1.getThumb();
+ double v= 0.0;
+ if (max > 0)
+ v= (float)sb1.getSelection() / (float)max;
+ max= sb2.getMaximum()-sb2.getThumb();
+ st2.setHorizontalPixel((int)(max * v));
+ }
+ });
+ }
+
private void setCurrentDiff2(Diff diff, boolean reveal) {
if (diff != null && diff.fDirection != Differencer.NO_CHANGE) {
//fCurrentDiff= null;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index d36a9bba8..9206def21 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -11,6 +11,15 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input March 2th 2004
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=42731">#42731</a>: Synchronize horizontal scrolling in compare editor<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2278">#2278</a>: DCR: Would like coupled horizontal scrolling in compare browser (1GEJNHO)<br>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input February 17th 2004
<h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 92cbf4f08..c8b26cca0 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -995,6 +995,9 @@ public class TextMergeViewer extends ContentMergeViewer {
fRight.getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);
fRight.addAction(MergeSourceViewer.SAVE_ID, fRightSaveAction);
+ hsynchViewport(fLeft, fRight);
+ hsynchViewport(fRight, fLeft);
+
if (fMarginWidth > 0) {
fRightCanvas= new BufferedCanvas(composite, SWT.NONE) {
public void doPaint(GC gc) {
@@ -1059,6 +1062,23 @@ public class TextMergeViewer extends ContentMergeViewer {
);
}
+ private void hsynchViewport(final TextViewer tv1, final TextViewer tv2) {
+ final StyledText st1= tv1.getTextWidget();
+ final StyledText st2= tv2.getTextWidget();
+ final ScrollBar sb1= st1.getHorizontalBar();
+ final ScrollBar sb2= st2.getHorizontalBar();
+ sb1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ int max= sb1.getMaximum()-sb1.getThumb();
+ double v= 0.0;
+ if (max > 0)
+ v= (float)sb1.getSelection() / (float)max;
+ max= sb2.getMaximum()-sb2.getThumb();
+ st2.setHorizontalPixel((int)(max * v));
+ }
+ });
+ }
+
private void setCurrentDiff2(Diff diff, boolean reveal) {
if (diff != null && diff.fDirection != Differencer.NO_CHANGE) {
//fCurrentDiff= null;

Back to the top