Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-01-03 15:08:34 +0000
committerDani Megert2013-01-03 15:08:34 +0000
commit90646e23eaab9e5eb6abdf0f21f5bcb779d6bfd8 (patch)
tree56192bf6f21f126e276d1be6681e77bf3bd3e608
parent7376e33bf89b9e24e5774ef009e8e03f133af2c4 (diff)
downloadeclipse.platform.text-90646e23eaab9e5eb6abdf0f21f5bcb779d6bfd8.tar.gz
eclipse.platform.text-90646e23eaab9e5eb6abdf0f21f5bcb779d6bfd8.tar.xz
eclipse.platform.text-90646e23eaab9e5eb6abdf0f21f5bcb779d6bfd8.zip
Don't handle activation triggered by save dialog, otherwise we get thev20130103-150834I20130108-0800
out of sync dialog twice.
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 05fe55a1c..2c271fc0a 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -902,8 +902,6 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
/** Cache of the active workbench part. */
private IWorkbenchPart fActivePart;
- /** Indicates whether activation handling is currently be done. */
- private boolean fIsHandlingActivation= false;
/**
* The part service.
* @since 3.1
@@ -975,15 +973,15 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
* Handles the activation triggering a element state check in the editor.
*/
private void handleActivation() {
- if (fIsHandlingActivation)
+ if (!fHandleActivation)
return;
if (fActivePart == AbstractTextEditor.this || fActivePart != null && fActivePart.getAdapter(AbstractTextEditor.class) == AbstractTextEditor.this) {
- fIsHandlingActivation= true;
+ fHandleActivation= false;
try {
safelySanityCheckState(getEditorInput());
} finally {
- fIsHandlingActivation= false;
+ fHandleActivation= true;
fHasBeenActivated= true;
}
}
@@ -994,7 +992,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
* @since 3.1
*/
public void windowActivated(IWorkbenchWindow window) {
- if (window == getEditorSite().getWorkbenchWindow()) {
+ if (fHandleActivation && window == getEditorSite().getWorkbenchWindow()) {
/*
* Workaround for problem described in
* http://dev.eclipse.org/bugs/show_bug.cgi?id=11731
@@ -2529,6 +2527,11 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
*/
private ActivationListener fActivationListener;
/**
+ * Indicates activation should be handled.
+ * @since 3.9
+ */
+ private boolean fHandleActivation= true;
+ /**
* The map of the editor's status fields.
* @since 2.0
*/
@@ -5054,13 +5057,12 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
* @since 3.0
*/
protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) {
-
IDocumentProvider provider= getDocumentProvider();
if (provider == null)
return;
+ fHandleActivation= false;
try {
-
provider.aboutToChange(getEditorInput());
IEditorInput input= getEditorInput();
provider.saveDocument(progressMonitor, input, getDocumentProvider().getDocument(input), overwrite);
@@ -5072,6 +5074,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
handleExceptionOnSave(x, progressMonitor);
} finally {
provider.changed(getEditorInput());
+ fHandleActivation= true;
}
}
@@ -5086,7 +5089,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
protected void handleExceptionOnSave(CoreException exception, IProgressMonitor progressMonitor) {
try {
- ++ fErrorCorrectionOnSave;
+ ++fErrorCorrectionOnSave;
boolean isSynchronized= false;
IDocumentProvider p= getDocumentProvider();
@@ -5129,7 +5132,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
progressMonitor.setCanceled(true);
}
} finally {
- -- fErrorCorrectionOnSave;
+ --fErrorCorrectionOnSave;
}
}

Back to the top