cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r793489 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
Date Mon, 13 Jul 2009 08:30:01 GMT
Author: aadamchik
Date: Mon Jul 13 08:30:01 2009
New Revision: 793489

URL: http://svn.apache.org/viewvc?rev=793489&view=rev
Log:
CAY-1240 Schema generation dialog has "uncheck all tables" checkbox incorrectly checked by
default

patch by Olga Tkachova

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=793489&r1=793488&r2=793489&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Mon Jul 13 08:30:01 2009
@@ -26,6 +26,7 @@
 CAY-1169 Weird behavior when adding entity via merging
 CAY-1224 reverse engineering partially changed schema shows empty error messge window
 CAY-1232 Unit tests failing on Sybase
+CAY-1240 Schema generation dialog has "uncheck all tables" checkbox incorrectly checked by
default
 
 ----------------------------------
 Release: 3.0M6

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java?rev=793489&r1=793488&r2=793489&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
Mon Jul 13 08:30:01 2009
@@ -22,8 +22,8 @@
 import java.awt.Component;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -53,7 +53,9 @@
     protected int permanentlyExcludedCount;
     protected Map excludedTables;
     protected List<DbEntity> selectableTablesList;
+
     protected Map validationMessages;
+  
 
     public TableSelectorController(ProjectController parent) {
         super(parent);
@@ -107,10 +109,10 @@
         else {
             excludedTables.put(table.getName(), table);
         }
-        
+
         tableSelectedAction();
     }
-    
+
     /**
      * A callback action that updates the state of Select All checkbox.
      */
@@ -132,6 +134,7 @@
     // ------ other stuff ------
 
     protected void initController() {
+
         BindingBuilder builder = new BindingBuilder(
                 getApplication().getBindingFactory(),
                 this);
@@ -191,11 +194,13 @@
                     DbAttribute failedAttribute = (DbAttribute) nextProblem
                             .getValidatedObject();
                     failedEntity = failedAttribute.getEntity();
-                } else if (nextProblem.getValidatedObject() instanceof DbRelationship) {
+                }
+                else if (nextProblem.getValidatedObject() instanceof DbRelationship) {
                     DbRelationship failedRelationship = (DbRelationship) nextProblem
                             .getValidatedObject();
                     failedEntity = failedRelationship.getSourceEntity();
-                } else if (nextProblem.getValidatedObject() instanceof DbEntity) {
+                }
+                else if (nextProblem.getValidatedObject() instanceof DbEntity) {
                     failedEntity = (Entity) nextProblem.getValidatedObject();
                 }
 
@@ -224,12 +229,20 @@
     public void checkAllAction() {
 
         boolean isCheckAllSelected = view.getCheckAll().isSelected();
-        
-        // now do a pass through the selectable tables and reset selected status
-        for (DbEntity table : selectableTablesList) {
-            setIncluded(isCheckAllSelected);
+
+        if (isCheckAllSelected) {
+            selectableTablesList.clear();
+            selectableTablesList.addAll(tables);
+            excludedTables.clear();
         }
-        
+        else {
+            excludedTables.clear();
+            for (DbEntity table : tables) {
+                excludedTables.put(table.getName(), table);
+            }
+            selectableTablesList.clear();
+        }
+
         tableBinding.updateView();
     }
 }



Mime
View raw message