Author: scabanovich
Date: 2008-01-29 07:32:17 -0500 (Tue, 29 Jan 2008)
New Revision: 6009
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/handlers/AddPageTemplateSupport.java
Log:
JBIDE-1700
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/handlers/AddPageTemplateSupport.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/handlers/AddPageTemplateSupport.java 2008-01-29
12:25:19 UTC (rev 6008)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/handlers/AddPageTemplateSupport.java 2008-01-29
12:32:17 UTC (rev 6009)
@@ -13,6 +13,7 @@
import java.util.Map;
import java.util.Properties;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Path;
import org.eclipse.osgi.util.NLS;
@@ -126,9 +127,15 @@
if(pagePath.equals(this.pagePath)) return selectedFile;
this.pagePath = pagePath;
try {
- selectedFile = ModelPlugin.getWorkspace().getRoot().getFile(new Path(pagePath));
+ IResource r = ModelPlugin.getWorkspace().getRoot().findMember(new Path(pagePath));
+ if(r instanceof IFile) {
+ selectedFile = (IFile)r;
+ } else {
+ selectedFile = null;
+ }
} catch (Exception e) {
WebModelPlugin.getPluginLog().logError(e);
+ selectedFile = null;
}
return selectedFile;
}
Show replies by date