Revision: 3454
Author: ferguson.sebastian
Date: Wed Apr 14 07:49:36 2010
Log: New type objects are hidden in the UI, and some of their properties are ignored in tests
http://code.google.com/p/power-architect/source/detail?r=3454

Modified:
 /trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java
 /trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java

=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java Fri Apr 9 08:41:23 2010 +++ /trunk/regress/ca/sqlpower/architect/swingui/TestSwingUIProject.java Wed Apr 14 07:49:36 2010
@@ -663,7 +663,15 @@
                propertiesToIgnore.add("parentTable");
                propertiesToIgnore.add("undoEventListeners");
                propertiesToIgnore.add("secondaryChangeMode");
-
+               propertiesToIgnore.add("constraintType");
+               propertiesToIgnore.add("checkConstraint");
+               propertiesToIgnore.add("enumeration");
+               propertiesToIgnore.add("precisionType");
+               propertiesToIgnore.add("scaleType");
+               propertiesToIgnore.add("platform");
+
+               propertiesToIgnore.add("childrenWithoutPopulating");
+
                session.getUndoManager().setLoading(true);
                Map<String,Object> oldDescription =
                        TestUtils.setAllInterestingProperties(target, 
propertiesToIgnore);
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java Tue Apr 6 14:44:35 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java Wed Apr 14 07:49:36 2010
@@ -81,6 +81,8 @@
 import ca.sqlpower.sqlobject.SQLRelationship;
 import ca.sqlpower.sqlobject.SQLSchema;
 import ca.sqlpower.sqlobject.SQLTable;
+import ca.sqlpower.sqlobject.SQLTypePhysicalProperties;
+import ca.sqlpower.sqlobject.UserDefinedSQLType;
 import ca.sqlpower.sqlobject.SQLRelationship.SQLImportedKey;
 import ca.sqlpower.util.ExceptionReport;
 import ca.sqlpower.util.SQLPowerUtils;
@@ -1456,7 +1458,9 @@
                     ioo.println(out, "</folder>");
                     ioo.println(out, indicesFolder);
                 }
-                if ( ! (child instanceof SQLRelationship)) {
+                if (!((child instanceof SQLRelationship)
+                        || (child instanceof UserDefinedSQLType)
+                        || (child instanceof SQLTypePhysicalProperties))) {
                     saveSQLObject(out, child);
                 }
                 lastChild = child;
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Fri Apr 9 08:41:23 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Wed Apr 14 07:49:36 2010
@@ -501,6 +501,8 @@
                    return ((FolderNode) parent).getChildren().size();
         } else if (parent instanceof SQLTable) {
             return foldersInTables.get((SQLTable) parent).size();
+        } else if (parent instanceof SQLColumn) {
+            return 0;
         }

                SQLObject sqlParent = (SQLObject) parent;
@@ -516,6 +518,8 @@
if (logger.isDebugEnabled()) logger.debug("DBTreeModel.isLeaf("+parent+"): returning "+!((SQLObject) parent).allowsChildren()); //$NON-NLS-1$ //$NON-NLS-2$
                if (parent instanceof FolderNode) {
                    return false;
+               } else if (parent instanceof SQLColumn) {
+                   return true;
                }
                return !((SQLObject) parent).allowsChildren();
        }


--
To unsubscribe, reply using "remove me" as the subject.

Reply via email to