Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java17
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java17
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties4
8 files changed, 48 insertions, 18 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index efd6e3352..1f25f0901 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -88,6 +88,11 @@ import org.eclipse.compare.structuremergeviewer.*;
*/
public abstract class CompareEditorInput implements IEditorInput, IPropertyChangeNotifier, IRunnableWithProgress {
+ /**
+ * Work in progres !!
+ * SHOW_STRUCTURE is not public API.
+ */
+ public static final boolean SHOW_STRUCTURE= false;
/**
* The name of the "dirty" property.
@@ -616,6 +621,11 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) {
Viewer v= CompareUIPlugin.findContentViewer(oldViewer, input, parent, fCompareConfiguration);
+ if (SHOW_STRUCTURE) {
+ if (oldViewer != null && v != null && oldViewer.getClass() == v.getClass())
+ v= oldViewer;
+ }
+
if (v instanceof IPropertyChangeNotifier) {
final IPropertyChangeNotifier dsp= (IPropertyChangeNotifier) v;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index 42717db56..b5ab58a43 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -88,8 +88,11 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
*/
private void setViewer(Viewer newViewer) {
- if (newViewer == fViewer)
+ if (newViewer == fViewer) {
+ if (CompareEditorInput.SHOW_STRUCTURE)
+ System.out.println("Same viewer: " + fViewer.getClass().getName());
return;
+ }
boolean oldEmpty= isEmpty();
@@ -207,11 +210,13 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
boolean hadFocus= hasFocus2();
- try {
- if (fViewer != null)
- fViewer.setInput(null); // force save before switching viewer
- } catch (ViewerSwitchingCancelled ex) {
- return;
+ if (! CompareEditorInput.SHOW_STRUCTURE) {
+ try {
+ if (fViewer != null)
+ fViewer.setInput(null); // force save before switching viewer
+ } catch (ViewerSwitchingCancelled ex) {
+ return;
+ }
}
fInput= input;
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 13f45c50c..50aaf9b71 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
@@ -2208,7 +2208,7 @@ public class TextMergeViewer extends ContentMergeViewer {
c.getDisplay().beep();
if (DEAD_STEP)
return true;
- if (fChangeDiffs.size() > 0) {
+ if (fChangeDiffs != null && fChangeDiffs.size() > 0) {
if (down)
diff= (Diff) fChangeDiffs.get(0);
else
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
index 18da49fb6..9cabb43db 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
@@ -21,11 +21,11 @@ tooComplexError.format= Too many differences. Try to turn on the ''Ignore White
#####################################################
action.CopyLeftToRight.label=Copy Left to Right
-action.CopyLeftToRight.tooltip=Copy Whole Document from Left to Right
+action.CopyLeftToRight.tooltip=Copy All from Left to Right
action.CopyLeftToRight.image=copy_r_co.gif
action.CopyRightToLeft.label=Copy Right to Left
-action.CopyRightToLeft.tooltip=Copy Whole Document from Right to Left
+action.CopyRightToLeft.tooltip=Copy All from Right to Left
action.CopyRightToLeft.image=copy_l_co.gif
action.CopyDiffLeftToRight.label=Copy Current Diff
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index efd6e3352..1f25f0901 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -88,6 +88,11 @@ import org.eclipse.compare.structuremergeviewer.*;
*/
public abstract class CompareEditorInput implements IEditorInput, IPropertyChangeNotifier, IRunnableWithProgress {
+ /**
+ * Work in progres !!
+ * SHOW_STRUCTURE is not public API.
+ */
+ public static final boolean SHOW_STRUCTURE= false;
/**
* The name of the "dirty" property.
@@ -616,6 +621,11 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) {
Viewer v= CompareUIPlugin.findContentViewer(oldViewer, input, parent, fCompareConfiguration);
+ if (SHOW_STRUCTURE) {
+ if (oldViewer != null && v != null && oldViewer.getClass() == v.getClass())
+ v= oldViewer;
+ }
+
if (v instanceof IPropertyChangeNotifier) {
final IPropertyChangeNotifier dsp= (IPropertyChangeNotifier) v;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index 42717db56..b5ab58a43 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -88,8 +88,11 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
*/
private void setViewer(Viewer newViewer) {
- if (newViewer == fViewer)
+ if (newViewer == fViewer) {
+ if (CompareEditorInput.SHOW_STRUCTURE)
+ System.out.println("Same viewer: " + fViewer.getClass().getName());
return;
+ }
boolean oldEmpty= isEmpty();
@@ -207,11 +210,13 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
boolean hadFocus= hasFocus2();
- try {
- if (fViewer != null)
- fViewer.setInput(null); // force save before switching viewer
- } catch (ViewerSwitchingCancelled ex) {
- return;
+ if (! CompareEditorInput.SHOW_STRUCTURE) {
+ try {
+ if (fViewer != null)
+ fViewer.setInput(null); // force save before switching viewer
+ } catch (ViewerSwitchingCancelled ex) {
+ return;
+ }
}
fInput= input;
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 13f45c50c..50aaf9b71 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
@@ -2208,7 +2208,7 @@ public class TextMergeViewer extends ContentMergeViewer {
c.getDisplay().beep();
if (DEAD_STEP)
return true;
- if (fChangeDiffs.size() > 0) {
+ if (fChangeDiffs != null && fChangeDiffs.size() > 0) {
if (down)
diff= (Diff) fChangeDiffs.get(0);
else
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
index 18da49fb6..9cabb43db 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
@@ -21,11 +21,11 @@ tooComplexError.format= Too many differences. Try to turn on the ''Ignore White
#####################################################
action.CopyLeftToRight.label=Copy Left to Right
-action.CopyLeftToRight.tooltip=Copy Whole Document from Left to Right
+action.CopyLeftToRight.tooltip=Copy All from Left to Right
action.CopyLeftToRight.image=copy_r_co.gif
action.CopyRightToLeft.label=Copy Right to Left
-action.CopyRightToLeft.tooltip=Copy Whole Document from Right to Left
+action.CopyRightToLeft.tooltip=Copy All from Right to Left
action.CopyRightToLeft.image=copy_l_co.gif
action.CopyDiffLeftToRight.label=Copy Current Diff

Back to the top