[squeak-dev] The Inbox: Protocols-fbs.35.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 23 22:02:59 UTC 2011
A new version of Protocols was added to project The Inbox:
http://source.squeak.org/inbox/Protocols-fbs.35.mcz
==================== Summary ====================
Name: Protocols-fbs.35
Author: fbs
Time: 23 March 2011, 10:02:53.316 pm
UUID: 930d5235-78cd-984b-9a2a-771b9555304f
Ancestors: Protocols-ul.34
Removal of messageListIndex references. ProtocolBrowser>>open(Full|Sub)ProtocolForClass: returns the model.
=============== Diff against Protocols-ul.34 ===============
Item was changed:
----- Method: Lexicon>>categoryListIndex: (in category 'category list') -----
categoryListIndex: anIndex
"Set the category list index as indicated"
| categoryName aList found existingSelector |
existingSelector := self selectedMessageName.
categoryListIndex := anIndex.
anIndex > 0
ifTrue:
[categoryName := categoryList at: anIndex]
ifFalse:
[contents := nil].
self changed: #categoryListIndex.
found := false.
#( (viewedCategoryName selectorsVisited)
(queryCategoryName selectorsRetrieved)) do:
[:pair |
categoryName = (self class perform: pair first)
ifTrue:
[aList := self perform: pair second.
found := true]].
found ifFalse:
[aList := currentVocabulary allMethodsInCategory: categoryName forInstance: self targetObject ofClass: targetClass].
categoryName = self class queryCategoryName ifFalse: [autoSelectString := nil].
self initListFrom: aList highlighting: targetClass.
messageListIndex := 0.
+ selectedMessageName := nil.
self changed: #messageList.
contents := nil.
self contentsChanged.
self selectWithinCurrentCategoryIfPossible: existingSelector.
self adjustWindowTitle!
Item was changed:
----- Method: Lexicon>>removeMessage (in category 'menu commands') -----
removeMessage
"Remove the selected message from the system."
+ self hasMessageSelected ifFalse: [^ self].
- messageListIndex = 0 ifTrue: [^ self].
self okToChange ifFalse: [^ self].
super removeMessage.
"my #reformulateList method, called from the super #removeMethod method, will however try to preserve the selection, so we take pains to clobber it by the below..."
messageListIndex := 0.
+ selectedMessageName := nil.
self changed: #messageList.
self changed: #messageListIndex.
contents := nil.
self contentsChanged!
Item was changed:
----- Method: Lexicon>>setMethodListFromSearchString (in category 'search') -----
setMethodListFromSearchString
"Set the method list of the receiver based on matches from the search string"
| fragment aList |
self okToChange ifFalse: [^ self].
fragment := currentQueryParameter.
fragment := fragment asString asLowercase withBlanksTrimmed.
aList := targetClass allSelectors select:
[:aSelector | currentVocabulary includesSelector: aSelector forInstance: self targetObject ofClass: targetClass limitClass: limitClass].
fragment size > 0 ifTrue:
[aList := aList select:
[:aSelector | aSelector includesSubstring: fragment caseSensitive: false]].
aList size = 0 ifTrue:
[^ Beeper beep].
self initListFrom: aList asSortedArray highlighting: targetClass.
messageListIndex := messageListIndex min: messageList size.
+ (aList includes: selectedMessageName)
+ ifFalse: [selectedMessageName := aList asSortedArray last].
self changed: #messageList
!
Item was changed:
----- Method: ProtocolBrowser classSide>>openFullProtocolForClass: (in category 'instance creation') -----
openFullProtocolForClass: aClass
"Create and schedule a browser for the entire protocol of the class."
"ProtocolBrowser openFullProtocolForClass: ProtocolBrowser."
| aPBrowser label |
aPBrowser := ProtocolBrowser new on: aClass.
label := 'Entire protocol of: ', aClass name.
+ ^ (self open: aPBrowser name: label) model!
- self open: aPBrowser name: label!
Item was changed:
----- Method: ProtocolBrowser classSide>>openSubProtocolForClass: (in category 'instance creation') -----
openSubProtocolForClass: aClass
"Create and schedule a browser for the entire protocol of the class."
"ProtocolBrowser openSubProtocolForClass: ProtocolBrowser."
| aPBrowser label |
aPBrowser := ProtocolBrowser new onSubProtocolOf: aClass.
label := 'Sub-protocol of: ', aClass name.
+ ^ (self open: aPBrowser name: label) model.!
- self open: aPBrowser name: label!
More information about the Squeak-dev
mailing list
|