Revision: 3228
Author: [email protected]
Date: Thu Jan 14 12:35:46 2010
Log: Fixed bug where relationship is not highlighted in PlayPen when the imported keys are selected in the DBTree. Changed the names of the folders in the DBTree.
http://code.google.com/p/power-architect/source/detail?r=3228

Modified:
 /trunk/src/ca/sqlpower/architect/swingui/DBTree.java
 /trunk/src/ca/sqlpower/architect/swingui/RelationalPlayPenFactory.java
 /trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java

=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/DBTree.java Tue Jan 5 08:48:08 2010 +++ /trunk/src/ca/sqlpower/architect/swingui/DBTree.java Thu Jan 14 12:35:46 2010
@@ -1074,7 +1074,7 @@
         if (getSelectionPaths() == null) return;
         for (TreePath tp : getSelectionPaths()) {
             SQLObject obj = (SQLObject) tp.getLastPathComponent();
- if (!(obj instanceof SQLTable || obj instanceof SQLRelationship || obj instanceof SQLColumn)) { + if (!(obj instanceof SQLTable || obj instanceof SQLRelationship || obj instanceof SQLColumn || obj instanceof SQLRelationship.SQLImportedKey)) {
                 removeSelectionPath(tp);
             }
         }
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/RelationalPlayPenFactory.java Sat May 30 11:58:02 2009 +++ /trunk/src/ca/sqlpower/architect/swingui/RelationalPlayPenFactory.java Thu Jan 14 12:35:46 2010
@@ -324,6 +324,8 @@
if ((obj instanceof SQLTable || obj instanceof SQLRelationship || obj instanceof SQLColumn) &&
                             !objects.contains(obj)) {
                         objects.add(obj);
+ } else if (obj instanceof SQLRelationship.SQLImportedKey) { + objects.add(((SQLRelationship.SQLImportedKey) obj).getRelationship());
                     }
                 }
                 try {
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Tue Dec 22 13:57:05 2009 +++ /trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Thu Jan 14 12:35:46 2010
@@ -111,7 +111,24 @@

         @Override
         public String getShortDisplayName() {
-            return "Folder for " + containingChildType.getSimpleName();
+
+            if (containingChildType.isAssignableFrom(SQLColumn.class)) {
+                return "Columns folder for " + parentTable.getName();
+            }
+
+            if (containingChildType.isAssignableFrom(SQLIndex.class)) {
+                return "Indices folder for " + parentTable.getName();
+            }
+
+ if (containingChildType.isAssignableFrom(SQLRelationship.class)) {
+                return "Exported keys folder for " + parentTable.getName();
+            }
+
+ if (containingChildType.isAssignableFrom(SQLRelationship.SQLImportedKey.class)) {
+                return "Imported keys folder for " + parentTable.getName();
+            }
+
+ return containingChildType.getSimpleName() + "s folder for " + parentTable.getName();
         }

         @Override

Reply via email to