Author: dazarov
Date: 2010-04-14 07:17:42 -0400 (Wed, 14 Apr 2010)
New Revision: 21463
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-2809
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2010-04-14
11:17:42 UTC (rev 21463)
@@ -114,6 +114,10 @@
//File jbossBeansFile = new File(seamGenResFolder
,"META-INF/jboss-beans.xml"); //$NON-NLS-1$
FilterSet filterSet = new FilterSet();
filterSet.addFilter("projectName", seamWebProject.getName()); //$NON-NLS-1$
+ filterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ filterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ filterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
filterSet.addFilter("webRootFolder",webRootVirtFolder.getUnderlyingFolder().getFullPath().removeFirstSegments(1).toString());
//$NON-NLS-1$
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2010-04-14
11:17:42 UTC (rev 21463)
@@ -30,7 +30,6 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
@@ -120,11 +119,10 @@
this.model = model;
this.seamWebProject = seamWebProject;
- // Set default project names
- earProjectName = seamWebProject.getName() + "-ear";
- ejbProjectName = seamWebProject.getName() + "-ejb";
- testProjectName = seamWebProject.getName() + "-test";
-
+ earProjectName =
model.getStringProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT);
+ ejbProjectName =
model.getStringProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT);
+ testProjectName =
model.getStringProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT);
+
seamRuntime =
SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
if(seamRuntime==null) {
throw new RuntimeException("Can't get seam runtime " +
model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
@@ -180,6 +178,10 @@
ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", seamWebProject.getName());
//$NON-NLS-1$
+ ejbFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
ejbFilterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
File driver = new File(((String[])
model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
@@ -310,8 +312,6 @@
* Creates test project for given seam web project.
*/
protected boolean createTestProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, testProjectName);
-
if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING))
return false;
@@ -326,6 +326,10 @@
File testSrcDir = new File(testProjectDir, "test-src"); //$NON-NLS-1$
FilterSet filterSet = new FilterSet();
filterSet.addFilter("projectName", seamWebProject.getName()); //$NON-NLS-1$
+ filterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ filterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ filterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
filterSet.addFilter("webRootFolder",
webRootVirtFolder.getUnderlyingFolder().getFullPath().removeFirstSegments(1).toString());
//$NON-NLS-1$
@@ -400,8 +404,6 @@
}
protected void createEjbProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ejbProjectName);
-
ejbProjectFolder.mkdir();
AntCopyUtils.copyFilesAndFolders(
@@ -439,6 +441,10 @@
FilterSet ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName());
//$NON-NLS-1$
+ ejbFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
ejbFilterSet.addFilter("connectionProfile",
model.getStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE));//$NON-NLS-1$
@@ -459,14 +465,15 @@
}
protected void createEarProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, earProjectName);
-
earProjectFolder.mkdir();
File earContentsFolder = new File(earProjectFolder, "EarContent");
//$NON-NLS-1$
FilterSet earFilterSet = new FilterSet();
earFilterSet.addFilter("projectName", earProjectFolder.getName() +
".ear"); //$NON-NLS-1$ //$NON-NLS-2$
+ earFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ earFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ earFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
AntCopyUtils.copyFileToFolder(
new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2010-04-14
10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ear</name>
+ <name>@earProjectName@</name>
<comment></comment>
<projects>
- <project>@projectName@-ejb</project>
+ <project>@ejbProjectName@</project>
<project>@projectName@</project>
</projects>
<buildSpec>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ear">
+<wb-module deploy-name="@earProjectName@">
<wb-resource deploy-path="/" source-path="/EarContent"/>
-<dependent-module deploy-path="/"
handle="module:/resource/@projectName@-ejb/@projectName@-ejb">
+<dependent-module deploy-path="/"
handle="module:/resource/@ejbProjectName@/@ejbProjectName@">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/"
handle="module:/resource/@projectName@/@projectName@">
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml 2010-04-14
11:17:42 UTC (rev 21463)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
- <display-name>@projectName@-ear</display-name>
+ <display-name>@earProjectName@</display-name>
<!-- JBIDE-4166 Workaround - Make sure we deploy this first, since this is referenced
in xxx-ejb.jar-->
<module>
@@ -19,7 +19,7 @@
</module>
<module>
- <ejb>@projectName(a)-ejb.jar</ejb>
+ <ejb>@ejbProjectName@.jar</ejb>
</module>
</application>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project 2010-04-14
10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ear</name>
+ <name>@earProjectName@</name>
<comment></comment>
<projects>
- <project>@projectName@-ejb</project>
+ <project>@ejbProjectName@</project>
<project>@projectName@</project>
</projects>
<buildSpec>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ear">
+<wb-module deploy-name="@earProjectName@">
<wb-resource deploy-path="/" source-path="/EarContent"/>
-<dependent-module deploy-path="/"
handle="module:/resource/@projectName@-ejb/@projectName@-ejb">
+<dependent-module deploy-path="/"
handle="module:/resource/@ejbProjectName@/@ejbProjectName@">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/"
handle="module:/resource/@projectName@/@projectName@">
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml 2010-04-14
11:17:42 UTC (rev 21463)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
- <display-name>@projectName@-ear</display-name>
+ <display-name>@earProjectName@</display-name>
<!-- JBIDE-4166 Workaround - Make sure we deploy this first, since this is referenced
in xxx-ejb.jar-->
<module>
@@ -19,7 +19,7 @@
</module>
<module>
- <ejb>@projectName(a)-ejb.jar</ejb>
+ <ejb>@ejbProjectName@.jar</ejb>
</module>
</application>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2010-04-14
10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ejb</name>
+ <name>@ejbProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ejb">
+<wb-module deploy-name="@ejbProjectName@">
<wb-resource deploy-path="/" source-path="/ejbModule"/>
<property name="java-output-path" value="build/classes"/>
</wb-module>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2010-04-14
10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-test</name>
+ <name>@testProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2010-04-14
10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-test</name>
+ <name>@testProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2010-04-14
11:17:42 UTC (rev 21463)
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
-Class-Path: @projectName(a)-ejb.jar
+Class-Path: @ejbProjectName@.jar
@earLibs@
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-04-14
11:17:42 UTC (rev 21463)
@@ -108,6 +108,12 @@
public static String SEAM_INSTALL_WIZARD_PAGE_DB_TABLES_ALREADY_EXISTS;
public static String SEAM_INSTALL_WIZARD_PAGE_DEPLOY_AS;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME;
public static String SEAM_INSTALL_WIZARD_PAGE_EDIT;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2010-04-14
11:17:42 UTC (rev 21463)
@@ -97,7 +97,19 @@
private DataModelValidatorDelegate validatorDelegate;
private IFieldEditor jBossSeamHomeEditor;
+
+ private IFieldEditor ejbProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME,
+ ""); //$NON-NLS-1$
+ private IFieldEditor earProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME,
+ ""); //$NON-NLS-1$
+
private IFieldEditor jBossAsDeployAsEditor = IFieldEditorFactory.INSTANCE
.createRadioEditor(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
@@ -142,6 +154,12 @@
ISeamFacetDataModelProperties.TEST_PROJECT_CREATING,
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CREATE_TEST_PROJECT,
true);
+
+ private IFieldEditor testProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME,
+ ""); //$NON-NLS-1$
private IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE
.createTextEditor(
@@ -292,7 +310,7 @@
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
- this.jBossAsDeployAsEditor.getValueAsString());
+ this.jBossAsDeployAsEditor.getValueAsString());
}
/*
@@ -387,6 +405,18 @@
generalGroup.setLayout(gridLayout);
registerEditor(jBossSeamHomeEditor, generalGroup, 3);
registerEditor(jBossAsDeployAsEditor, generalGroup, 3);
+ registerEditor(ejbProjectNameditor, generalGroup, 3);
+ ejbProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+ registerEditor(earProjectNameditor, generalGroup, 3);
+ earProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+
+ jBossAsDeployAsEditor.addPropertyChangeListener(new PropertyChangeListener(){
+ public void propertyChange(PropertyChangeEvent arg0) {
+ Boolean value = jBossAsDeployAsEditor.getValue() ==
ISeamFacetDataModelProperties.DEPLOY_AS_EAR;
+ ejbProjectNameditor.setEnabled(value.booleanValue());
+ earProjectNameditor.setEnabled(value.booleanValue());
+ }
+ });
gd = new GridData();
gd.horizontalSpan = 1;
@@ -429,11 +459,13 @@
public void propertyChange(PropertyChangeEvent arg0) {
Boolean value = (Boolean)createTestProjectCheckboxeditor.getValue();
testsPkgNameditor.setEnabled(value.booleanValue());
+ testProjectNameditor.setEnabled(value.booleanValue());
}
});
createTestProjectCheckboxeditor.setEnabled(isNewProjectWizard());
+ registerEditor(testProjectNameditor, generationGroup, 3);
registerEditor(testsPkgNameditor, generationGroup, 3);
setControl(root);
@@ -462,6 +494,19 @@
validatorDelegate.addValidatorForProperty(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
getDeploymentTypeValidator(getWizard()));
+
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT));
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT));
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT));
}
@@ -591,6 +636,16 @@
model.setStringProperty(
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
getTestPkgName(p));
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ earProjectNameditor.getValueAsString());
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ ejbProjectNameditor.getValueAsString());
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ testProjectNameditor.getValueAsString());
+
}
}
@@ -636,6 +691,9 @@
sessionBeanPkgNameditor.setValue(getSessionPkgName(p));
entityBeanPkgNameditor.setValue(getEntityPkgName(p));
testsPkgNameditor.setValue(getTestPkgName(p));
+ ejbProjectNameditor.setValue(getEJBProjectName(p));
+ earProjectNameditor.setValue(getEARProjectName(p));
+ testProjectNameditor.setValue(getTestProjectName(p));
}
private String getSessionPkgName(String projectName) {
@@ -652,6 +710,18 @@
return "org.domain." //$NON-NLS-1$
+ SeamUtil.getSeamPackageName(projectName) + ".test"; //$NON-NLS-1$
}
+
+ private String getEJBProjectName(String projectName) {
+ return projectName + "-ejb"; //$NON-NLS-1$
+ }
+
+ private String getEARProjectName(String projectName) {
+ return projectName + "-ear"; //$NON-NLS-1$
+ }
+
+ private String getTestProjectName(String projectName) {
+ return projectName + "-test"; //$NON-NLS-1$
+ }
/*
* Sets seam runtime field in default value.
@@ -747,23 +817,28 @@
* @see IValidator#validate(Object, Object)
*/
public Map<String, IStatus> validate(Object value, Object context) {
- final String projectName = (String) value;
final String deployAs = model
.getStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
+
+ final boolean testCreating =
(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING);
- final String testProjectName = projectName + "-test"; //$NON-NLS-1$
- IStatus status = ProjectCreationDataModelProviderNew
- .validateName(testProjectName);
+ IStatus status;
- if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
- return doPackStatus(status,
- propertyName,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
- testProjectName));
+ if (testCreating) {
+ final String testProjectName = testProjectNameditor.getValueAsString();
+ status = ProjectCreationDataModelProviderNew
+ .validateName(testProjectName);
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ propertyName,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
+ testProjectName));
+ }
}
if (ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(deployAs)) {
- final String earProjectName = projectName + "-ear"; //$NON-NLS-1$
+ final String earProjectName = earProjectNameditor.getValueAsString();
status = ProjectCreationDataModelProviderNew
.validateName(earProjectName);
@@ -774,7 +849,7 @@
earProjectName));
}
- final String ejbProjectName = projectName + "-ejb"; //$NON-NLS-1$
+ final String ejbProjectName = ejbProjectNameditor.getValueAsString();
status = ProjectCreationDataModelProviderNew
.validateName(ejbProjectName);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-04-14
10:06:37 UTC (rev 21462)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-04-14
11:17:42 UTC (rev 21463)
@@ -14,6 +14,9 @@
SEAM_PROJECT_WIZARD_CREATE_STANDALONE_SEAM_WEB_PROJECT=Create standalone Seam Web
Project
SEAM_INSTALL_WIZARD_PAGE_SEAM_RUNTIME=Seam Runtime:
SEAM_INSTALL_WIZARD_PAGE_DEPLOY_AS=Deploy as:
+SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME=EJB project name:
+SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME=EAR project name:
+SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME=Test project name:
SEAM_VIEW_LAYOUT_ACTION_GROUP_FLAT=Flat
SEAM_VIEW_LAYOUT_ACTION_GROUP_NODE=Node
SEAM_INSTALL_WIZARD_PAGE_CONNECTION_PROFILE=Connection profile: