Author: max.andersen(a)jboss.com
Date: 2007-11-20 14:31:23 -0500 (Tue, 20 Nov 2007)
New Revision: 4993
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardUtils.java
Log:
fixed broken initial selection of seam projects in case the selction were a not the seam
root/parent project (e.g. the test project)
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardUtils.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardUtils.java 2007-11-20
18:29:13 UTC (rev 4992)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardUtils.java 2007-11-20
19:31:23 UTC (rev 4993)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.internal.ui.viewsupport.IViewPartInputProvider;
@@ -55,16 +56,24 @@
if (seamProject == null) {
return "";
}
- if("".equals(SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
""))) {
- return "";
- }
+
String parentProjectName = seamProject.getParentProjectName();
+
+ IProject targetProject = null;
if (parentProjectName == null) {
- return project.getName();
+ targetProject =
ResourcesPlugin.getWorkspace().getRoot().getProject(project.getName());
} else {
- return parentProjectName;
+ targetProject =
ResourcesPlugin.getWorkspace().getRoot().getProject(parentProjectName);
}
+
+ if(targetProject.exists()) {
+ if("".equals(SeamCorePlugin.getSeamPreferences(targetProject).get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
""))) {
+ return "";
+ } else {
+ return targetProject.getName();
+ }
+ }
}
return "";
}
Show replies by date