Author: dgolovin
Date: 2007-10-16 04:15:47 -0400 (Tue, 16 Oct 2007)
New Revision: 4209
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/widget/editor/ComboFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-758
Combo with all dialects is added, after DB type is changed default dialect for DB type is
selectd
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 2007-10-15
19:04:24 UTC (rev 4208)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-16
08:15:47 UTC (rev 4209)
@@ -77,7 +77,9 @@
/**
*
*/
- private DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
+ private static final DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
+
+ private static final List<String> DIALECT_CLASSES = getDialectClasses();
/**
*
@@ -120,10 +122,10 @@
.getDialectNames()), getDefaultDbType(), false);
private IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE
- .createUneditableTextEditor(
+ .createComboEditor(
ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
- SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_HIBERNATE_DIALECT, HIBERNATE_HELPER
- .getDialectClass(getDefaultDbType()));
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_HIBERNATE_DIALECT,DIALECT_CLASSES,
HIBERNATE_HELPER
+ .getDialectClass(getDefaultDbType()),true);
private IFieldEditor dbSchemaName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_SCHEMA_NAME,
@@ -173,6 +175,17 @@
/**
* @return
*/
+ private static List getDialectClasses() {
+ List<String> dialects = new ArrayList<String>();
+ for (String dialectName : HIBERNATE_HELPER.getDialectNames()) {
+ dialects.add(HIBERNATE_HELPER.getDialectClass(dialectName));
+ }
+ return dialects;
+ }
+
+ /**
+ * @return
+ */
private String getDefaultDbType() {
// TODO Auto-generated method stub
return SeamFacetPreference.getStringPreference(
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-15
19:04:24 UTC (rev 4208)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-16
08:15:47 UTC (rev 4209)
@@ -100,4 +100,14 @@
super.setEditable(ediatble);
comboField.setEditable(ediatble);
}
+
+ public void setValue(Object newValue) {
+ super.setValue(newValue);
+ if(comboField!=null) {
+ comboField.removePropertyChangeListener(this);
+ comboField.setValue(newValue.toString());
+ comboField.addPropertyChangeListener(this);
+ }
+
+ }
}
\ No newline at end of file