Revision: 3188
Author: [email protected]
Date: Tue Dec  1 14:50:42 2009
Log: Updated a check for exported keys. Now the exported keys are direct children of the SQLTable.
http://code.google.com/p/power-architect/source/detail?r=3188

Modified:
/branches/sqlobject-spobject-model/src/ca/sqlpower/architect/swingui/PlayPen.java

=======================================
--- /branches/sqlobject-spobject-model/src/ca/sqlpower/architect/swingui/PlayPen.java Tue Dec 1 14:21:17 2009 +++ /branches/sqlobject-spobject-model/src/ca/sqlpower/architect/swingui/PlayPen.java Tue Dec 1 14:50:42 2009
@@ -1650,21 +1650,25 @@
                boolean fireEvent = false;
                SPObject child = e.getChild();
                addHierarchyListeners(child);
-               if (child instanceof SQLTable
-                       || (child instanceof SQLRelationship
- && (((SQLTable.Folder) e.getSource()).getType() == SQLTable.Folder.EXPORTED_KEYS))) {
-                   fireEvent = true;
-
-                   PlayPenComponent ppc = removedComponents.get(child);
-                   if (ppc != null) {
-                       if (ppc instanceof Relationship) {
-                           contentPane.add(ppc, 
contentPane.getComponentCount());
-                       } else {
-                           contentPane.add(ppc, 
contentPane.getFirstRelationIndex());
-                       }
-
-                   }
-               }
+               try {
+            if (child instanceof SQLTable
+                    || (child instanceof SQLRelationship
+ && ((SQLTable) e.getSource()).getExportedKeys().contains(child))) {
+                fireEvent = true;
+
+                PlayPenComponent ppc = removedComponents.get(child);
+                if (ppc != null) {
+                    if (ppc instanceof Relationship) {
+ contentPane.add(ppc, contentPane.getComponentCount());
+                    } else {
+ contentPane.add(ppc, contentPane.getFirstRelationIndex());
+                    }
+
+                }
+            }
+        } catch (SQLObjectException ex) {
+            throw new RuntimeException(ex);
+        }

                if (fireEvent) {
                        firePropertyChange("model.children", null, null); 
//$NON-NLS-1$

Reply via email to