Author: dgeraskov
Date: 2011-10-20 04:56:00 -0400 (Thu, 20 Oct 2011)
New Revision: 35833
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
Log:
https://issues.jboss.org/browse/JBIDE-9559
Force console configuration rebuild on generation
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2011-10-20
07:13:34 UTC (rev 35832)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2011-10-20
08:56:00 UTC (rev 35833)
@@ -19,6 +19,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
+import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
@@ -55,6 +56,7 @@
ILaunchConfigurationWorkingCopy wc =
HibernateJpaPlatformUi.createDefaultLaunchConfig(projectName);
if (wc != null) {
String concoleConfigurationName = initPage.getConfigurationName();
+ resetConsoleConfiguration(concoleConfigurationName);
wc.setAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
concoleConfigurationName);
wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR, initPage.getOutputDir());
@@ -78,4 +80,13 @@
}
return true;
}
+
+ protected void resetConsoleConfiguration(String concoleConfigurationName){
+ if (!initPage.isTemporaryConfiguration()){
+ ConsoleConfiguration cc =
KnownConfigurations.getInstance().find(concoleConfigurationName);
+ if (cc.hasConfiguration()){
+ cc.reset();
+ }
+ }
+ }
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2011-10-20
07:13:34 UTC (rev 35832)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2011-10-20
08:56:00 UTC (rev 35833)
@@ -16,6 +16,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
+import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
@@ -53,7 +54,8 @@
ILaunchConfigurationWorkingCopy wc =
HibernateJpaPlatformUi.createDefaultLaunchConfig(projectName);
if (wc != null) {
// SHOULD PRESENT THE CONFIGURATION!!!
- String concoleConfigurationName = initPage.getConfigurationName();
+ String concoleConfigurationName = initPage.getConfigurationName();
+ resetConsoleConfiguration(concoleConfigurationName);
wc.setAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
concoleConfigurationName);
wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR, initPage.getOutputDir());
@@ -82,5 +84,14 @@
}
return true;
}
+
+ protected void resetConsoleConfiguration(String concoleConfigurationName){
+ if (!initPage.isTemporaryConfiguration()){
+ ConsoleConfiguration cc =
KnownConfigurations.getInstance().find(concoleConfigurationName);
+ if (cc.hasConfiguration()){
+ cc.reset();
+ }
+ }
+ }
}