[squeak-dev] The Trunk: Tools-ul.662.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 10 21:03:51 UTC 2016


Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.662.mcz

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

Name: Tools-ul.662
Author: ul
Time: 9 January 2016, 5:14:35.787432 pm
UUID: 3972f226-5c3e-4479-bbac-cea2f7e30e3b
Ancestors: Tools-ul.661

Improved method to method category drops in Browser: moving methods from classes related by inheritance or by being meta-non-meta pairs won't have to be confirmed any more.

=============== Diff against Tools-ul.661 ===============

Item was changed:
  ----- Method: Browser>>dropOnMessageCategories:at: (in category 'drag and drop') -----
  dropOnMessageCategories: method at: index
  
+ 	| sourceClass destinationClass category copy |
- 	| dstClass category copy |
  	copy := Sensor shiftPressed.
  	(method isKindOf: CompiledMethod) 
  		ifFalse:[^self inform: 'Can only drop methods'].
+ 	sourceClass := method methodClass.
+ 	destinationClass := self selectedClassOrMetaClass.
+ 	sourceClass == destinationClass ifTrue:[
- 	dstClass := self selectedClassOrMetaClass.
- 	(dstClass == method methodClass) ifTrue:[
  		category := self messageCategoryList at: index.
  		category = ClassOrganizer allCategory ifTrue: [^false].
+ 		destinationClass organization classify: method selector  under: category suppressIfDefault: false logged: true.
+ 		^true ].
+ 	(copy not and: [
+ 		(destinationClass inheritsFrom: sourceClass)
+ 			or: [ (sourceClass inheritsFrom: destinationClass)
+ 			or: [ sourceClass theNonMetaClass == destinationClass theNonMetaClass ] ] ]) 
+ 		ifFalse: [
+ 			(self confirm: (
+ 				'Classes "{1}" and "{2}" are unrelated.{3}Are you sure you want to move this method?'
+ 					format: { sourceClass. destinationClass. Character cr })) 
+ 						ifFalse: [ ^false ] ].
+ 	destinationClass
- 		dstClass organization classify: method selector  under: category suppressIfDefault: false logged: true.
- 		^true].
- 	copy ifFalse: [
- 		(self confirm: (
- 			'Classes {1} and {2} are unrelated.{3}Are you sure you want to move this method?'
- 				format: { method methodClass. dstClass. Character cr })) 
- 					ifFalse: [ ^false ] ].
- 	dstClass
  		compile: method getSource
  		classified: (self messageCategoryList at: index)
  		withStamp: method timeStamp
  		notifying: nil.
  	copy ifFalse: [
+ 		sourceClass removeSelector: method selector ].
- 		method methodClass removeSelector: method selector ].
  	^true!



More information about the Squeak-dev mailing list