Show error dialog with link to preference page.
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 dd3736e..d49a01c 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
@@ -4098,8 +4098,6 @@
try {
++ fErrorCorrectionOnSave;
- Shell shell= getSite().getShell();
-
boolean isSynchronized= false;
IDocumentProvider p= getDocumentProvider();
@@ -4116,7 +4114,7 @@
String title= EditorMessages.Editor_error_save_outofsync_title;
String msg= EditorMessages.Editor_error_save_outofsync_message;
- if (MessageDialog.openQuestion(shell, title, msg))
+ if (MessageDialog.openQuestion(getSite().getShell(), title, msg))
performSave(true, progressMonitor);
else {
/*
@@ -4130,7 +4128,7 @@
} else {
String title= EditorMessages.Editor_error_save_title;
String msg= EditorMessages.Editor_error_save_message;
- ErrorDialog.openError(shell, title, msg, exception.getStatus());
+ openSaveErrorDialog(title, msg, exception);
/*
* 1GEUPKR: ITPJUI:ALL - Loosing work with simultaneous edits
@@ -4146,6 +4144,22 @@
}
/**
+ * Presents an error dialog to the user when a problem
+ * happens during save.
+ * <p>
+ * Subclasses can decide to override the given title and message.
+ * </p>
+ *
+ * @param title the dialog title
+ * @param message the message to display
+ * @param exception the exception to handle
+ * @since 3.3
+ */
+ protected void openSaveErrorDialog(String title, String message, CoreException exception) {
+ ErrorDialog.openError(getSite().getShell(), title, message, exception.getStatus());
+ }
+
+ /**
* Tells whether the given core exception is exactly the
* exception which is thrown for a non-synchronized element.
*