SelectionInTreeView.st
changeset 2688 2d853020325f
parent 2659 3af857eb52fb
child 2689 c382886ddb08
--- a/SelectionInTreeView.st	Thu Mar 25 09:17:36 2004 +0100
+++ b/SelectionInTreeView.st	Fri Mar 26 12:35:42 2004 +0100
@@ -1752,12 +1752,12 @@
 
     (value := selectionHolder value) isNil ifFalse:[
         (multipleSelectOk and:[value isCollection]) ifFalse:[
-            ^ self selectNode:value
+            ^ self selectNode:value withNotify:false.
         ].
 
         (size := value size) ~~ 0 ifTrue:[
             size == 1 ifTrue:[
-                ^ self selectNode:(value at:1)
+                ^ self selectNode:(value at:1) withNotify:false
             ].
 
             model doMakeVisible:value.
@@ -1777,7 +1777,7 @@
             ].
         ].
     ].
-    self selection:coll
+    self setSelection:coll
 !
 
 selectionToModel
@@ -2199,6 +2199,12 @@
 selectNode:aNode
     "change selection to a node
     "
+    ^ self selectNode:aNode withNotify:true.
+!
+
+selectNode:aNode withNotify:withNotify
+    "change selection to a node
+    "
     |index|
 
     (index := aNode) notNil ifTrue:[
@@ -2212,17 +2218,28 @@
             index := nil
         ]
     ].
-    self selection:index 
-
-
+    withNotify ifFalse:[
+        self setSelection:index
+    ] ifTrue:[
+        self selection:index 
+    ].
 !
 
 selectNodes:aCollectionOfNodes
+    ^ self selectNode:aCollectionOfNodes withNotify:true.
+!
+
+selectNodes:aCollectionOfNodes withNotify:withNotify
     |selIndexCollection|
 
     selIndexCollection := aCollectionOfNodes collect:[:eachNode | listOfNodes identityIndexOf:eachNode].
     selIndexCollection := selIndexCollection reject:[:eachIndex | eachIndex == 0].
-    self selection:selIndexCollection.
+
+    withNotify ifTrue:[
+        self selection:selIndexCollection.
+    ] ifFalse:[
+        self setSelection:selIndexCollection.
+    ].
 
 "/    first := true.
 "/    aCollectionOfNodes do:[:eachNode |
@@ -2471,5 +2488,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.104 2004-02-26 12:18:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.105 2004-03-26 11:35:42 ca Exp $'
 ! !