Nicolas Cellier uploaded a new version of FlexibleVocabularies to project The Trunk:
http://source.squeak.org/trunk/FlexibleVocabularies-nice.6.mcz==================== Summary ====================
Name: FlexibleVocabularies-nice.6
Author: nice
Time: 19 October 2009, 11:27:09 am
UUID: 3db451ba-875e-f742-a59c-93e5dff787f1
Ancestors: FlexibleVocabularies-al.5
use #fasterKeys
=============== Diff against FlexibleVocabularies-al.5 ===============
Item was changed:
----- Method: Morph class>>unfilteredCategoriesForViewer (in category '*flexibleVocabularies-flexiblevocabularies-scripting') -----
unfilteredCategoriesForViewer
"Answer a list of symbols representing the categories to offer in the viewer for one of my instances, in order of:
- masterOrderingOfCategorySymbols first
- others last in order by translated wording"
"
Morph unfilteredCategoriesForViewer
"
| aClass additions masterOrder |
aClass := self.
additions := OrderedCollection new.
[aClass == Morph superclass ] whileFalse: [
+ additions addAll: (aClass allAdditionsToViewerCategories fasterKeys
+ sort: [ :a :b | a translated < b translated ]).
- additions addAll: (aClass allAdditionsToViewerCategories keys
- asSortedCollection: [ :a :b | a translated < b translated ]).
aClass := aClass superclass ].
masterOrder := EToyVocabulary masterOrderingOfCategorySymbols.
^(masterOrder intersection: additions), (additions difference: masterOrder).!
Item was changed:
----- Method: Morph>>categoriesForViewer (in category '*flexiblevocabularies-scripting') -----
categoriesForViewer
"Answer a list of symbols representing the categories to offer in the
viewer, in order"
+ | dict |
- | dict aList |
dict := Dictionary new.
self unfilteredCategoriesForViewer
withIndexDo: [:cat :index | dict at: cat put: index].
self filterViewerCategoryDictionary: dict.
+ ^ dict fasterKeys sort: [:a :b | (dict at: a)
+ < (dict at: b)]!
- aList := SortedCollection
- sortBlock: [:a :b | (dict at: a)
- < (dict at: b)].
- aList addAll: dict keys.
- ^ aList asArray!