Nicolas Cellier uploaded a new version of FlexibleVocabularies to project The Trunk:
http://source.squeak.org/trunk/FlexibleVocabularies-nice.7.mcz==================== Summary ====================
Name: FlexibleVocabularies-nice.7
Author: nice
Time: 20 October 2009, 9:32:37 am
UUID: 9be75f3b-aaff-45cf-bf25-820207690e50
Ancestors: FlexibleVocabularies-nice.6
Track selectors usage, use #selectorsDo:
=============== Diff against FlexibleVocabularies-nice.6 ===============
Item was changed:
----- Method: Morph class>>allAdditionsToViewerCategories (in category '*flexibleVocabularies-flexiblevocabularies-scripting') -----
allAdditionsToViewerCategories
"Answer a Dictionary of (<categoryName> <list of category specs>) that
defines the phrases this kind of morph wishes to add to various Viewer categories.
This version allows each category definition to be defined in one or more separate methods.
Subclasses that have additions can either:
- override #additionsToViewerCategories, or
- (preferably) define one or more additionToViewerCategory* methods.
The advantage of the latter technique is that class extensions may be added by
external packages without having to re-define additionsToViewerCategories."
"
Morph allAdditionsToViewerCategories
"
| dict |
dict := IdentityDictionary new.
(self class includesSelector: #additionsToViewerCategories)
ifTrue: [self additionsToViewerCategories
do: [:group | group
pairsDo: [:key :list | (dict
at: key
ifAbsentPut: [OrderedCollection new])
addAll: list]]].
+ self class selectorsDo:
+ [:aSelector | ((aSelector beginsWith: 'additionsToViewerCategory')
- self class selectors
- do: [:aSelector | ((aSelector beginsWith: 'additionsToViewerCategory')
and: [(aSelector at: 26 ifAbsent: []) ~= $:])
ifTrue: [(self perform: aSelector)
pairsDo: [:key :list | (dict
at: key
ifAbsentPut: [OrderedCollection new])
addAll: list]]].
^ dict!