[squeak-dev] The Inbox: Tools-yo.405.mcz

commits at source.squeak.org commits at source.squeak.org
Fri May 11 18:24:06 UTC 2012


A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-yo.405.mcz

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

Name: Tools-yo.405
Author: yo
Time: 11 May 2012, 11:23:27.375 am
UUID: a36a5d3d-fdc0-4938-9a99-b4c9316442ea
Ancestors: Tools-bf.403

It allows to accept a method definition from DependencySorter.

=============== Diff against Tools-bf.403 ===============

Item was added:
+ ----- Method: DependencyBrowser>>contents:notifying: (in category 'contents') -----
+ contents: input notifying: aController 
+ 	"The retrieved information has changed and its source must now be
+ 	 updated. The information can be a variety of things, depending on
+ 	 the list selections (such as templates for class or message definition,
+ 	 methods) or the user menu commands (such as definition, comment,
+ 	 hierarchy).  Answer the result of updating the source."
+ 
+ 	| aString aText theClass theMethodName |
+ 	self changed: #annotation.
+ 	aString := input asString.
+ 	aText := input asText.
+ 	
+ 	theClass := self selectedClass.
+ 	theMethodName := self selectedMessageName.
+ 	(theClass notNil and: [theMethodName notNil]) ifTrue: [
+ 		^ self okayToAccept
+ 				ifFalse:
+ 					[false]
+ 				ifTrue:
+ 					[self defineMessageFrom: aText notifying: aController]].
+ 	self error: 'unacceptable accept'
+ !

Item was added:
+ ----- Method: DependencyBrowser>>defineMessageFrom:notifying: (in category 'contents') -----
+ defineMessageFrom: aString notifying: aController
+ 	"Compile the expressions in aString. Notify aController if a syntax error occurs. Install the compiled method in the selected class classified under  the currently selected message category name. Answer the selector obtained if compilation succeeds, nil otherwise."
+ 	| selectedMessageName selector category oldMessageList |
+ 	selectedMessageName := self selectedMessageName.
+ 	oldMessageList := self messageList.
+ 	contents := nil.
+ 	selector := (self selectedClassOrMetaClass newParser parseSelector: aString).
+ 	selector := self selectedClassOrMetaClass
+ 				compile: aString
+ 				classified: (category := self selectedMessageCategoryName)
+ 				notifying: aController.
+ 	selector == nil ifTrue: [^ false].
+ 	contents := aString copy.
+ 	^ true
+ !



More information about the Squeak-dev mailing list