Revision: 3564
Author: [email protected]
Date: Thu May 27 15:03:55 2010
Log: Corrected the 'remove all' button as it was not firing events and was not updating the server.
http://code.google.com/p/power-architect/source/detail?r=3564

Modified:
 /trunk/src/main/java/ca/sqlpower/architect/profile/ProfileManagerImpl.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/profile/ProfileManagerImpl.java Mon Apr 19 14:18:19 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/profile/ProfileManagerImpl.java Thu May 27 15:03:55 2010
@@ -277,9 +277,22 @@
List<TableProfileResult> oldResults = new ArrayList<TableProfileResult>(results);
         results.clear();
         fireProfilesRemoved(oldResults);
-        for (TableProfileResult oldResult : oldResults) {
-            SQLTable table = oldResult.getProfiledObject();
- table.putClientProperty(ProfileManager.class, PROFILE_COUNT_PROPERTY, 0);
+        int index = 0;
+        try {
+            begin("Removing all profiles");
+            for (TableProfileResult oldResult : oldResults) {
+ fireChildRemoved(TableProfileResult.class, oldResult, index);
+                SQLTable table = oldResult.getProfiledObject();
+ table.putClientProperty(ProfileManager.class, PROFILE_COUNT_PROPERTY, 0);
+                index++;
+            }
+            commit();
+        } catch (RuntimeException e) {
+            rollback(e.getMessage());
+            throw e;
+        } catch (Throwable t) {
+            rollback(t.getMessage());
+            throw new RuntimeException(t);
         }
     }

Reply via email to