Author: max.andersen(a)jboss.com
Date: 2007-10-31 10:59:11 -0400 (Wed, 31 Oct 2007)
New Revision: 4594
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java
Log:
HBX-955, JBIDE-575 Restore default entries fails on new configuration
+ removed superflous excpetion logging in case of updating the configuration.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -49,7 +49,7 @@
SessionFactory builtFactory) {
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
populateComboBox();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -135,11 +135,13 @@
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
try {
removeConfiguration(root.getName());
} catch (CoreException e) {
- logErrorMessage("Could not delete launch configuration for: " +
root.getName(), e);
+ if(!forUpdate) {
+ logErrorMessage("Could not delete launch configuration for: " +
root.getName(), e);
+ }
}
}
@@ -169,7 +171,7 @@
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
ConsoleConfiguration cfg = KnownConfigurations.getInstance().find(
configuration.getName() );
if(cfg!=null) {
- KnownConfigurations.getInstance().removeConfiguration( cfg );
+ KnownConfigurations.getInstance().removeConfiguration( cfg, false );
}
}
@@ -182,8 +184,9 @@
ConsoleConfiguration oldcfg = instance.find( configuration.getName() );
if(oldcfg!=null) {
oldcfg.reset(); // reset it no matter what.
- instance.removeConfiguration(oldcfg);
+ instance.removeConfiguration(oldcfg, true);
+
ConsoleConfigurationPreferences adapter =
buildConfigurationPreferences(configuration);
instance.addConfiguration(new ConsoleConfiguration(adapter), true);
}
@@ -203,7 +206,7 @@
ConsoleConfiguration oldcfg = instance.find( movedFrom.getName() );
if(oldcfg!=null) {
oldcfg.reset(); // reset it no matter what.
- instance.removeConfiguration(oldcfg);
+ instance.removeConfiguration(oldcfg, false);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -23,6 +23,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
@@ -71,10 +72,11 @@
String launchName =
launchManager.generateUniqueLaunchConfigurationNameFrom("hibernate");
//ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(
launchConfigurationType );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null,
launchName);
- int i = DebugUITools.openLaunchConfigurationPropertiesDialog(
part.getSite().getShell(), wc, "org.eclipse.debug.ui.launchGroup.run" );
- if(i==Window.OK) {
- wc.doSave();
- }
+ ILaunchConfiguration saved = wc.doSave();
+ int i = DebugUITools.openLaunchConfigurationPropertiesDialog(
part.getSite().getShell(), saved, "org.eclipse.debug.ui.launchGroup.run" );
+ if(i!=Window.OK) {
+ saved.delete();
+ }
} catch (CoreException ce) {
HibernateConsolePlugin.getDefault().showError( part.getSite().getShell(),
"Problem adding a console configuration", ce);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -46,7 +46,7 @@
Iterator iter = selectedNonResources.iterator();
while (iter.hasNext() ) {
ConsoleConfiguration element = (ConsoleConfiguration) iter.next();
- KnownConfigurations.getInstance().removeConfiguration(element);
+ KnownConfigurations.getInstance().removeConfiguration(element, false);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -29,6 +29,8 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.IPath;
+
/**
* @author max
*/
@@ -275,5 +277,6 @@
} else {
return new String[0];
}
+
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -74,7 +74,7 @@
tv.getControl().getDisplay().syncExec(runnable);
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
refreshTree();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java 2007-10-31
13:53:49 UTC (rev 4593)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java 2007-10-31
14:59:11 UTC (rev 4594)
@@ -158,7 +158,7 @@
//ConsoleConfigurationPreferences ccp = createOldConsoleConfiguration( configName,
cmode, projectName, useProjectClasspath, entityResolver, propertyFilename, cfgFile,
mappings, classpaths, persistenceUnitName, namingStrategy );
if(oldConfig!=null) {
- KnownConfigurations.getInstance().removeConfiguration( oldConfig );
+ KnownConfigurations.getInstance().removeConfiguration( oldConfig, false );
}
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();