DirectoryTreeBrowser.st
changeset 6337 76a3f145aaad
parent 6250 5b0673ccff1c
child 6502 ce6d9b874420
--- a/DirectoryTreeBrowser.st	Tue Jul 05 17:53:56 2005 +0200
+++ b/DirectoryTreeBrowser.st	Wed Jul 06 10:02:00 2005 +0200
@@ -924,12 +924,12 @@
         anItem isDirectory ifTrue:[
             anItem makeIconGray:true.
             anItem changed:#icon.
-            (anItem notNil and:[anItem isDirectory and:[anItem fileName isWritable]]) ifTrue:[
-                expandItemTimedBlock := [
-                        self expandForDrop:anItem with:aDropContext.    
-                ].
-                Processor addTimedBlock:expandItemTimedBlock
-                    afterMilliseconds:(self class timeForExpandOnDropInMilliseconds).
+            (anItem notNil and:[anItem isDirectory and:[anItem isWritable]]) ifTrue:[
+                self 
+                    setupAutoExpandItemTimedBlock:
+                        [
+                            self expandForDrop:anItem with:aDropContext.    
+                        ].
             ]
         ].
     ].
@@ -972,11 +972,19 @@
 !
 
 removeExpandItemTimedBlock
+    |b|
 
-    expandItemTimedBlock notNil ifTrue:[
-        Processor removeTimedBlock:expandItemTimedBlock.
-        expandItemTimedBlock := nil
+    (b := expandItemTimedBlock) notNil ifTrue:[
+        expandItemTimedBlock := nil.
+        Processor removeTimedBlock:b.
     ]
+!
+
+setupAutoExpandItemTimedBlock:aBlock
+    expandItemTimedBlock := aBlock.
+    Processor 
+        addTimedBlock:expandItemTimedBlock
+        afterMilliseconds:(self class timeForExpandOnDropInMilliseconds).
 ! !
 
 !DirectoryTreeBrowser methodsFor:'event handling'!
@@ -1318,5 +1326,5 @@
 !DirectoryTreeBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.94 2005-04-14 09:13:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.95 2005-07-06 08:01:30 cg Exp $'
 ! !