changed: #iconFor:
authorClaus Gittinger <cg@exept.de>
Sat, 30 Jan 2010 13:49:59 +0100
changeset 3870 18c8952dc8cc
parent 3869 20d5ddff9541
child 3871 185109a66d51
changed: #iconFor:
HierarchicalListView.st
--- a/HierarchicalListView.st	Thu Jan 14 17:47:54 2010 +0100
+++ b/HierarchicalListView.st	Sat Jan 30 13:49:59 2010 +0100
@@ -1396,7 +1396,8 @@
 
 iconFor:anItem
     "returns an icon or image for the item or nil if the item
-     provides no image and #useDefaultIcons is switched off.
+     provides no image and useDefaultIcons is switched off,
+     or if anItem returns #none from the icon query.
     "
     |iconOrKey image|
 
@@ -1404,33 +1405,34 @@
     iconOrKey := anItem icon.
 
     iconOrKey notNil ifTrue:[
-	iconOrKey isImageOrForm ifTrue:[
-	    "/ got an image; have to register the image on my device
+        iconOrKey isImageOrForm ifTrue:[
+            "/ got an image; have to register the image on my device
 
-	    iconOrKey device == device ifTrue:[
-		^ iconOrKey
-	    ].
-	    ^ icons at:iconOrKey ifAbsentPut:[ self imageOnMyDevice:iconOrKey ].
-	].
+            iconOrKey device == device ifTrue:[
+                ^ iconOrKey
+            ].
+            ^ icons at:iconOrKey ifAbsentPut:[ self imageOnMyDevice:iconOrKey ].
+        ].
+        iconOrKey == #none ifTrue:[^ nil].
 
-	image := icons at:iconOrKey ifAbsent:nil.
-	image notNil ifTrue:[ ^ image ].
+        image := icons at:iconOrKey ifAbsent:nil.
+        image notNil ifTrue:[ ^ image ].
     ].
 
     "/ test whether a default image should be returned
     useDefaultIcons ifFalse:[
-	^ nil
+        ^ nil
     ].
 
     anItem hasChildren ifFalse:[
-	anItem isDirectoryItem ifFalse:[
-	    ^ icons at:#empty ifAbsentPut:[ self imageOnMyDevice:(self class emptyIcon) ]
-	].
-	^ icons at:#collapsed ifAbsentPut:[ self imageOnMyDevice:(self class collapsedIcon) ].
+        anItem isDirectoryItem ifFalse:[
+            ^ icons at:#empty ifAbsentPut:[ self imageOnMyDevice:(self class emptyIcon) ]
+        ].
+        ^ icons at:#collapsed ifAbsentPut:[ self imageOnMyDevice:(self class collapsedIcon) ].
     ].
 
     anItem isExpanded ifTrue:[
-	^ icons at:#expanded ifAbsentPut:[ self imageOnMyDevice:(self class expandedIcon) ].
+        ^ icons at:#expanded ifAbsentPut:[ self imageOnMyDevice:(self class expandedIcon) ].
     ].
     ^ icons at:#collapsed ifAbsentPut:[ self imageOnMyDevice:(self class collapsedIcon) ].
 
@@ -1736,9 +1738,9 @@
 !HierarchicalListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.116 2009-11-05 19:55:57 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.117 2010-01-30 12:49:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.116 2009-11-05 19:55:57 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.117 2010-01-30 12:49:59 cg Exp $'
 ! !