Author: max.andersen(a)jboss.com
Date: 2010-02-09 14:29:59 -0500 (Tue, 09 Feb 2010)
New Revision: 20205
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/views/KnownConfigurationsProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigurationListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
Log:
fix for JBIDE-5816, introduced configurationReset event to force update of tree when reset
occurs.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -129,6 +129,7 @@
}
fakeDrivers.clear();
cleanUpClassLoader();
+ fireConfigurationReset();
executionContext = null;
}
@@ -607,6 +608,12 @@
}
}
+ private void fireConfigurationReset() {
+ for (ConsoleConfigurationListener view : consoleCfgListeners) {
+ view.configurationReset(this);
+ }
+ }
+
private void fireQueryPageCreated(QueryPage qp) {
for (ConsoleConfigurationListener view : consoleCfgListeners) {
view.queryPageCreated(qp);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigurationListener.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigurationListener.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigurationListener.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -45,5 +45,7 @@
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory
aboutToCloseFactory);
public void configurationBuilt(ConsoleConfiguration ccfg);
+
+ public void configurationReset(ConsoleConfiguration ccfg);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -94,6 +94,14 @@
listener.configurationBuilt(ccfg);
}
});
+ }
+
+ public void configurationReset(final ConsoleConfiguration ccfg) {
+ fireNotification(new Notification() {
+ public void notify(KnownConfigurationsListener listener) {
+ listener.configurationReset(ccfg);
+ }
+ });
};
};
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -34,4 +34,6 @@
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory
closingFactory);
public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate);
+
+ public void configurationReset(ConsoleConfiguration ccfg);
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -21,9 +21,6 @@
*/
package org.hibernate.console.node;
-import java.util.Arrays;
-import java.util.Comparator;
-
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.KnownConfigurationsAdapter;
@@ -54,6 +51,10 @@
public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
markChildrenForReload();
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ markChildrenForReload();
+ }
});
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -47,6 +47,10 @@
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory
closedSessionFactory) {
clear();
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ clear();
+ }
});
name = configuration.getName();
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 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -58,6 +58,10 @@
public void configurationAdded(ConsoleConfiguration root) {
populateComboBox();
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+
+ }
};
KnownConfigurations.getInstance().addConsoleConfigurationListener(
listener );
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 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -141,6 +141,10 @@
}
}
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+
+ }
};
KnownConfigurations.getInstance().addConsoleConfigurationListener(kcl);
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 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -114,12 +114,20 @@
}
public void sessionFactoryClosing(final ConsoleConfiguration configuration,
SessionFactory closingFactory) {
+ refreshTree(configuration);
+ }
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ refreshTree(ccfg);
+ }
+
+ private void refreshTree(final ConsoleConfiguration configuration) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
tv.collapseToLevel(configuration, AbstractTreeViewer.ALL_LEVELS);
tv.refresh(configuration);
}
- });
+ });
}
public void configurationBuilt(ConsoleConfiguration ccfg) {
@@ -187,6 +195,8 @@
refreshTree();
}
}
+
+
}
\ No newline at end of file
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -143,6 +143,11 @@
public void queryPageCreated(QueryPage qp) {
queryCreated++;
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ // TODO Auto-generated method stub
+
+ }
}
public void testBuildConfiguration() {
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-02-09
17:18:31 UTC (rev 20204)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-02-09
19:29:59 UTC (rev 20205)
@@ -42,6 +42,11 @@
fail(ConsoleTestMessages.KnownConfigurationsTest_trying_remove_non_existing_console);
}
}
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ // TODO Auto-generated method stub
+
+ }
}
public void testKnownConfigurations() {