Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-25 19:09:39 +0000
committerAndre Weinand2002-01-25 19:09:39 +0000
commite8b110d1495ab1e9130823546cddd81fa9b38ddc (patch)
tree98959ad03b98f7bb49ebff1dbd1cc319de5899d9
parentea757318648e787c618fba92de90f85bb589c381 (diff)
downloadeclipse.platform.team-e8b110d1495ab1e9130823546cddd81fa9b38ddc.tar.gz
eclipse.platform.team-e8b110d1495ab1e9130823546cddd81fa9b38ddc.tar.xz
eclipse.platform.team-e8b110d1495ab1e9130823546cddd81fa9b38ddc.zip
#2854: save code path problematic
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java6
-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/CompareConfiguration.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java9
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java6
8 files changed, 30 insertions, 10 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 6a0fe18f6..f7bbc1198 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -34,6 +34,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2519">#2519</a>: next/prev arrows active when only one difference in compare (1GFIQX3)<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8363">#8363</a>: NPE comparing two resources in the navigator.<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2501">#2501</a>: Empty menu in compare browser (1GFBQKE)<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2854">#2854</a>: Compare: Save code path problematic (1GJYGAX)<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
index ba93999c2..35d4147b8 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
@@ -53,7 +53,6 @@ public class CompareConfiguration {
private static boolean fLeftIsLocal= true;
static {
- // PR 1GEHGTZ: ITPVCM:ALL - Compare with Version reverses additions/deletions
if (fLeftIsLocal) {
fgImages[Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/del_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.LEFT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_inadd_ov.gif"); //$NON-NLS-1$
@@ -81,7 +80,6 @@ public class CompareConfiguration {
fgImages[Differencer.CONFLICTING + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/confadd_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.CONFLICTING + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/confdel_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.CONFLICTING + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/confchg_ov.gif"); //$NON-NLS-1$
- // end PR 1GEHGTZ
// ImageDescriptor tmp= fgImages[Differencer.ADDITION];
// fgImages[Differencer.ADDITION]= fgImages[Differencer.DELETION];
@@ -107,7 +105,7 @@ public class CompareConfiguration {
public CompareConfiguration() {
setProperty("LEFT_IS_LOCAL", new Boolean(fLeftIsLocal)); //$NON-NLS-1$
-
+
IPreferenceStore ps= CompareUIPlugin.getDefault().getPreferenceStore();
if (ps != null) {
boolean b= ps.getBoolean(ComparePreferencePage.INITIALLY_SHOW_ANCESTOR_PANE);
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 8720f025f..0c6eaae2d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -29,9 +29,9 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
import org.eclipse.compare.internal.*;
import org.eclipse.compare.structuremergeviewer.*;
-import org.eclipse.compare.*;
/**
@@ -696,6 +696,13 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
if (pane != null) {
Viewer v= pane.getViewer();
if (v != null) {
+
+ // since we have already asked the user whether he wants to save
+ // changes, we disable the confirmation alert in
+ // ContentMergeViewer.inputChanged
+ if (v instanceof ContentMergeViewer)
+ ((ContentMergeViewer)v).setConfirmSave(false);
+
Object input= pane.getInput();
v.setInput(input);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index dcda98dcc..987d42cd7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -537,7 +537,11 @@ public abstract class ContentMergeViewer extends ContentViewer implements IPrope
if (input != oldInput)
internalRefresh(input);
}
-
+
+ public void setConfirmSave(boolean enable) {
+ fConfirmSave= enable;
+ }
+
/* (non Javadoc)
* see Viewer.refresh
*/
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 6a0fe18f6..f7bbc1198 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
@@ -34,6 +34,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2519">#2519</a>: next/prev arrows active when only one difference in compare (1GFIQX3)<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8363">#8363</a>: NPE comparing two resources in the navigator.<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2501">#2501</a>: Empty menu in compare browser (1GFBQKE)<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=2854">#2854</a>: Compare: Save code path problematic (1GJYGAX)<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
index ba93999c2..35d4147b8 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
@@ -53,7 +53,6 @@ public class CompareConfiguration {
private static boolean fLeftIsLocal= true;
static {
- // PR 1GEHGTZ: ITPVCM:ALL - Compare with Version reverses additions/deletions
if (fLeftIsLocal) {
fgImages[Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/del_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.LEFT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_inadd_ov.gif"); //$NON-NLS-1$
@@ -81,7 +80,6 @@ public class CompareConfiguration {
fgImages[Differencer.CONFLICTING + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/confadd_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.CONFLICTING + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/confdel_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.CONFLICTING + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/confchg_ov.gif"); //$NON-NLS-1$
- // end PR 1GEHGTZ
// ImageDescriptor tmp= fgImages[Differencer.ADDITION];
// fgImages[Differencer.ADDITION]= fgImages[Differencer.DELETION];
@@ -107,7 +105,7 @@ public class CompareConfiguration {
public CompareConfiguration() {
setProperty("LEFT_IS_LOCAL", new Boolean(fLeftIsLocal)); //$NON-NLS-1$
-
+
IPreferenceStore ps= CompareUIPlugin.getDefault().getPreferenceStore();
if (ps != null) {
boolean b= ps.getBoolean(ComparePreferencePage.INITIALLY_SHOW_ANCESTOR_PANE);
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 8720f025f..0c6eaae2d 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
@@ -29,9 +29,9 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
import org.eclipse.compare.internal.*;
import org.eclipse.compare.structuremergeviewer.*;
-import org.eclipse.compare.*;
/**
@@ -696,6 +696,13 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
if (pane != null) {
Viewer v= pane.getViewer();
if (v != null) {
+
+ // since we have already asked the user whether he wants to save
+ // changes, we disable the confirmation alert in
+ // ContentMergeViewer.inputChanged
+ if (v instanceof ContentMergeViewer)
+ ((ContentMergeViewer)v).setConfirmSave(false);
+
Object input= pane.getInput();
v.setInput(input);
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index dcda98dcc..987d42cd7 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -537,7 +537,11 @@ public abstract class ContentMergeViewer extends ContentViewer implements IPrope
if (input != oldInput)
internalRefresh(input);
}
-
+
+ public void setConfirmSave(boolean enable) {
+ fConfirmSave= enable;
+ }
+
/* (non Javadoc)
* see Viewer.refresh
*/

Back to the top