[squeak-dev] The Trunk: Morphic-mt.774.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Mar 7 11:17:27 UTC 2015


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.774.mcz

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

Name: Morphic-mt.774
Author: mt
Time: 7 March 2015, 12:16:53.926 pm
UUID: 2bd1bbc8-ce83-3a44-a72a-d514668e3f03
Ancestors: Morphic-topa.773

ObjectExplorerWrapper refactored. It now stores bindings as items because this simplifies the adaptation of ObjectExplorer to use PluggableTreeMorphs.

A pluggable tree morph wants to hide all wrappers from the model. To still distinguish, for example, various 'nil' values, it is necessary to work with bindings.

Those bindings are not the ones as stored internally in the class object but made up new. Look at #setItem:name:model:.

=============== Diff against Morphic-topa.773 ===============

Item was added:
+ ----- Method: ListItemWrapper>>item (in category 'accessing') -----
+ item
+ 	^ item!

Item was added:
+ ----- Method: ListItemWrapper>>model (in category 'accessing') -----
+ model
+ 	^ model!

Item was changed:
+ ----- Method: ListItemWrapper>>setItem: (in category 'initialization') -----
- ----- Method: ListItemWrapper>>setItem: (in category 'accessing') -----
  setItem: anObject
  
  	item := anObject!

Item was changed:
+ ----- Method: ListItemWrapper>>setItem:model: (in category 'initialization') -----
- ----- Method: ListItemWrapper>>setItem:model: (in category 'accessing') -----
  setItem: anObject model: aModel
  
  	item := anObject.
  	model := aModel.!

Item was changed:
  ----- Method: ObjectExplorerWrapper>>asString (in category 'converting') -----
  asString
+ 	| explorerString label separator |
- 	| explorerString string separator |
  	explorerString := 
+ 		[self object asExplorerString]
- 		[item asExplorerString]
  			on: Error 
+ 			do: ['<error: ', self object class name, ' in asExplorerString: evaluate "' , self itemName , ' asExplorerString" to debug>'].
+ 	(explorerString includes: Character cr)
+ 		ifTrue: [explorerString := explorerString withSeparatorsCompacted].
+ 
+ 	label := self itemName ifNil: [''].
+ 	(label includes: Character cr)
+ 		ifTrue: [label := label withSeparatorsCompacted].
+ 	 
- 			do: ['<error: ', item class name, ' in asExplorerString: evaluate "' , itemName , ' asExplorerString" to debug>'].
  	separator := self class showContentsInColumns
  		ifTrue: [String tab]
+ 		ifFalse: [label ifEmpty: [''] ifNotEmpty: [': ']].
+ 
+ 	^ '{1}{2}{3}' format: {label. separator. explorerString}!
- 		ifFalse: [': '].
- 	string := (itemName ifNotNil: [itemName, separator] ifNil: ['']) , explorerString.
- 	(string includes: Character cr)
- 		ifTrue: [^ string withSeparatorsCompacted].
- 	^ string!

Item was removed:
- ----- Method: ObjectExplorerWrapper>>canBeDragged (in category 'as yet unclassified') -----
- canBeDragged
- 
- 	^false!

Item was changed:
  ----- Method: ObjectExplorerWrapper>>contents (in category 'accessing') -----
  contents
  
+ 	(self object respondsTo: #explorerContents) ifTrue: [^ self object explorerContents].
- 	(item respondsTo: #explorerContents) ifTrue: [^item explorerContents].
  	"For all others, show named vars first, then indexed vars"
+ 	^(self object class allInstVarNames asOrderedCollection withIndexCollect: [:each :index |
- 	^(item class allInstVarNames asOrderedCollection withIndexCollect: [:each :index |
  		self class
+ 			with: (self object instVarAt: index)
- 			with: (item instVarAt: index)
  			name: each
+ 			model: self object
- 			model: item
  			parent: self]) ,
+ 	((1 to: self object basicSize) collect: [:index |
- 	((1 to: item basicSize) collect: [:index |
  		self class
+ 			with: (self object basicAt: index)
- 			with: (item basicAt: index)
  			name: index printString
+ 			model: self object
- 			model: item
  			parent: self])!

Item was changed:
  ----- Method: ObjectExplorerWrapper>>hasContents (in category 'accessing') -----
  hasContents
  
+ 	^ self object hasContentsInExplorer
- 	^item hasContentsInExplorer
  	
  !

Item was changed:
  ----- Method: ObjectExplorerWrapper>>icon (in category 'accessing') -----
  icon
  	"Answer a form to be used as icon"
  	^ Preferences visualExplorer
+ 		ifTrue: [(self object iconOrThumbnailOfSize: 12)
- 		ifTrue: [(item iconOrThumbnailOfSize: 12)
  			ifNil: [self class showContentsInColumns
  				ifTrue: [ToolIcons iconNamed: #blank] 
  				ifFalse: [nil]]]
  		ifFalse: [nil]!

Item was changed:
+ ----- Method: ObjectExplorerWrapper>>itemName (in category 'accessing') -----
- ----- Method: ObjectExplorerWrapper>>itemName (in category 'converting') -----
  itemName
+ 
+ 	^ self item key!
- 	^itemName!

Item was added:
+ ----- Method: ObjectExplorerWrapper>>object (in category 'accessing') -----
+ object
+ 
+ 	^ self item value!

Item was added:
+ ----- Method: ObjectExplorerWrapper>>object: (in category 'accessing') -----
+ object: anObject
+ 
+ 	self item value: anObject.!

Item was changed:
+ ----- Method: ObjectExplorerWrapper>>parent (in category 'accessing') -----
- ----- Method: ObjectExplorerWrapper>>parent (in category 'as yet unclassified') -----
  parent
+ 	^ parent!
- 	^parent!

Item was removed:
- ----- Method: ObjectExplorerWrapper>>parent: (in category 'as yet unclassified') -----
- parent: anObject
- 	parent := anObject!

Item was changed:
  ----- Method: ObjectExplorerWrapper>>refresh (in category 'monitoring') -----
  refresh
  	"hack to refresh item given an object and a string that is either an index or an instance variable name."
+ 	
+ 	self parent ifNil: [^ self].
  	[ | index |
+ 		(model class allInstVarNames includes: self itemName)
+ 			ifTrue: [ self object: (model instVarNamed: self itemName) ]
+ 			ifFalse: [ index := self itemName asNumber.
+ 				(index between: 1 and: model basicSize) ifTrue: [ self object: (model basicAt: index)]]
+ 	] on: Error do: [ :ex | self object: nil ]!
- 		(model class allInstVarNames includes: itemName)
- 			ifTrue: [ item := model instVarNamed: itemName ]
- 			ifFalse: [ index := itemName asNumber.
- 				(index between: 1 and: model basicSize) ifTrue: [ item := model basicAt: index]]
- 	] on: Error do: [ :ex | item := nil ]!

Item was removed:
- ----- Method: ObjectExplorerWrapper>>selector (in category 'as yet unclassified') -----
- selector
- 	parent ifNil: [ ^nil ].
- 	^(parent withoutListWrapper class allInstVarNames includes: itemName) ifTrue: [ itemName asSymbol ]!

Item was changed:
+ ----- Method: ObjectExplorerWrapper>>setItem:name:model: (in category 'initialization') -----
- ----- Method: ObjectExplorerWrapper>>setItem:name:model: (in category 'as yet unclassified') -----
  setItem: anObject name: aString model: aModel
  
+ 	self setItem: aString -> anObject model: aModel.!
- 	item := anObject.
- 	model := aModel.
- 	itemName := aString.!

Item was changed:
+ ----- Method: ObjectExplorerWrapper>>setItem:name:model:parent: (in category 'initialization') -----
- ----- Method: ObjectExplorerWrapper>>setItem:name:model:parent: (in category 'as yet unclassified') -----
  setItem: anObject name: aString model: aModel parent: itemParent
+ 
  	parent := itemParent.
  	self setItem: anObject name: aString model: aModel!



More information about the Squeak-dev mailing list