changed: #updateList
authorClaus Gittinger <cg@exept.de>
Mon, 05 Mar 2012 11:04:04 +0100
changeset 11360 491ac5f4cbca
parent 11359 911eaee39d50
child 11361 6b9a08f63775
changed: #updateList try to keep the selection, when changing classes (especially: when navigating along the hierarchy)
Tools__VariableList.st
--- a/Tools__VariableList.st	Mon Mar 05 11:03:15 2012 +0100
+++ b/Tools__VariableList.st	Mon Mar 05 11:04:04 2012 +0100
@@ -660,20 +660,24 @@
 
     newList ~= variableList value ifTrue:[
         selectedVariablesHolder := self selectedVariableEntries.
-        prevSelection := (selectedVariablesHolder value copy) ? #().
+        prevSelection := (self selectedVariables value "selectedVariablesHolder value" copy) ? #().
         variableList value:newList.
 
-        newSelection := prevSelection select:[:item | newList includes:item].
+        newSelection := newList select:[:item | prevSelection includes:item string].
+"/         newSelection := prevSelection select:[:item | newList includes:item].
 
         newSelection size > 0 ifTrue:[
             "/ force change (for dependents)
-            selectedVariablesHolder value:nil.
-            selectedVariablesHolder value:newSelection.
+            "/ selectedVariablesHolder value:nil.
+            selectedVariablesHolder 
+                setValue:newSelection;
+                changed.
         ] ifFalse:[
             prevSelection := selectedVariablesHolder value.
             selectedVariablesHolder value:nil.
         ].
-        (prevSelection size > 0 or:[newSelection size > 0]) ifTrue:[
+        (prevSelection size > 0 or:[newSelection size > 0
+        "and:[ prevSelection ~= newSelection]"]) ifTrue:[
             self updateOutputGenerator.
         ].
     ].
@@ -687,6 +691,7 @@
     listValid := true.
 
     "Modified: / 05-08-2011 / 12:34:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-03-2012 / 13:29:11 / cg"
 ! !
 
 !VariableList::VariableEntry class methodsFor:'instance creation'!
@@ -814,5 +819,5 @@
 !VariableList class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.15 2012-03-01 09:24:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.16 2012-03-05 10:04:04 cg Exp $'
 ! !