Author: dazarov
Date: 2010-10-15 13:22:49 -0400 (Fri, 15 Oct 2010)
New Revision: 25883
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7219
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-10-15
17:15:23 UTC (rev 25882)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2010-10-15
17:22:49 UTC (rev 25883)
@@ -624,6 +624,10 @@
model.setStringProperty(
ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, p);
+
+ if(!visible)
+ setCodeGenerationProperties();
+
model.setStringProperty(
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME,
getSessionPkgName(p));
@@ -645,11 +649,12 @@
model.setStringProperty(
ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
testProjectNameditor.getValueAsString());
-
}
}
private boolean needToShowConnectionProfile = true;
+
+ private boolean visible = false;
/**
* It is overridden to fill Code Generation group with the default package
@@ -657,9 +662,8 @@
*/
@Override
public void setVisible(boolean visible) {
-
if (visible) {
- setCodeGenerationProperties();
+ this.visible = true;
setDefaultSeamRuntime();
boolean jpaFacetAdded = getJpaFacetVersion() != null;
if (jpaFacetAdded == needToShowConnectionProfile){
@@ -677,11 +681,10 @@
};
private void initDefaultWizardProperties() {
- setCodeGenerationProperties();
setDefaultSeamRuntime();
validate();
}
-
+
/*
* Fills Code Generation group with the default package names.
*/
@@ -691,19 +694,13 @@
if(p == null)
return;
-
- if(sessionBeanPkgNameditor.getValueAsString() == null ||
"".equals(sessionBeanPkgNameditor.getValueAsString().trim()))
- sessionBeanPkgNameditor.setValue(getSessionPkgName(p));
- if(entityBeanPkgNameditor.getValueAsString() == null ||
"".equals(entityBeanPkgNameditor.getValueAsString().trim()))
- entityBeanPkgNameditor.setValue(getEntityPkgName(p));
- if(testsPkgNameditor.getValueAsString() == null ||
"".equals(testsPkgNameditor.getValueAsString().trim()))
- testsPkgNameditor.setValue(getTestPkgName(p));
- if(ejbProjectNameditor.getValueAsString() == null ||
"".equals(ejbProjectNameditor.getValueAsString().trim()))
- ejbProjectNameditor.setValue(getEJBProjectName(p));
- if(earProjectNameditor.getValueAsString() == null ||
"".equals(earProjectNameditor.getValueAsString().trim()))
- earProjectNameditor.setValue(getEARProjectName(p));
- if(testProjectNameditor.getValueAsString() == null ||
"".equals(testProjectNameditor.getValueAsString().trim()))
- testProjectNameditor.setValue(getTestProjectName(p));
+
+ 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) {
@@ -975,7 +972,6 @@
*
*/
public void finishPressed() {
- setCodeGenerationProperties();
model.removeListener(validatorDelegate);
};
@@ -983,21 +979,21 @@
* test method
*/
public String getSessionBeanPkgName() {
- return (String) sessionBeanPkgNameditor.getValue();
+ return sessionBeanPkgNameditor.getValueAsString();
}
/*
* test method
*/
public String getEntityBeanPkgName() {
- return (String) entityBeanPkgNameditor.getValue();
+ return entityBeanPkgNameditor.getValueAsString();
}
/*
* test method
*/
public String getTestsPkgName() {
- return (String) testsPkgNameditor.getValue();
+ return testsPkgNameditor.getValueAsString();
}
private Map<String, IStatus> doPackStatus(IStatus status, String propertyName,
String message){
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2010-10-15
17:15:23 UTC (rev 25882)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2010-10-15
17:22:49 UTC (rev 25883)
@@ -49,10 +49,10 @@
}
public void testProjectNameWithSpaces() {
+ showWizard();
+
wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam Test Project");
- showWizard();
-
String sessionBeanPkgName = seamWizPg.getSessionBeanPkgName();
String entityBeanPkgName = seamWizPg.getEntityBeanPkgName();
String testsPkgName = seamWizPg.getTestsPkgName();
@@ -73,10 +73,10 @@
}
public void testProjectNameWithUnderlines() {
- wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam_Test_Project");
-
showWizard();
+ wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam_Test_Project");
+
String sessionBeanPkgName = seamWizPg.getSessionBeanPkgName();
String entityBeanPkgName = seamWizPg.getEntityBeanPkgName();
String testsPkgName = seamWizPg.getTestsPkgName();
@@ -87,10 +87,10 @@
}
public void testProjectNameWithMinuses() {
- wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam-Test-Project");
-
showWizard();
+ wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam-Test-Project");
+
String sessionBeanPkgName = seamWizPg.getSessionBeanPkgName();
String entityBeanPkgName = seamWizPg.getEntityBeanPkgName();
String testsPkgName = seamWizPg.getTestsPkgName();
@@ -101,10 +101,10 @@
}
public void testProjectNameWithMultipleDots() {
- wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam...Test....Project");
-
showWizard();
+ wizard.getDataModel().setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"Seam...Test....Project");
+
String sessionBeanPkgName = seamWizPg.getSessionBeanPkgName();
String entityBeanPkgName = seamWizPg.getEntityBeanPkgName();
String testsPkgName = seamWizPg.getTestsPkgName();