Revision: 4032
Author: [email protected]
Date: Tue Dec  7 14:43:10 2010
Log: Same bug as before, but this time it actually works.
http://code.google.com/p/power-architect/source/detail?r=4032

Modified:
 /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Tue Dec 7 14:22:31 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Tue Dec 7 14:43:10 2010
@@ -2733,13 +2733,13 @@
LinkedHashSet<PlayPenComponent> dependentComponents = new LinkedHashSet<PlayPenComponent>();

                        for (PlayPenComponent c : pp.getSelectedItems()) {
-                           if (c instanceof UsageComponent) {
-                               dependentComponents.add(c);
-
-                               try {
-                                   pp.getContentPane().removeChild(c);
-                               } catch (ObjectDependentException ex) {
-                                   throw new RuntimeException(ex);
+                           if 
(PlayPenContentPane.isDependentComponentType(c.getClass())) {
+                               if (dependentComponents.add(c)) {
+                                   try {
+                                       pp.getContentPane().removeChild(c);
+                                   } catch (ObjectDependentException ex) {
+                                       throw new RuntimeException(ex);
+                                   }
                                }
                            } else {
                                independentComponents.add(c);
@@ -2798,14 +2798,15 @@

                    for (PlayPenComponent c : pp.getSelectedItems()) {

-                       if (c instanceof UsageComponent) {
-                           dependentComponents.add(c);
-
-                           try {
-                               pp.getContentPane().removeChild(c);
-                           } catch (ObjectDependentException ex) {
-                               throw new RuntimeException(ex);
-                           }
+                       if 
(PlayPenContentPane.isDependentComponentType(c.getClass())) {
+                           if (dependentComponents.add(c)) {
+                               try {
+                                   pp.getContentPane().removeChild(c);
+                               } catch (ObjectDependentException ex) {
+                                   throw new RuntimeException(ex);
+                               }
+                           }
+
                        } else {
                            independentComponents.add(c);
                        }

Reply via email to