--- a/ResourceRetriever.st Fri Jan 09 17:07:47 1998 +0100
+++ b/ResourceRetriever.st Fri Jan 09 17:31:58 1998 +0100
@@ -20,6 +20,15 @@
category:'Interface-Support-UI'
!
+ResourceRetriever class instanceVariableNames:'LabelResources'
+
+"
+ The following class instance variables are inherited by this class:
+
+ Object -
+"
+!
+
!ResourceRetriever class methodsFor:'documentation'!
copyright
@@ -67,6 +76,55 @@
! !
+!ResourceRetriever class methodsFor:'accessing resource'!
+
+findResourceLabel: label in: aResourceOwner
+ "look for a string
+ in aResourceOwner,
+ in class of aResourceOwner,
+ in resources of class of aResourceOwner,
+ and finally in my label resources
+ "
+
+ aResourceOwner isNil ifTrue: [^label].
+
+ label isSymbol
+ ifTrue:
+ [
+ (aResourceOwner respondsTo: label)
+ ifTrue:
+ [
+ ^aResourceOwner perform: label
+ ].
+
+ (aResourceOwner isClass not and: [aResourceOwner class respondsTo: label])
+ ifTrue:
+ [
+ ^aResourceOwner perform: label
+ ].
+ ].
+
+ ((aResourceOwner isKindOf: ApplicationModel) or:
+ [aResourceOwner isKindOf: SimpleView])
+ ifTrue:
+ [
+ ^aResourceOwner resources string: label
+ ].
+
+ ^self labelResources string:label
+
+!
+
+labelResources
+ "if not already loaded, get the common label resourcePack
+ and return it"
+
+ LabelResources isNil ifTrue:[
+ LabelResources := ResourcePack for:self.
+ ].
+ ^ LabelResources
+! !
+
!ResourceRetriever methodsFor:'accessing'!
className