Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2005-02-07 20:40:54 +0000
committernitind2005-02-07 20:40:54 +0000
commitf6da222df763c7ed015b1bdc86133572ea61812a (patch)
tree01ba2d6ddd0672a66c6c62e421fd399c8e8ccb9e /bundles/org.eclipse.wst.html.core
parent4a801608ac74b4404b502d823f3c751d5619705d (diff)
downloadwebtools.sourceediting-f6da222df763c7ed015b1bdc86133572ea61812a.tar.gz
webtools.sourceediting-f6da222df763c7ed015b1bdc86133572ea61812a.tar.xz
webtools.sourceediting-f6da222df763c7ed015b1bdc86133572ea61812a.zip
stop using ResourceUtil since it's deprecated
Diffstat (limited to 'bundles/org.eclipse.wst.html.core')
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java
index f51a30a9ed..ca6de3109a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLDocumentTypeAdapter.java
@@ -15,8 +15,11 @@ package org.eclipse.wst.html.core.document;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.util.ResourceUtil;
+import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.ui.contentproperties.ContentSettings;
import org.eclipse.wst.sse.ui.contentproperties.ContentSettingsChangeSubject;
import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
@@ -73,7 +76,7 @@ public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements
XMLModel model = document.getModel();
if (model == null)
return;
- IFile file = ResourceUtil.getFileFor(model);
+ IFile file = getFile(model);
if (file == null)
return;
IProject project = file.getProject();
@@ -100,7 +103,7 @@ public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements
// this pass.
return;
}
- IFile file = ResourceUtil.getFileFor(model);
+ IFile file = getFile(model);
// find DOCTYPE delcaration and Public ID
String publicId = null;
@@ -238,6 +241,15 @@ public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements
}
return publicId;
}
+
+ private IFile getFile(IStructuredModel model) {
+ String location = model.getBaseLocation();
+ IPath path = new Path(location);
+ if (!path.toFile().exists() && path.segmentCount() > 1) {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ }
+ return null;
+ }
/**
*/

Back to the top