Author: dgeraskov
Date: 2011-11-30 20:17:02 -0500 (Wed, 30 Nov 2011)
New Revision: 36811
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
Added combobox with hibernate version to jpa generate wizards
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2011-12-01
01:10:48 UTC (rev 36810)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2011-12-01
01:17:02 UTC (rev 36811)
@@ -42,6 +42,7 @@
import org.hibernate.console.ConnectionProfileUtil;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.ext.HibernateExtensionManager;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import
org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
@@ -67,6 +68,8 @@
private StringButtonDialogField outputdir;
+ private ComboDialogField hibernateVersion;
+
private ComboDialogField connectionProfileName;
private StringButtonDialogField schemaName;
@@ -137,6 +140,7 @@
public void widgetSelected(SelectionEvent e) {
consoleConfigurationName.setEnabled(selectMethod.getSelection());
+ hibernateVersion.setEnabled(!selectMethod.getSelection());
connectionProfileName.setEnabled(!selectMethod.getSelection());
schemaName.setEnabled(!selectMethod.getSelection());
dialectName.setEnabled(!selectMethod.getSelection());
@@ -159,10 +163,17 @@
consoleConfigurationName.setDialogFieldListener(fieldlistener);
consoleConfigurationName.doFillIntoGrid(container, numColumns);
- createDBGroup(container, numColumns);
-
+ hibernateVersion = new ComboDialogField(SWT.READ_ONLY);
+
hibernateVersion.setLabelText(HibernateConsoleMessages.ConsoleConfigurationMainTab_0);
+ hibernateVersion.setItems((String[])HibernateExtensionManager.getHibernateExtensionDefinitionsAsMap().keySet().toArray(new
String[0]));
+ hibernateVersion.selectItem(0);
+ hibernateVersion.setDialogFieldListener(fieldlistener);
+ hibernateVersion.doFillIntoGrid(container, numColumns);
+ hibernateVersion.setEnabled(false);
+
+ createDBGroup(container, numColumns);
+
setControl(container);
-
if (StringHelper.isEmpty(consoleConfigurationName.getText())) {
setPageComplete(false);
}
@@ -226,6 +237,9 @@
schemaName.setEnabled(!selectMethod.getSelection());
}
+ protected String getHibernateVersion(){
+ return hibernateVersion.getText();
+ }
protected void dialogChanged() {
@@ -285,7 +299,7 @@
String dialect = determineDialect();
String ccName =
launchManager.generateLaunchConfigurationName(HibernateConsoleMessages.AddConfigurationAction_hibernate);
ConsoleConfigurationPreferences prefs = new
EclipseConsoleConfigurationPreferences(ccName,
- ConfigurationMode.JPA, null, jpaProject.getName(), true,
+ ConfigurationMode.JPA, getHibernateVersion(), jpaProject.getName(), true,
null, null, null,
new IPath[0], new IPath[0], null, null,
getConnectionProfileName(), dialect);
Show replies by date