Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.compare/plugins')
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java43
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java12
4 files changed, 56 insertions, 12 deletions
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 7bd7f7f25..a2bb5b142 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
@@ -35,6 +35,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=14680">#14680</a>: Compare unreadable in high contrast black<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=14952">#14952</a>: Diff Browser Opens Too Small / Not Easily Resizable<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=14742">#14742</a>: Ignore whitespace preference<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=14624">#14624</a>: No visual cue when compared file wraps<br>
<h2>
Problem reports closed</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 6d9b1b0c2..896715c95 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
@@ -160,9 +160,6 @@ public class TextMergeViewer extends ContentMergeViewer {
private static final boolean USE_MORE_CONTROLS= true;
/** Selects between smartTokenDiff and mergingTokenDiff */
private static final boolean USE_MERGING_TOKEN_DIFF= false;
- /** if DEAD_STEP is true navigation with the next/previous buttons needs an extra step
- when wrapping around the beginning or end */
- private static final boolean DEAD_STEP= false;
/** When calculating differences show Progress after this timeout (in milliseconds) */
private static final int TIMEOUT= 2000;
@@ -173,7 +170,7 @@ public class TextMergeViewer extends ContentMergeViewer {
private int fMarginWidth= MARGIN_WIDTH;
private int fTopInset;
- // Colors to use
+ // Colors
private boolean fUseSystemBackground;
@@ -193,6 +190,7 @@ public class TextMergeViewer extends ContentMergeViewer {
private RGB OUTGOING_FILL;
+ private boolean fEndOfDocReached;
private IDocumentListener fDocumentListener;
private IPreferenceStore fPreferenceStore;
@@ -2908,13 +2906,14 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
- if (diff == null) {
+ if (diff == null) { // at end or beginning
if (wrap) {
- Control c= getControl();
- if (Utilities.okToUse(c))
- c.getDisplay().beep();
- if (DEAD_STEP)
- return true;
+ if (!fEndOfDocReached) {
+ fEndOfDocReached= true;
+ if (! endOfDocumentReached(down))
+ return true;
+ }
+ fEndOfDocReached= false;
if (fChangeDiffs != null && fChangeDiffs.size() > 0) {
if (down)
diff= (Diff) fChangeDiffs.get(0);
@@ -2935,8 +2934,28 @@ public class TextMergeViewer extends ContentMergeViewer {
}
return false;
- }
-
+ }
+
+ private boolean endOfDocumentReached(boolean down) {
+ Control c= getControl();
+ if (Utilities.okToUse(c)) {
+
+ c.getDisplay().beep();
+
+ String title;
+ String message;
+ if (down) {
+ title= CompareMessages.getString("TextMergeViewer.atEnd.title"); //$NON-NLS-1$
+ message= CompareMessages.getString("TextMergeViewer.atEnd.message"); //$NON-NLS-1$
+ } else {
+ title= CompareMessages.getString("TextMergeViewer.atBeginning.title"); //$NON-NLS-1$
+ message= CompareMessages.getString("TextMergeViewer.atBeginning.message"); //$NON-NLS-1$
+ }
+ return MessageDialog.openQuestion(c.getShell(), title, message);
+ }
+ return false;
+ }
+
/**
* Find the Diff that overlaps with the given TextPart's text range.
* If the range doesn't overlap with any range <code>null</code>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
index 7302d5e9e..157d076bc 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
@@ -38,3 +38,15 @@ TextMergeViewer.diffType.format= {0} {1}
TextMergeViewer.diffDescription.noDiff.format= no diff
TextMergeViewer.diffDescription.diff.format= {0} #{1} (Left: {2}, Right: {3})
TextMergeViewer.statusLine.format= Left: {0}, Right: {1}, {2}
+
+TextMergeViewer.atEnd.title= Goto Next Change
+TextMergeViewer.atEnd.message= End of Document reached. Continue at Beginning?
+
+TextMergeViewer.atBeginning.title= Goto Previous Change
+TextMergeViewer.atBeginning.message= Beginning of Document reached. Continue at End?
+
+CompareNavigator.atEnd.title= Goto Next Change
+CompareNavigator.atEnd.message= Last Resource reached.
+
+CompareNavigator.atBeginning.title= Goto Previous Change
+CompareNavigator.atBeginning.message= First Resource reached.
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
index 16df01c8e..a977359e3 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
@@ -11,6 +11,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.*;
@@ -60,6 +61,17 @@ public class CompareNavigator {
Display display= c.getDisplay();
if (display != null)
display.beep();
+
+ String title;
+ String message;
+ if (next) {
+ title= CompareMessages.getString("CompareNavigator.atEnd.title"); //$NON-NLS-1$
+ message= CompareMessages.getString("CompareNavigator.atEnd.message"); //$NON-NLS-1$
+ } else {
+ title= CompareMessages.getString("CompareNavigator.atBeginning.title"); //$NON-NLS-1$
+ message= CompareMessages.getString("CompareNavigator.atBeginning.message"); //$NON-NLS-1$
+ }
+ MessageDialog.openInformation(c.getShell(), title, message);
}
}
}

Back to the top