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

commits at source.squeak.org commits at source.squeak.org
Mon Feb 1 09:30:32 UTC 2016

Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:

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

Name: ToolBuilder-Morphic-mt.158
Author: mt
Time: 1 February 2016, 10:29:47.512285 am
UUID: 6aa4ffd8-7313-4369-a342-7b7a64f3cc63
Ancestors: ToolBuilder-Morphic-mt.157

Adds support for selective refreshing in pluggable tree morphs that make use of the generic PluggableTreeItemNode. To use, send "self changed: #objectChanged with: anObject" in the tool's model. See ObjectExplorer >> #step for an example. Note that ObjectExplorer uses the customized ObjectExplorerWrapper instead of the PluggableTreeItemNode. However, this does not affect the basic idea behind #objectChanged.

=============== Diff against ToolBuilder-Morphic-mt.157 ===============

Item was changed:
  ListItemWrapper subclass: #PluggableTreeItemNode
+ 	instanceVariableNames: 'parent index'
- 	instanceVariableNames: 'parent'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'ToolBuilder-Morphic'!
+ !PluggableTreeItemNode commentStamp: 'mt 2/1/2016 10:24' prior: 0!
+ Tree item for PluggableTreeMorph. My model is the tree morph. I keep track of my parent item and the index in my parent's list of children to support selective refreshing.!
- !PluggableTreeItemNode commentStamp: 'mt 3/7/2015 09:15' prior: 0!
- Tree item for PluggableTreeMorph. My model is the tree morph.!

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

Item was added:
+ ----- Method: PluggableTreeItemNode>>index: (in category 'accessing') -----
+ index: anInteger
+ 	index := anInteger.!

Item was changed:
  ----- Method: PluggableTreeItemNode>>refresh (in category 'as yet unclassified') -----
+ 	self setItem: (self parent contents
+ 		at: self index
+ 		ifAbsent: [self error: 'No support for changed child count yet!!'])
+ 			item.!
- 	"Todo. See ObjectExplorerWrapper >> #refresh."!

Item was changed:
  ----- Method: PluggableTreeMorph>>contentsOfNode: (in category 'node access') -----
  contentsOfNode: node
  	| children |
  	getChildrenSelector ifNil:[^#()].
  	children := model perform: getChildrenSelector with: node item.
+ 	^children collectWithIndex: [:item :index |
+ 		(self nodeClass with: item model: self)
+ 			index: index;
+ 			parent: node]!
- 	^children collect: [:item|
- 		(self nodeClass with: item model: self) parent: node]!

More information about the Squeak-dev mailing list