diff -r 246a1c42ce5e -r 6ff85a3c7bb2 AbstractHierarchicalItem.st --- a/AbstractHierarchicalItem.st Fri Mar 23 15:48:39 2018 +0100 +++ b/AbstractHierarchicalItem.st Tue Mar 27 09:51:06 2018 +0200 @@ -321,6 +321,32 @@ "Modified: / 08-03-2018 / 21:06:13 / stefan" ! +expandLevels:numLevels + "expand children numLevels down" + + numLevels == 0 ifTrue:[^ self]. + self children do:[:each | + each expand. + each expandLevels:(numLevels - 1). + ]. +! + +expandLevels:numLevels max:maxNumExpandedHolder + "expand children numLevels down" + + numLevels == 0 ifTrue:[^ self]. + maxNumExpandedHolder value <= 0 ifTrue:[^ self]. + + self children do:[:each | + each expand. + ]. + + maxNumExpandedHolder value:(maxNumExpandedHolder value - self children size). + self children do:[:each | + each expandLevels:(numLevels - 1) max:maxNumExpandedHolder. + ]. +! + labelPath "return my label-path as an ordered collection of individual labels"