--- a/HierarchicalItem.st Thu Jul 04 16:41:15 2002 +0200
+++ b/HierarchicalItem.st Fri Jul 05 17:39:51 2002 +0200
@@ -226,7 +226,7 @@
(index := self listIndex) notNil ifTrue:[
"/ do not call :#size: children will be autoloaded !!!!
(visChd := children size) ~~ 0 ifTrue:[
- self noneCriticalFrom:1 to:nil do:[:el|
+ self nonCriticalFrom:1 to:nil do:[:el|
visChd := visChd + el numberOfVisibleChildren
].
self model itemRemoveFromIndex:(index + 1) toIndex:(index + visChd).
@@ -288,7 +288,7 @@
(index := self listIndex) notNil ifTrue:[
"/ do not call :#size: children will be autoloaded !!!!
(visChd := children size) ~~ 0 ifTrue:[
- self noneCriticalFrom:1 to:nil do:[:el|
+ self nonCriticalFrom:1 to:nil do:[:el|
visChd := visChd + el numberOfVisibleChildren
].
].
@@ -320,7 +320,7 @@
self criticalDo:[
self size ~~ 0 ifTrue:[
(index := self listIndex) isNil ifTrue:[
- self noneCriticalFrom:1 to:nil do:[:el|
+ self nonCriticalFrom:1 to:nil do:[:el|
el setExpanded:true
].
] ifFalse:[
@@ -800,29 +800,13 @@
"evaluate a block on each child starting with the
child at startIndex to the end.
"
- |res|
-
- self size < startIndex ifTrue:[^ nil].
- res := nil.
-
- self criticalDo:[
- res := self noneCriticalFrom:startIndex to:nil do:aOneArgBlock
- ].
- ^ res
+ ^ self from:startIndex to:nil do:aOneArgBlock
!
from:startIndex reverseDo:aOneArgBlock
"evaluate a block on each child starting at end to the startIndex
"
- |res|
-
- self size < startIndex ifTrue:[^ nil].
- res := nil.
-
- self criticalDo:[
- res := self noneCriticalFrom:startIndex to:nil reverseDo:aOneArgBlock
- ].
- ^ res
+ ^ self from:startIndex to:nil reverseDo:aOneArgBlock
!
from:startIndex to:endIndex do:aOneArgBlock
@@ -835,7 +819,7 @@
res := nil.
self criticalDo:[
- res := self noneCriticalFrom:startIndex to:endIndex do:aOneArgBlock
+ res := self nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock
].
^ res
!
@@ -850,7 +834,7 @@
res := nil.
self criticalDo:[
- res := self noneCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
+ res := self nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
].
^ res
!
@@ -881,7 +865,7 @@
res := nil.
self criticalDo:[
- res := self noneCriticalKeysAndValuesReverseDo:aTwoArgBlock
+ res := self nonCriticalKeysAndValuesReverseDo:aTwoArgBlock
].
^ res
!
@@ -902,7 +886,7 @@
"
self do:[:aChild|
aOneArgBlock value:aChild.
- aChild noneCriticalRecursiveDo:aOneArgBlock
+ aChild nonCriticalRecursiveDo:aOneArgBlock
].
!
@@ -911,7 +895,7 @@
proccesing children in reverse direction
"
self reverseDo:[:aChild|
- aChild noneCriticalRecursiveReverseDo:aOneArgBlock.
+ aChild nonCriticalRecursiveReverseDo:aOneArgBlock.
aOneArgBlock value:aChild.
].
!
@@ -951,7 +935,7 @@
self do:[:el|
aOneArgBlock value:el.
- el noneCriticalRecursiveDo:aOneArgBlock.
+ el nonCriticalRecursiveDo:aOneArgBlock.
].
! !
@@ -1007,7 +991,7 @@
"
isExpanded == true ifFalse:[^ self].
- self noneCriticalFrom:1 to:nil do:[:el|
+ self nonCriticalFrom:1 to:nil do:[:el|
aList add:el.
el addVisibleChildrenTo:aList.
].
@@ -1047,7 +1031,7 @@
isExpanded == true ifFalse:[^ 0].
size := 0.
- self noneCriticalFrom:1 to:nil do:[:el|
+ self nonCriticalFrom:1 to:nil do:[:el|
size := 1 + size + el numberOfVisibleChildren
].
^ size
@@ -1142,8 +1126,14 @@
!HierarchicalItem methodsFor:'private enumerating'!
-noneCriticalFrom:startIndex to:endIndex do:aOneArgBlock
- "evaluate a block none critical on each child starting with the
+nonCriticalDo:aOneArgBlock
+ "evaluate a block noncritical on each child.
+ "
+ ^ self nonCriticalFrom:1 to:nil do:aOneArgBlock
+!
+
+nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock
+ "evaluate a block noncritical on each child starting with the
child at startIndex to the endIndex (if nil to end of list).
"
|list size resp|
@@ -1165,8 +1155,8 @@
^ resp
!
-noneCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
- "evaluate a block none critical on each child starting with the
+nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
+ "evaluate a block non critical on each child starting with the
child at endIndex (if nil to end of list) to startIndex.
"
|list size resp|
@@ -1186,7 +1176,7 @@
^ resp
!
-noneCriticalKeysAndValuesReverseDo:aOneArgBlock
+nonCriticalKeysAndValuesReverseDo:aOneArgBlock
"evaluate the argument, aBlock in reverse order for every
child, passing both index and element as arguments.
"
@@ -1204,21 +1194,21 @@
^ resp
!
-noneCriticalRecursiveDo:anOneArgBlock
- "evaluate the block none critical on each item and all the sub-items
+nonCriticalRecursiveDo:anOneArgBlock
+ "evaluate the block non critical on each item and all the sub-items
"
- self noneCriticalFrom:1 to:nil do:[:aChild|
+ self nonCriticalFrom:1 to:nil do:[:aChild|
anOneArgBlock value:aChild.
- aChild noneCriticalRecursiveDo:anOneArgBlock
+ aChild nonCriticalRecursiveDo:anOneArgBlock
].
!
-noneCriticalRecursiveReverseDo:anOneArgBlock
- "evaluate the block none critical on each item and all the sub-items;
+nonCriticalRecursiveReverseDo:anOneArgBlock
+ "evaluate the block non critical on each item and all the sub-items;
proccesing children in reverse direction
"
- self noneCriticalFrom:1 to:nil reverseDo:[:aChild|
- aChild noneCriticalRecursiveReverseDo:anOneArgBlock.
+ self nonCriticalFrom:1 to:nil reverseDo:[:aChild|
+ aChild nonCriticalRecursiveReverseDo:anOneArgBlock.
anOneArgBlock value:aChild.
].
! !
@@ -1232,7 +1222,7 @@
"/ do not call :#size: children will be autoloaded !!!!
children size ~~ 0 ifTrue:[
- self noneCriticalFrom:1 to:nil do:[:el| el recursiveSetCollapsed ].
+ self nonCriticalFrom:1 to:nil do:[:el| el recursiveSetCollapsed ].
]
!
@@ -1732,5 +1722,5 @@
!HierarchicalItem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.37 2002-02-15 12:01:52 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.38 2002-07-05 15:39:51 tm Exp $'
! !