changed:
#fromLiteralArrayEncoding:
#resource
When fetching icon, do #visualFor: on class, too
--- a/ResourceRetriever.st Wed Mar 23 19:49:16 2011 +0100
+++ b/ResourceRetriever.st Thu Mar 24 16:55:44 2011 +0100
@@ -257,10 +257,12 @@
|img cls|
- resource notNil ifTrue:[^ resource].
+ resource notNil ifTrue:[
+ ^ resource
+ ].
selector isNil ifTrue:[
- ^nil
+ ^ nil
].
resourceOwner isNil ifTrue:[
@@ -282,9 +284,14 @@
resourceOwner isClass ifFalse:[
cls := resourceOwner class.
+ (cls respondsTo:#visualFor:) ifTrue:[
+ (img := cls visualFor:selector) notNil ifTrue:[
+ ^ img
+ ]
+ ].
(cls respondsTo:selector) ifTrue:[
^ cls perform:selector
- ]
+ ].
].
^ nil
@@ -294,8 +301,8 @@
!ResourceRetriever methodsFor:'converting'!
fromLiteralArrayEncoding:anArray
- "read my values from an encoding.
- "
+ "read my values from an encoding."
+
className := anArray at: 2.
selector := anArray at: 3.
@@ -303,7 +310,6 @@
labelText := anArray at:4
].
resourceOwner := nil.
-
!
literalArrayEncoding
@@ -349,5 +355,9 @@
!ResourceRetriever class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/ResourceRetriever.st,v 1.13 2008-09-03 08:40:35 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/ResourceRetriever.st,v 1.14 2011-03-24 15:55:44 stefan Exp $'
+!
+
+version_CVS
+ ^ '$Header: /cvs/stx/stx/libview2/ResourceRetriever.st,v 1.14 2011-03-24 15:55:44 stefan Exp $'
! !