find all images in getAllImageSelectorsFrom: (walk superclass chain)
authorClaus Gittinger <cg@exept.de>
Mon, 24 Aug 1998 21:54:38 +0200
changeset 971 f3b1476f5006
parent 970 23d20044894f
child 972 d7500cfc7ba4
find all images in getAllImageSelectorsFrom: (walk superclass chain)
MenuEditor.st
--- a/MenuEditor.st	Mon Aug 24 21:49:52 1998 +0200
+++ b/MenuEditor.st	Mon Aug 24 21:54:38 1998 +0200
@@ -1758,6 +1758,38 @@
       )
 ! !
 
+!MenuEditor class methodsFor:'queries'!
+
+getAllImageSelectorsFrom: aClass
+    "returns all image selectors implementing an image spec in class aClass"
+
+     |iconClass imageMethodSelectors r|
+
+     aClass isNil ifTrue:[
+        ^ #()
+     ].
+
+     aClass isSymbol 
+        ifTrue:  [iconClass := Smalltalk at: aClass]
+        ifFalse: [iconClass := aClass].
+
+     imageMethodSelectors := OrderedCollection new.
+
+     iconClass withAllSuperclasses do:[:cls |
+        cls class methodDictionary keysAndValuesDo: [:sel :m | 
+            (r := m resourceType == #image
+            or:[r == #programImage]) ifTrue:[
+                imageMethodSelectors add:sel
+            ]
+        ]
+     ].
+
+     ^ imageMethodSelectors asSortedCollection asOrderedCollection
+
+    "Modified: / 24.8.1998 / 21:42:34 / cg"
+    "Created: / 24.8.1998 / 21:53:20 / cg"
+! !
+
 !MenuEditor class methodsFor:'slices'!
 
 slicesItem