Author: scabanovich
Date: 2008-05-30 10:02:43 -0400 (Fri, 30 May 2008)
New Revision: 8476
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
Log:
JBIDE-830
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2008-05-30
13:55:38 UTC (rev 8475)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2008-05-30
14:02:43 UTC (rev 8476)
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.jboss.tools.common.model.XModelConstants;
@@ -100,4 +101,18 @@
return (!webInfDir.exists()) ? null : modulePath;
}
+ public static IPath getFirstWebContentPath(IProject project) {
+ IPath modulePath = null;
+ try {
+ IVirtualComponent vc = ComponentCore.createComponent(project);
+ if (vc == null || vc.getRootFolder() == null)
+ return null;
+ if (ModuleCoreNature.isFlexibleProject(project)) {
+ modulePath = vc.getRootFolder().getWorkspaceRelativePath();
+ }
+ } catch (Exception ex) {
+ }
+
+ return modulePath;
+ }
}
Show replies by date