[136224] StructuredTextEditor and JSEditor do not support plain IStorageEditorInput
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java index a7ad9ac..adc1601 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
@@ -98,8 +98,11 @@ import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPathEditorInput; import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IStorageEditorInput; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; @@ -147,6 +150,7 @@ import org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter; import org.eclipse.wst.sse.ui.internal.SSEUIMessages; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.StorageModelProvider; import org.eclipse.wst.sse.ui.internal.StructuredLineChangeHover; import org.eclipse.wst.sse.ui.internal.StructuredTextViewer; import org.eclipse.wst.sse.ui.internal.UnknownContentTypeDialog; @@ -2617,9 +2621,9 @@ // largely untested setDocumentProvider(StructuredModelDocumentProvider.getInstance()); } -// else if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput)) { -// setDocumentProvider(StorageModelProvider.getInstance()); -// } + else if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput) && !(input instanceof IPathEditorInput)) { + setDocumentProvider(StorageModelProvider.getInstance()); + } else { super.setDocumentProvider(input); }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java index a86510a..b6e7954 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
@@ -289,7 +289,7 @@ /** * Gets IFile from current document * - * @return IFile + * @return IFile the IFile, null if no such file exists */ private IFile getFile() { IStructuredModel model = null; @@ -302,8 +302,14 @@ // workspace root. Don't translate on-disk paths to // in-workspace resources. IPath basePath = new Path(baseLocation); - if (basePath.segmentCount() > 1 && !basePath.toFile().exists()) { + if (basePath.segmentCount() > 1) { file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath); + /* + * If the IFile doesn't exist, make sure it's not + * returned + */ + if (!file.exists()) + file = null; } } }