[Pkg] The Trunk: Tools-fbs.331.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 20 23:19:26 UTC 2011
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-fbs.331.mcz
==================== Summary ====================
Name: Tools-fbs.331
Author: fbs
Time: 29 March 2011, 5:16:05.399 pm
UUID: 3e751cb5-9244-8047-8cf9-0d1a1aef81ec
Ancestors: Tools-fbs.330
Browser no longer references messageListIndex at all. I'll save the reshaping to the next commit (which will move it to MessageSet). Places that referenced messageListIndex pushed down to MessageSet.
=============== Diff against Tools-fbs.330 ===============
Item was changed:
----- Method: Browser>>compileMessage:notifying: (in category 'code pane') -----
compileMessage: aText notifying: aController
"Compile the code that was accepted by the user, placing the compiled method into an appropriate message category. Return true if the compilation succeeded, else false."
+ | fallBackCategoryIndex originalSelectorName result fallBackMethodName |
- | fallBackCategoryIndex fallBackMethodIndex originalSelectorName result fallBackMethodName |
self selectedMessageCategoryName ifNil:
[ self selectOriginalCategoryForCurrentMethod
ifFalse:["Select the '--all--' category"
self messageCategoryListIndex: 1]].
self selectedMessageCategoryName asSymbol = ClassOrganizer allCategory
ifTrue:
[ "User tried to save a method while the ALL category was selected"
fallBackCategoryIndex := messageCategoryListIndex.
- fallBackMethodIndex := messageListIndex.
fallBackMethodName := selectedMessageName.
editSelection == #newMessage
ifTrue:
[ "Select the 'as yet unclassified' category"
messageCategoryListIndex := 0.
(result := self defineMessageFrom: aText notifying: aController)
ifNil:
["Compilation failure: reselect the original category & method"
messageCategoryListIndex := fallBackCategoryIndex.
- messageListIndex := fallBackMethodIndex.
selectedMessageName := fallBackMethodName]
ifNotNil:
[self setSelector: result]]
ifFalse:
[originalSelectorName := self selectedMessageName.
self setOriginalCategoryIndexForCurrentMethod.
+ selectedMessageName := fallBackMethodName := originalSelectorName.
- messageListIndex := fallBackMethodIndex := self messageList indexOf: originalSelectorName.
(result := self defineMessageFrom: aText notifying: aController)
ifNotNil:
[self setSelector: result]
ifNil:
[ "Compilation failure: reselect the original category & method"
messageCategoryListIndex := fallBackCategoryIndex.
- messageListIndex := fallBackMethodIndex.
selectedMessageName := fallBackMethodName.
^ result notNil]].
self changed: #messageCategoryList.
^ result notNil]
ifFalse:
[ "User tried to save a method while the ALL category was NOT selected"
^ (self defineMessageFrom: aText notifying: aController) notNil]!
Item was changed:
----- Method: Browser>>messageCategoryListIndex: (in category 'message category list') -----
messageCategoryListIndex: anInteger
"Set the selected message category to be the one indexed by anInteger."
messageCategoryListIndex := anInteger.
- messageListIndex := 0.
selectedMessageName := nil.
self changed: #messageCategorySelectionChanged.
self changed: #messageCategoryListIndex. "update my selection"
self changed: #messageList.
self editSelection: (anInteger > 0
ifTrue: [#newMessage]
ifFalse: [self hasClassSelected
ifTrue: [#editClass]
ifFalse: [#newClass]]).
contents := nil.
self contentsChanged.!
Item was changed:
----- Method: Browser>>metaClassIndicated: (in category 'metaclass') -----
metaClassIndicated: trueOrFalse
"Indicate whether browsing instance or class messages."
metaClassIndicated := trueOrFalse.
self setClassOrganizer.
self hasSystemCategorySelected ifTrue:
[self editSelection: (self hasClassSelected
ifFalse: [metaClassIndicated
ifTrue: [#none]
ifFalse: [#newClass]]
ifTrue: [#editClass])].
messageCategoryListIndex := 0.
- messageListIndex := 0.
selectedMessageName := nil.
contents := nil.
self changed: #classSelectionChanged.
self changed: #messageCategoryList.
self changed: #messageList.
self changed: #contents.
self changed: #annotation.
self decorateButtons
!
Item was changed:
----- Method: Browser>>selectMessageNamed: (in category 'message list') -----
selectMessageNamed: aSymbolOrString
| name |
name := aSymbolOrString ifNotNil: [ aSymbolOrString asSymbol ].
selectedMessageName := name.
- messageListIndex := self messageListIndexOf: name.
self editSelection: (name notNil
ifTrue: [#editMessage]
ifFalse: [self messageCategoryListIndex > 0
ifTrue: [#newMessage]
ifFalse: [self hasClassSelected
ifTrue: [#editClass]
ifFalse: [#newClass]]]).
contents := nil.
self changed: #messageListIndex. "update my selection"
self contentsChanged.
self decorateButtons.!
Item was changed:
----- Method: Browser>>selectOriginalCategoryForCurrentMethod (in category 'message category list') -----
selectOriginalCategoryForCurrentMethod
"private - Select the message category for the current method.
Note: This should only be called when somebody tries to save
a method that they are modifying while ALL is selected.
Returns: true on success, false on failure."
| aSymbol selectorName |
aSymbol := self categoryOfCurrentMethod.
selectorName := self selectedMessageName.
(aSymbol notNil and: [aSymbol ~= ClassOrganizer allCategory])
ifTrue:
[messageCategoryListIndex := (self messageCategoryList indexOf: aSymbol).
- messageListIndex := (self messageList indexOf: selectorName).
selectedMessageName := selectorName.
self changed: #messageCategorySelectionChanged.
self changed: #messageCategoryListIndex. "update my selection"
self changed: #messageList.
self changed: #messageListIndex.
^ true].
^ false!
Item was changed:
----- Method: Browser>>selectSystemCategory: (in category 'system category list') -----
selectSystemCategory: aSymbol
"Set the selected system category. Update all other selections to be deselected."
selectedSystemCategory := aSymbol.
selectedClassName := nil.
messageCategoryListIndex := 0.
- messageListIndex := 0.
selectedMessageName := nil.
self editSelection: ( aSymbol isNil ifTrue: [#none] ifFalse: [#newClass]).
metaClassIndicated := false.
self setClassOrganizer.
contents := nil.
self changed: #systemCategorySelectionChanged.
self changed: #systemCategoryListIndex. "update my selection"
self changed: #classList.
self changed: #messageCategoryList.
self changed: #messageList.
self changed: #relabel.
self contentsChanged!
Item was changed:
----- Method: Browser>>systemOrganizer: (in category 'initialize-release') -----
systemOrganizer: aSystemOrganizer
"Initialize the receiver as a perspective on the system organizer,
aSystemOrganizer. Typically there is only one--the system variable
SystemOrganization."
contents := nil.
systemOrganizer := aSystemOrganizer.
selectedSystemCategory := nil.
selectedClassName := nil.
messageCategoryListIndex := 0.
- messageListIndex := 0.
selectedMessageName := nil.
metaClassIndicated := false.
self setClassOrganizer.
self editSelection: #none.!
Item was changed:
----- Method: Browser>>veryDeepInner: (in category 'copying') -----
veryDeepInner: deepCopier
"Copy all of my instance variables. Some need to be not copied at all, but shared. See DeepCopier class comment."
super veryDeepInner: deepCopier.
"systemOrganizer := systemOrganizer. clone has the old value. we share it"
"classOrganizer := classOrganizer clone has the old value. we share it"
"metaClassOrganizer := metaClassOrganizer clone has the old value. we share it"
selectedSystemCategory := selectedSystemCategory veryDeepCopyWith: deepCopier.
selectedClassName := selectedClassName veryDeepCopyWith: deepCopier.
messageCategoryListIndex := messageCategoryListIndex veryDeepCopyWith: deepCopier.
- messageListIndex := messageListIndex veryDeepCopyWith: deepCopier.
selectedMessageName := selectedMessageName veryDeepCopyWith: deepCopier.
editSelection := editSelection veryDeepCopyWith: deepCopier.
metaClassIndicated := metaClassIndicated veryDeepCopyWith: deepCopier.
!
Item was added:
+ ----- Method: MessageSet>>compileMessage:notifying: (in category 'as yet unclassified') -----
+ compileMessage: aText notifying: aController
+ "Compile the code that was accepted by the user, placing the compiled method into an appropriate message category. Return true if the compilation succeeded, else false."
+ "Copied from Browser's version of sd 11/20/2005 21:26 because later versions remove messageListIndex."
+
+ | fallBackCategoryIndex fallBackMethodIndex originalSelectorName result |
+
+ self selectedMessageCategoryName ifNil:
+ [ self selectOriginalCategoryForCurrentMethod
+ ifFalse:["Select the '--all--' category"
+ self messageCategoryListIndex: 1]].
+
+
+ self selectedMessageCategoryName asSymbol = ClassOrganizer allCategory
+ ifTrue:
+ [ "User tried to save a method while the ALL category was selected"
+ fallBackCategoryIndex := messageCategoryListIndex.
+ fallBackMethodIndex := messageListIndex.
+ editSelection == #newMessage
+ ifTrue:
+ [ "Select the 'as yet unclassified' category"
+ messageCategoryListIndex := 0.
+ (result := self defineMessageFrom: aText notifying: aController)
+ ifNil:
+ ["Compilation failure: reselect the original category & method"
+ messageCategoryListIndex := fallBackCategoryIndex.
+ messageListIndex := fallBackMethodIndex]
+ ifNotNil:
+ [self setSelector: result]]
+ ifFalse:
+ [originalSelectorName := self selectedMessageName.
+ self setOriginalCategoryIndexForCurrentMethod.
+ messageListIndex := fallBackMethodIndex := self messageList indexOf: originalSelectorName.
+ (result := self defineMessageFrom: aText notifying: aController)
+ ifNotNil:
+ [self setSelector: result]
+ ifNil:
+ [ "Compilation failure: reselect the original category & method"
+ messageCategoryListIndex := fallBackCategoryIndex.
+ messageListIndex := fallBackMethodIndex.
+ ^ result notNil]].
+ self changed: #messageCategoryList.
+ ^ result notNil]
+ ifFalse:
+ [ "User tried to save a method while the ALL category was NOT selected"
+ ^ (self defineMessageFrom: aText notifying: aController) notNil]!
Item was added:
+ ----- Method: MessageSet>>systemOrganizer: (in category 'as yet unclassified') -----
+ systemOrganizer: aSystemOrganizer
+
+ messageListIndex := 0.
+ ^ super systemOrganizer: aSystemOrganizer.!
Item was added:
+ ----- Method: MessageSet>>veryDeepInner: (in category 'as yet unclassified') -----
+ veryDeepInner: deepCopier
+ "Copy all of my instance variables. Some need to be not copied at all, but shared. See DeepCopier class comment."
+
+ super veryDeepInner: deepCopier.
+ messageListIndex := messageListIndex veryDeepCopyWith: deepCopier.!
More information about the Packages
mailing list