diff options
author | Dani Megert | 2007-11-13 18:00:26 +0000 |
---|---|---|
committer | Dani Megert | 2007-11-13 18:00:26 +0000 |
commit | e4f35e76b4c0e8ba8341753e9a851efd308cc2eb (patch) | |
tree | b050200145a8315dda79eaa3148e77f98dcb05a7 | |
parent | 8bb0d17323ce46b6690989536d9f62e13a54f1ac (diff) | |
download | eclipse.platform.text-e4f35e76b4c0e8ba8341753e9a851efd308cc2eb.tar.gz eclipse.platform.text-e4f35e76b4c0e8ba8341753e9a851efd308cc2eb.tar.xz eclipse.platform.text-e4f35e76b4c0e8ba8341753e9a851efd308cc2eb.zip |
Backported fix for bug 209480.
-rw-r--r-- | org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java index ca70a8adb55..b565cc8a7f1 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java @@ -1115,10 +1115,10 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro IStatus status= info.fTextFileBuffer.getStatus(); // Ensure that we don't open an empty document for an non-existent IFile - if (element instanceof IFileEditorInput || element instanceof IURIEditorInput) { - IFileStore fileStore= info.fTextFileBuffer.getFileStore(); - if (fileStore != null && !fileStore.fetchInfo().exists()) { - String message= NLSUtility.format(TextEditorMessages.TextFileDocumentProvider_error_doesNotExist, fileStore.toString()); + if (status.getSeverity() != IStatus.ERROR && element instanceof IFileEditorInput) { + IFile file= FileBuffers.getWorkspaceFileAtLocation(info.fTextFileBuffer.getLocation()); + if (file == null || !file.exists()) { + String message= NLSUtility.format(TextEditorMessages.TextFileDocumentProvider_error_doesNotExist, ((IFileEditorInput)element).getFile().getFullPath()); return new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IResourceStatus.RESOURCE_NOT_FOUND, message, null); } } |