summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2013-10-11 14:22:42 (EDT)
committerIan Trimble2013-10-11 14:22:42 (EDT)
commitde0c6425614b538e5c3483c1f83cfd654dcb5c46 (patch)
tree61662d96ca82a380bbf27a1d77fc94aa9c0aa5d2
parent04e5dd517027e82ee139032f513c36ddcd6b72be (diff)
downloadwebtools.jsf-de0c6425614b538e5c3483c1f83cfd654dcb5c46.zip
webtools.jsf-de0c6425614b538e5c3483c1f83cfd654dcb5c46.tar.gz
webtools.jsf-de0c6425614b538e5c3483c1f83cfd654dcb5c46.tar.bz2
Bug 418933 - Errors validating JSF/XHTML files
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java
index 72bb282..5103bbf 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java
@@ -14,6 +14,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -28,6 +29,8 @@ import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessListen
import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.VersionStamp;
import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException.Cause;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
/**
* All IDTViewHandler's must sub-class this abstract class.
@@ -209,12 +212,25 @@ public abstract class AbstractDTViewHandler implements IDTViewHandler
private IPath getWebContentPath(final IProject project)
{
+ //Bug 418933 - Errors validating JSF/XHTML files
+ IPath path = null;
if (project != null)
{
- return ComponentCore.createComponent(project).getRootFolder()
- .getUnderlyingFolder().getFullPath();
+ final IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null)
+ {
+ final IVirtualFolder folder = component.getRootFolder();
+ if (folder != null)
+ {
+ final IContainer container = folder.getUnderlyingFolder();
+ if (container != null)
+ {
+ path = container.getFullPath();
+ }
+ }
+ }
}
- return null;
+ return path;
}
/**