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

commits at source.squeak.org commits at source.squeak.org
Mon Mar 14 21:20:12 UTC 2011

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

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

Name: Tools-fbs.313
Author: fbs
Time: 14 March 2011, 5:59:35.243 pm
UUID: 62b86bcd-d5c4-bc44-b2cc-1bca05ced4a4
Ancestors: Tools-fbs.312

Finally we can start removing lots of classListIndex refererrs.

=============== Diff against Tools-fbs.312 ===============

Item was changed:
  ----- Method: Browser>>alphabetizeMessageCategories (in category 'message category functions') -----
  	self hasClassSelected ifFalse: [^ false].
  	self okToChange ifFalse: [^ false].
  	self classOrMetaClassOrganizer sortCategories.
  	self clearUserEditFlag.
  	self editClass.
+ 	self selectClassNamed: selectedClassName.
- 	self classListIndex: classListIndex.
  	^ true!

Item was changed:
  ----- Method: Browser>>changeMessageCategories: (in category 'message category functions') -----
  changeMessageCategories: aString 
  	"The characters in aString represent an edited version of the the message 
  	categories for the selected class. Update this information in the system 
  	and inform any dependents that the categories have been changed. This 
  	message is invoked because the user had issued the categories command 
  	and edited the message categories. Then the user issued the accept 
  	self classOrMetaClassOrganizer changeFromString: aString.
  	self clearUserEditFlag.
  	self editClass.
+ 	self selectClassNamed: selectedClassName.
- 	self classListIndex: classListIndex.
  	^ true!

Item was changed:
  ----- Method: Browser>>classListIndex: (in category 'class list') -----
  classListIndex: anInteger 
  	"Set anInteger to be the index of the current class selection."
  	| className currentMessageCategoryName currentMessageName |
  	currentMessageCategoryName := [self selectedMessageCategoryName]
  										on: Error
  										do: [:ex| ex return: nil].
  	currentMessageName := [self selectedMessageName]
  								on: Error
  								do: [:ex| ex return: nil].
  	classListIndex := anInteger.
+ 	selectedClassName := (self classList collect: [:each | each withoutLeadingBlanks]) at: classListIndex ifAbsent: [ nil ].
  	self setClassOrganizer.
  	"Try to reselect the category and/or selector if the new class has them."
  	messageCategoryListIndex := self messageCategoryList
  										indexOf: currentMessageCategoryName
  										ifAbsent: [0].
  	messageListIndex := messageCategoryListIndex = 0
  							ifTrue: [0]
  							ifFalse: [self messageList
  										indexOf: currentMessageName
  										ifAbsent: [0]].
  	messageListIndex ~= 0 ifTrue:
  		[self editSelection: #editMessage] ifFalse:
  	[messageCategoryListIndex ~= 0 ifTrue:
  		[self editSelection: #newMessage] ifFalse:
  	[self classCommentIndicated
  		ifTrue: []
  		ifFalse: [self editSelection: (anInteger = 0
  					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>>hasClassSelected (in category 'class list') -----
+ 	^ selectedClassName notNil.!
- 	^ classListIndex ~= 0.
- "	^ self selectedClassName notNil"!

Item was changed:
  ----- Method: Browser>>selectClass: (in category 'class list') -----
  selectClass: classNotMeta
+ 	self selectClassNamed: classNotMeta name.!
- 	self classListIndex: (self classListIndexOf: classNotMeta name)!

Item was changed:
  ----- Method: Browser>>selectClassNamed: (in category 'class list') -----
  selectClassNamed: aSymbolOrString
  	selectedClassName := aSymbolOrString ifNotNil: [ aSymbolOrString asSymbol ].
  		ifNil: [ self classListIndex: 0 ]
+ 		ifNotNil: [ self classListIndex: (self classListIndexOf: selectedClassName) ]!
- 		ifNotNil: [ self classListIndex: (self classList indexOf: selectedClassName) ]!

Item was changed:
  ----- Method: Browser>>selectedClassName (in category 'class list') -----
+ "	^ selectedClassName."
  	| className |
+ 	self classList ifNil: [ ^ nil ].
- 	self classList ifNil: [ ^ nil "We might be halfway through instantiating ourselves."].
  	className := self classList
  		at: classListIndex
  		ifAbsent: [^ nil].
  	self class listClassesHierarchically ifTrue: [
  		className := className withoutLeadingBlanks asSymbol].
  	^ className.!

More information about the Squeak-dev mailing list