FileSelectionItem.st
changeset 786 bf1885e29419
parent 731 05ea1ee08afb
child 811 a688e8f11bc6
--- a/FileSelectionItem.st	Wed Feb 25 15:36:47 1998 +0100
+++ b/FileSelectionItem.st	Wed Feb 25 15:54:48 1998 +0100
@@ -13,8 +13,7 @@
 
 
 TreeItem subclass:#FileSelectionItem
-	instanceVariableNames:'modificationTime matchAction isDirectory imageType
-		haveToReadChildren showIndicator'
+	instanceVariableNames:'modificationTime matchAction isDirectory imageType showIndicator'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Support'
@@ -58,11 +57,11 @@
     icons and filter. Redefinging the icons you have to look especially for
     this methods:
 
-        class method:           iconsOn:          : returns a list of icons used
+        class method:           keysAndIcons      : returns a list of icons and access keys used
 
         instance method:        imageType         : get type of icon assigned to file
 
-                                drawableImageType : get the type of image to be drawn
+                                icon              : get the type of image to be drawn
 
     Especially suited for use with FileSelectionTree.
 
@@ -114,9 +113,9 @@
   ^ aPathname asFilename
 ! !
 
-!FileSelectionItem class methodsFor:'defaults'!
+!FileSelectionItem class methodsFor:'default icons'!
 
-iconsOn:aDevice
+keysAndIcons
     "returns an IdentityDictionary containing a list of images and keys used
      by any file entry.
     "
@@ -137,9 +136,8 @@
 
      ) do:[:el |
         image := Image fromFile:('xpmBitmaps/document_images/', el last ).
+
         image notNil ifTrue:[
-            image := image onDevice:aDevice.
-            image clearMaskedPixels.
             icons at:(el first) put:image.
         ]
     ].
@@ -153,13 +151,13 @@
 children
     "get's list of children
     "
-    haveToReadChildren ifTrue:[
+    readChildren ifTrue:[
         children := self readInChildren
     ].
   ^ children
 !
 
-drawableImageType
+icon
     "returns type of image to be drawn
     "
     (children size ~~ 0 and:[hide == false]) ifTrue:[
@@ -224,8 +222,8 @@
             ]
         ].
         parent notNil ifTrue:[                  "/ not for root
-            haveToReadChildren := true.
-            modificationTime   := nil.
+            readChildren     := true.
+            modificationTime := nil.
             children := OrderedCollection new.
         ]
     ]
@@ -240,8 +238,8 @@
         parent isNil ifTrue:[
             self allChildrenDo:[:aChild| aChild collapseAll ]
         ] ifFalse:[
-            haveToReadChildren := true.
-            modificationTime   := nil.
+            readChildren     := true.
+            modificationTime := nil.
             children := OrderedCollection new.
         ]
     ].
@@ -255,7 +253,7 @@
     contents    := aFilenname.
     name        := aBaseName.
     parent      := aParent.
-    isDirectory := haveToReadChildren := aBool.
+    isDirectory := readChildren := aBool.
 
     isDirectory ifFalse:[
         showIndicator := false
@@ -322,8 +320,8 @@
     ].
     (canCollapse and:[self isExpandable]) ifTrue:[
         parent notNil ifTrue:[                          "/ not the root directory
-            haveToReadChildren := true.
-            modificationTime   := nil.
+            readChildren := true.
+            modificationTime := nil.
             children := OrderedCollection new.
           ^ true.
         ]
@@ -332,10 +330,11 @@
 !
 
 showIndicator
-
+    "returns true if the node is a not empty directory
+    "
     showIndicator isNil ifTrue:[
         (self imageType == #directoryLocked) ifTrue:[
-            showIndicator := haveToReadChildren := false.
+            showIndicator := readChildren := false.
         ] ifFalse:[
             showIndicator := DirectoryContents directoryNamed:contents detect:matchAction
         ]
@@ -451,7 +450,7 @@
             ]
         ]
     ].
-    haveToReadChildren := false.
+    readChildren  := false.
     showIndicator := list size ~~ 0.
   ^ list
 ! !
@@ -506,5 +505,5 @@
 !FileSelectionItem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/FileSelectionItem.st,v 1.7 1998-02-05 15:38:44 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/FileSelectionItem.st,v 1.8 1998-02-25 14:54:48 ca Exp $'
 ! !