[squeak-dev] The Trunk: Tools-mt.553.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 13 17:31:26 UTC 2015


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

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

Name: Tools-mt.553
Author: mt
Time: 13 March 2015, 10:31:03.81 am
UUID: 8a53e27d-a4d2-1b4d-b899-7433bf6d5424
Ancestors: Tools-mt.552

Filtering changed to support a depth offset. Will be used to filter subtrees and support separate exploration activities in a large tree structure. The depth-limit will then be applied together with the offset.

=============== Diff against Tools-mt.552 ===============

Item was changed:
  ----- Method: IndentingListItemMorph>>applyFilter: (in category 'filtering') -----
  applyFilter: filter
  
+ 	self
+ 		applyFilter: filter
+ 		depthOffset: self indentLevel.!
- 	| selfMatch childMatch |
- 	self isExpanded ifTrue: [self toggleExpandedState].
- 	
- 	selfMatch := self matches: filter.
- 	childMatch := self matchesAnyChild: filter.
- 	
- 	selfMatch | childMatch ifFalse: [^ self hide].
- 	
- 	selfMatch ifTrue: [
- 		self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
- 	childMatch ifTrue: [
- 		self toggleExpandedState.
- 		self childrenDo: [:child | child applyFilter: filter]].!

Item was added:
+ ----- Method: IndentingListItemMorph>>applyFilter:depthOffset: (in category 'filtering') -----
+ applyFilter: filter depthOffset: offset
+ 
+ 	| selfMatch childMatch |
+ 	self isExpanded ifTrue: [self toggleExpandedState].
+ 	
+ 	selfMatch := self matches: filter.
+ 	childMatch := self matchesAnyChild: filter depthOffset: offset.
+ 	
+ 	selfMatch | childMatch ifFalse: [^ self hide].
+ 	
+ 	selfMatch ifTrue: [
+ 		self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
+ 	childMatch ifTrue: [
+ 		self toggleExpandedState.
+ 		self childrenDo: [:child | child applyFilter: filter depthOffset: offset]].!

Item was removed:
- ----- Method: IndentingListItemMorph>>matchesAnyChild: (in category 'filtering') -----
- matchesAnyChild: pattern
- 
- 	| maxDepth next current |
- 	maxDepth := PluggableTreeMorph maximumSearchDepth - self indentLevel.
- 	maxDepth <= 0 ifTrue: [^ false].
- 	
- 	next := (self getChildren collect: [:obj | 1 -> obj]) asOrderedCollection.
- 	[next notEmpty] whileTrue: [
- 		current := next removeFirst.
- 		
- 		(self matches: pattern in: current value)
- 			ifTrue: [^ true].
- 		
- 		current key < maxDepth ifTrue: [
- 			next addAll: ((self getChildrenFor: current value) collect: [:obj | (current key + 1) -> obj])].
- 		].
- 	
- 	^ false!

Item was added:
+ ----- Method: IndentingListItemMorph>>matchesAnyChild:depthOffset: (in category 'filtering') -----
+ matchesAnyChild: pattern depthOffset: offset
+ 
+ 	| maxDepth next current |
+ 	maxDepth := PluggableTreeMorph maximumSearchDepth - self indentLevel + offset.
+ 	maxDepth <= 0 ifTrue: [^ false].
+ 	
+ 	next := (self getChildren collect: [:obj | 1 -> obj]) asOrderedCollection.
+ 	[next notEmpty] whileTrue: [
+ 		current := next removeFirst.
+ 		
+ 		(self matches: pattern in: current value)
+ 			ifTrue: [^ true].
+ 		
+ 		current key < maxDepth ifTrue: [
+ 			next addAll: ((self getChildrenFor: current value) collect: [:obj | (current key + 1) -> obj])].
+ 		].
+ 	
+ 	^ false!



More information about the Squeak-dev mailing list