The Trunk: Protocols-cmm.60.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Protocols-cmm.60.mcz

commits-2
Chris Muller uploaded a new version of Protocols to project The Trunk:
http://source.squeak.org/trunk/Protocols-cmm.60.mcz

==================== Summary ====================

Name: Protocols-cmm.60
Author: cmm
Time: 25 April 2018, 6:21:41.762589 pm
UUID: acc5dbab-1470-4dbe-8432-b69ae91e544d
Ancestors: Protocols-ul.59

Make "show home category" of Protocol browsers behave similarly with Hierarchy and PackagePane browsers by letting it toggle both on and off instead of only on.

=============== Diff against Protocols-ul.59 ===============

Item was added:
+ ----- Method: Lexicon>>selectCategoryAll (in category 'category list') -----
+ selectCategoryAll
+ self categoryListIndex: (categoryList indexOf: self class allCategoryName)!

Item was removed:
- ----- Method: Lexicon>>setToShowSelector: (in category 'selection') -----
- setToShowSelector: aSelector
- "Set up the receiver so that it will show the given selector"
-
- | catName catIndex detectedItem messageIndex aList |
- catName := (aList := currentVocabulary categoriesContaining: aSelector  forClass: targetClass) size > 0
- ifTrue:
- [aList first]
- ifFalse:
- [self class allCategoryName].
- catIndex := categoryList indexOf: catName ifAbsent: [1].
- self categoryListIndex: catIndex.
- detectedItem := messageList detect:
- [:anItem | (anItem upTo: $ ) asString asSymbol == aSelector] ifNone: [^ self].
- messageIndex := messageList indexOf: detectedItem.
- self messageListIndex: messageIndex
- !

Item was added:
+ ----- Method: Lexicon>>setToShowSelector:selectCategory: (in category 'selection') -----
+ setToShowSelector: selectorString selectCategory: aBoolean
+ "Set up the receiver so that it will show the given selector"
+ | catName catIndex messageIndex aList |
+ catName := aBoolean
+ ifTrue:
+ [ (aList := currentVocabulary
+ categoriesContaining: selectorString
+ forClass: targetClass)
+ at: 1
+ ifAbsent: [ self class allCategoryName ] ]
+ ifFalse: [ self class allCategoryName ].
+ catIndex := categoryList
+ indexOf: catName
+ ifAbsent: [ 1 ].
+ self categoryListIndex: catIndex.
+ messageList
+ detect:
+ [ : anItem | (anItem upTo: Character space) asString asSymbol == selectorString ]
+ ifFound:
+ [ : detectedItem | messageIndex := messageList indexOf: detectedItem.
+ self messageListIndex: messageIndex ]
+ ifNone: [ ^ self ]!

Item was changed:
  ----- Method: Lexicon>>showHomeCategory (in category 'menu commands') -----
  showHomeCategory
+ "Toggle the selection of the category of the currently-selected method or category."
+ self selectedMessageName
+ ifNil:
+ [ self selectedCategoryName ifNotNil: [ self selectCategoryAll ] ]
+ ifNotNil:
+ [ : selector | self selectedCategoryName = self class allCategoryName
+ ifTrue:
+ [ self preserveSelectorIfPossibleSurrounding:
+ [ self
+ setToShowSelector: selector
+ selectCategory: true ] ]
+ ifFalse:
+ [ self
+ setToShowSelector: selector
+ selectCategory: false ] ]!
- "Continue to show the current selector, but show it within the context of its primary category"
-
- | aSelector |
- (aSelector := self selectedMessageName) ifNotNil:
- [self preserveSelectorIfPossibleSurrounding:
- [self setToShowSelector: aSelector]]!