Author: akazakov
Date: 2008-10-08 09:47:19 -0400 (Wed, 08 Oct 2008)
New Revision: 10742
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-08
13:23:14 UTC (rev 10741)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-08
13:47:19 UTC (rev 10742)
@@ -17,8 +17,10 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import
org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
/**
* Data model provider for Seam facet wizard page
@@ -137,4 +139,27 @@
Platform.getBundle(SeamCorePlugin.PLUGIN_ID).getEntry(
"/templates")).getPath()); //$NON-NLS-1$
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#init()
+ */
+ @Override
+ public void init() {
+ super.init();
+ model.setProperty(ISeamFacetDataModelProperties.DB_TYPE,
SeamProjectPreferences.getStringPreference(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE));
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
SeamProjectPreferences.getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE));
+ model.setProperty(ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME, "");
+ model.setProperty(ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME,
"");
+ model.setProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS, false);
+ model.setProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY,
false);
+ if(model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)!=null) {
+ model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME,
"org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)
+ ".session"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
"org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)
+ ".entity"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
"org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)
+ ".test"); //$NON-NLS-1$
+ }
+ // TODO
+// jBossSeamHome
+// jBossAsDeployAs
+ }
+}
\ No newline at end of file
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 2008-10-08
13:23:14 UTC (rev 10741)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-10-08
13:47:19 UTC (rev 10742)
@@ -53,7 +53,6 @@
import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -155,27 +154,6 @@
}
/**
- * This method is useful for seam facet modify wizard.
- */
- private void initModel() {
- synchEditorsAndModel(jBossHibernateDbTypeEditor);
-// synchEditorsAndModel(jBossSeamHomeEditor);
- synchEditorsAndModel(jBossAsDeployAsEditor);
- synchEditorsAndModel(connProfileSelEditor);
- synchEditorsAndModel(dbSchemaName);
- synchEditorsAndModel(dbCatalogName);
- synchEditorsAndModel(dbTablesExists);
- synchEditorsAndModel(recreateTablesOnDeploy);
- synchEditorsAndModel(sessionBeanPkgNameditor);
- synchEditorsAndModel(entityBeanPkgNameditor);
- synchEditorsAndModel(testsPkgNameditor);
- }
-
- private void synchEditorsAndModel(IFieldEditor editor) {
- model.setProperty(editor.getName(), editor.getValue());
- }
-
- /**
* @return
*/
private String getDefaultDbType() {
@@ -270,10 +248,6 @@
model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
HIBERNATE_HELPER.getDialectClass(jBossHibernateDbTypeEditor.getValueAsString()));
-
- if(!isNewProjectWizard()) {
- initModel();
- }
}
/**