[squeak-dev] The Inbox: Tools-fbs.322.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 17 23:05:25 UTC 2011

A new version of Tools was added to project The Inbox:

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

Name: Tools-fbs.322
Author: fbs
Time: 17 March 2011, 11:04:56.212 pm
UUID: 1d3fc4fc-4947-1c44-af38-d1c53d0b5703
Ancestors: Tools-fbs.321

And now we can refactor selectOriginalCategoryForCurrentMethod!

=============== Diff against Tools-fbs.321 ===============

Item was changed:
  ----- Method: Browser>>selectClassNamed: (in category 'class list') -----
  selectClassNamed: aSymbolOrString
  	| className currentMessageCategoryName currentMessageName |
  	currentMessageCategoryName := [self selectedMessageCategoryName]
  										on: Error
  										do: [:ex| ex return: nil].
  	currentMessageName := [self selectedMessageName]
  								on: Error
  								do: [:ex| ex return: nil].
  	selectedClassName := aSymbolOrString ifNotNil: [ aSymbolOrString asSymbol ].
  	self setClassOrganizer.
  	"Try to reselect the category and/or selector if the new class has them."
  	messageCategoryListIndex := self messageCategoryList
  										indexOf: currentMessageCategoryName
  										ifAbsent: [0].
+ 	self selectMessageNamed: (self hasMessageCategorySelected
+ 		ifTrue: [ currentMessageName ]
+ 		ifFalse: [ nil ]).
- 	messageListIndex := messageCategoryListIndex = 0
- 							ifTrue: [0]
- 							ifFalse: [self messageList
- 										indexOf: currentMessageName
- 										ifAbsent: [0]].
  	self hasMessageSelected ifTrue:
  		[self editSelection: #editMessage] ifFalse:
+ 	[self messageCategoryListIndex ~= 0 ifTrue:
- 	[messageCategoryListIndex ~= 0 ifTrue:
  		[self editSelection: #newMessage] ifFalse:
  	[self classCommentIndicated
  		ifTrue: []
  		ifFalse: [self editSelection: (self hasClassSelected not
  					ifTrue: [(metaClassIndicated or: [ self hasSystemCategorySelected not ])
  						ifTrue: [#none]
  						ifFalse: [#newClass]]
  					ifFalse: [#editClass])]]].
  	contents := nil.
  	self selectedClass isNil
  		ifFalse: [className := self selectedClass name.
  					(RecentClasses includes: className)
  				ifTrue: [RecentClasses remove: className].
  			RecentClasses addFirst: className.
  			RecentClasses size > 16
  				ifTrue: [RecentClasses removeLast]].
  	self changed: #classSelectionChanged.
  	self changed: #classCommentText.
  	self changed: #classListIndex.	"update my selection"
  	self changed: #messageCategoryList.
  	self changed: #messageList.
  	self changed: #relabel.
  	self contentsChanged!

Item was changed:
  ----- Method: Browser>>selectOriginalCategoryForCurrentMethod (in category 'message category list') -----
  	"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])
  			[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!

More information about the Squeak-dev mailing list