author | Stefan Vogel <sv@exept.de> |
Tue, 05 Feb 2008 11:33:43 +0100 | |
changeset 3333 | ee578ab4ee94 |
parent 3173 | c7171ad3e1d7 |
child 3337 | 2c407545d5ec |
permissions | -rw-r--r-- |
1431 | 1 |
" |
2 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1794 | 12 |
"{ Package: 'stx:libwidg2' }" |
13 |
||
1390 | 14 |
Object subclass:#HierarchicalItem |
1606 | 15 |
instanceVariableNames:'parent children isExpanded height width' |
1390 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
1430 | 18 |
category:'Views-Support' |
1390 | 19 |
! |
20 |
||
21 |
HierarchicalItem subclass:#Example |
|
22 |
instanceVariableNames:'label icon' |
|
23 |
classVariableNames:'PenguinIcon' |
|
24 |
poolDictionaries:'' |
|
25 |
privateIn:HierarchicalItem |
|
26 |
! |
|
27 |
||
28 |
!HierarchicalItem class methodsFor:'documentation'! |
|
29 |
||
1431 | 30 |
copyright |
31 |
" |
|
32 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
33 |
All Rights Reserved |
|
34 |
||
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
||
43 |
! |
|
44 |
||
1390 | 45 |
documentation |
46 |
" |
|
47 |
Hierarchical Items are mostly like Models, but the list of |
|
48 |
dependencies are kept by its HierarchicalList. |
|
49 |
The class is used to build up hierarchical trees. |
|
50 |
||
51 |
[Instance variables:] |
|
52 |
parent <Item, List or nil> parent or my HierarchicalList. |
|
53 |
children <Collection or nil> list of children |
|
54 |
isExpanded <Boolean> indicates whether the item is |
|
55 |
expanded or collapsed |
|
56 |
||
57 |
[author:] |
|
58 |
Claus Atzkern |
|
59 |
||
60 |
[see also:] |
|
61 |
HierarchicalList |
|
62 |
HierarchicalListView |
|
63 |
" |
|
64 |
||
65 |
||
66 |
! ! |
|
67 |
||
68 |
!HierarchicalItem class methodsFor:'instance creation'! |
|
69 |
||
70 |
new |
|
71 |
^ (self basicNew) initialize |
|
2314 | 72 |
! |
73 |
||
74 |
parent:aParent |
|
75 |
|item| |
|
76 |
||
77 |
item := self new. |
|
78 |
item parent:aParent. |
|
79 |
^ item |
|
1390 | 80 |
! ! |
81 |
||
2081 | 82 |
!HierarchicalItem class methodsFor:'protocol'! |
83 |
||
84 |
doResetExtentOnChange |
|
85 |
"true: the extent of the item is reset if a change |
|
86 |
notification is raised from the item. the default is true |
|
87 |
" |
|
88 |
^ true |
|
89 |
! ! |
|
90 |
||
1390 | 91 |
!HierarchicalItem methodsFor:'accessing'! |
92 |
||
2081 | 93 |
getChildren |
94 |
"returns the children at it is; not going to the model ... |
|
95 |
" |
|
96 |
^ children |
|
97 |
! |
|
98 |
||
1390 | 99 |
level |
100 |
"returns the level starting with 1 |
|
101 |
" |
|
2386 | 102 |
|item level| |
103 |
||
104 |
"/ for optimization we try to suppress a block |
|
105 |
||
106 |
item := self. |
|
1390 | 107 |
|
2386 | 108 |
(item := item parentOrModel) isNil ifTrue:[^ 0]. |
109 |
(item := item parentOrModel) isNil ifTrue:[^ 1]. |
|
110 |
(item := item parentOrModel) isNil ifTrue:[^ 2]. |
|
111 |
(item := item parentOrModel) isNil ifTrue:[^ 3]. |
|
112 |
(item := item parentOrModel) isNil ifTrue:[^ 4]. |
|
113 |
(item := item parentOrModel) isNil ifTrue:[^ 5]. |
|
114 |
(item := item parentOrModel) isNil ifTrue:[^ 6]. |
|
115 |
||
116 |
level := 7. |
|
117 |
||
118 |
[(item := item parentOrModel) notNil] whileTrue:[ |
|
3090 | 119 |
level := level + 1. |
120 |
level > 100000 ifTrue:[self halt]. |
|
1390 | 121 |
]. |
122 |
^ level |
|
123 |
! |
|
124 |
||
125 |
parent |
|
126 |
"returns the parent or nil |
|
127 |
" |
|
128 |
^ (parent notNil and:[parent isHierarchicalItem]) ifTrue:[parent] |
|
129 |
ifFalse:[nil] |
|
130 |
! |
|
131 |
||
132 |
parent:aParent |
|
133 |
"set the parent (or the model if the item is the root item) |
|
134 |
" |
|
135 |
parent := aParent |
|
136 |
||
1883 | 137 |
! |
138 |
||
139 |
rootItem |
|
140 |
"returns the root item |
|
141 |
" |
|
142 |
parent isHierarchicalItem ifTrue:[ |
|
143 |
^ parent rootItem |
|
144 |
]. |
|
145 |
^ self |
|
1390 | 146 |
! ! |
147 |
||
1818 | 148 |
!HierarchicalItem methodsFor:'accessing-children'! |
1390 | 149 |
|
150 |
at:anIndex |
|
1900 | 151 |
"return the child at anIndex if valid; |
2927 | 152 |
if the index is invalid, nil is returned" |
153 |
||
1900 | 154 |
^ self at:anIndex ifAbsent:nil |
155 |
! |
|
156 |
||
157 |
at:anIndex ifAbsent:exceptionBlock |
|
158 |
"return the child at anIndex if valid; if the index is |
|
2927 | 159 |
invalid, the result of evaluating the exceptionBlock is returned." |
160 |
||
1900 | 161 |
|list| |
162 |
||
163 |
(list := self children) notNil ifTrue:[ |
|
164 |
^ list at:anIndex ifAbsent:exceptionBlock |
|
165 |
]. |
|
166 |
^ exceptionBlock value |
|
1390 | 167 |
! |
168 |
||
169 |
at:anIndex put:anItem |
|
2927 | 170 |
"replace a child by a new item" |
171 |
||
2340 | 172 |
|children oldItem visIndex model expFlag| |
1390 | 173 |
|
174 |
anItem isNil ifTrue:[ |
|
175 |
^ self removeFromIndex:anIndex toIndex:anIndex. |
|
176 |
]. |
|
2340 | 177 |
anItem parent:self. |
2081 | 178 |
|
2340 | 179 |
(model := self model) isNil ifTrue:[ |
180 |
^ self children at:anIndex put:anItem |
|
2081 | 181 |
]. |
182 |
||
2340 | 183 |
model criticalDo:[ |
184 |
children := self children. |
|
185 |
oldItem := children at:anIndex. |
|
2081 | 186 |
|
2340 | 187 |
oldItem isExpanded ifTrue:[ |
188 |
oldItem collapse |
|
189 |
]. |
|
190 |
visIndex := model identityIndexOf:oldItem. |
|
191 |
expFlag := anItem isExpanded. |
|
192 |
anItem setExpanded:false. |
|
2081 | 193 |
|
2340 | 194 |
children at:anIndex put:anItem. |
195 |
||
196 |
visIndex ~~ 0 ifTrue:[ |
|
2343 | 197 |
model at:visIndex put:anItem. |
2081 | 198 |
]. |
2340 | 199 |
self changed:#redraw. |
200 |
expFlag ifTrue:[ anItem expand ]. |
|
1390 | 201 |
]. |
2081 | 202 |
^ anItem |
1390 | 203 |
! |
204 |
||
205 |
children:aListOfChildren |
|
2927 | 206 |
"set a new list of children" |
207 |
||
1733 | 208 |
self criticalDo:[ |
209 |
self removeAll. |
|
210 |
self addAll:aListOfChildren beforeIndex:1 |
|
211 |
]. |
|
212 |
^ aListOfChildren |
|
1390 | 213 |
! |
214 |
||
215 |
first |
|
216 |
"returns the first child |
|
217 |
" |
|
218 |
^ self at:1 |
|
219 |
! |
|
220 |
||
221 |
last |
|
222 |
"returns the last child |
|
223 |
" |
|
2081 | 224 |
^ self at:(self size) |
1900 | 225 |
! |
226 |
||
227 |
second |
|
228 |
"returns the second child |
|
229 |
" |
|
230 |
^ self at:2 |
|
1390 | 231 |
! ! |
232 |
||
1818 | 233 |
!HierarchicalItem methodsFor:'accessing-hierarchy'! |
1390 | 234 |
|
235 |
collapse |
|
2549 | 236 |
"hide all my subitems" |
237 |
||
2081 | 238 |
|visChd index| |
1390 | 239 |
|
240 |
self canCollapse ifTrue:[ |
|
241 |
isExpanded := false. |
|
242 |
||
1733 | 243 |
self criticalDo:[ |
244 |
(index := self listIndex) notNil ifTrue:[ |
|
2081 | 245 |
"/ do not call :#size: children will be autoloaded !!!! |
1733 | 246 |
(visChd := children size) ~~ 0 ifTrue:[ |
2117 | 247 |
self nonCriticalFrom:1 to:nil do:[:el| |
2081 | 248 |
visChd := visChd + el numberOfVisibleChildren |
1733 | 249 |
]. |
250 |
self model itemRemoveFromIndex:(index + 1) toIndex:(index + visChd). |
|
2201
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
251 |
]. |
2549 | 252 |
index ~~ 0 ifTrue:[self hierarchyChanged]. |
1390 | 253 |
] |
254 |
] |
|
255 |
] |
|
256 |
! |
|
257 |
||
2476 | 258 |
enforcedExpand |
2724 | 259 |
"expand children - even if there are no children, |
2476 | 260 |
the item is initially expanded (but this might be undone later, |
261 |
when we know that no children are there" |
|
262 |
||
263 |
self expand:true |
|
264 |
! |
|
265 |
||
1390 | 266 |
expand |
2476 | 267 |
"expand children - but only if there are children |
268 |
(i.e. this cannot be used before the childInfo is valid; |
|
269 |
aka not before the updateTask came along this item)" |
|
270 |
||
271 |
self expand:false |
|
272 |
! |
|
273 |
||
274 |
expand:enforced |
|
2547 | 275 |
"expand children" |
276 |
||
2305 | 277 |
|index list| |
278 |
||
279 |
"/ test whether the item already is expanded; #canExpand could be redefined |
|
280 |
"/ without checking whether the node is expanded (happens already) !! |
|
281 |
||
2547 | 282 |
isExpanded ifTrue:[ ^ self ]. |
2724 | 283 |
(enforced not and:[self canExpand not]) ifTrue:[ ^ self ]. |
1942 | 284 |
|
2305 | 285 |
self criticalDo:[ |
286 |
(index := self listIndex) notNil ifTrue:[ |
|
287 |
"/ must set expand-flag to false, otherwise change notifications |
|
2476 | 288 |
"/ are raised during lazy auto creation (to the list). |
2305 | 289 |
isExpanded := false. |
290 |
list := self children. |
|
291 |
isExpanded := true. |
|
292 |
||
2832 | 293 |
list notEmptyOrNil ifTrue:[ |
294 |
list := OrderedCollection new:64. |
|
295 |
self addVisibleChildrenTo:list. |
|
296 |
self model itemAddAll:list beforeIndex:(index + 1). |
|
2305 | 297 |
]. |
298 |
index ~~ 0 ifTrue:[self hierarchyChanged]. |
|
299 |
] ifFalse:[ |
|
300 |
isExpanded := true |
|
1390 | 301 |
] |
2305 | 302 |
]. |
1390 | 303 |
! |
304 |
||
1409 | 305 |
makeVisible |
306 |
"expand all my parents |
|
307 |
" |
|
308 |
(parent notNil and:[parent isHierarchicalItem]) ifTrue:[ |
|
1733 | 309 |
self criticalDo:[ |
310 |
parent expand. |
|
311 |
parent makeVisible |
|
312 |
] |
|
1409 | 313 |
]. |
314 |
! |
|
315 |
||
1390 | 316 |
recursiveCollapse |
2081 | 317 |
"collapse all item and sub items |
1390 | 318 |
**** must be expanded |
319 |
" |
|
320 |
|visChd index| |
|
321 |
||
322 |
self canCollapse ifTrue:[ |
|
1733 | 323 |
self criticalDo:[ |
324 |
(index := self listIndex) notNil ifTrue:[ |
|
2081 | 325 |
"/ do not call :#size: children will be autoloaded !!!! |
1733 | 326 |
(visChd := children size) ~~ 0 ifTrue:[ |
2117 | 327 |
self nonCriticalFrom:1 to:nil do:[:el| |
2081 | 328 |
visChd := visChd + el numberOfVisibleChildren |
329 |
]. |
|
1733 | 330 |
]. |
331 |
self recursiveSetCollapsed. |
|
1390 | 332 |
|
1733 | 333 |
visChd ~~ 0 ifTrue:[ |
334 |
self model itemRemoveFromIndex:(index + 1) |
|
335 |
toIndex:(index + visChd) |
|
336 |
]. |
|
337 |
index ~~ 0 ifTrue:[ |
|
338 |
self hierarchyChanged |
|
339 |
] |
|
340 |
] ifFalse:[ |
|
341 |
self recursiveSetCollapsed |
|
1390 | 342 |
] |
343 |
] |
|
344 |
] |
|
345 |
! |
|
346 |
||
347 |
recursiveExpand |
|
348 |
"expand children and sub-children |
|
349 |
**** must be collapsed |
|
350 |
" |
|
2305 | 351 |
"/ test whether the item already is expanded; #canExpand could be redefined |
352 |
"/ without checking whether the node is expanded (happens already) !! |
|
353 |
||
2846 | 354 |
|index list| |
2547 | 355 |
isExpanded ifTrue:[ ^ self ]. |
2845
fb807c9aa195
Add recursive force expand, to force expand of children independed
ab
parents:
2832
diff
changeset
|
356 |
|
2547 | 357 |
self canExpand ifFalse:[ ^ self ]. |
2305 | 358 |
|
359 |
isExpanded := true. |
|
1390 | 360 |
|
2305 | 361 |
self criticalDo:[ |
362 |
self size ~~ 0 ifTrue:[ |
|
363 |
index := self listIndex. "/ get the visible list index |
|
1390 | 364 |
|
2305 | 365 |
index isNil ifTrue:[ "/ not visible |
366 |
self nonCriticalFrom:1 to:nil do:[:el| |
|
367 |
el setExpanded:true |
|
368 |
]. |
|
369 |
] ifFalse:[ |
|
370 |
list := OrderedCollection new:512. |
|
371 |
self recursiveSetExpandedAndAddToList:list. |
|
372 |
self model itemAddAll:list beforeIndex:(index + 1). |
|
373 |
||
374 |
index ~~ 0 ifTrue:[self hierarchyChanged] |
|
1390 | 375 |
] |
376 |
] |
|
2305 | 377 |
]. |
1390 | 378 |
! |
379 |
||
380 |
recursiveToggleExpand |
|
2081 | 381 |
"if the item is collapsed, the item and all its sub-items |
2547 | 382 |
are expanded otherwise collapsed" |
383 |
||
384 |
isExpanded ifTrue:[ |
|
1598
33202082065d
care for uninitialized isExpanded
Claus Gittinger <cg@exept.de>
parents:
1571
diff
changeset
|
385 |
self recursiveCollapse |
33202082065d
care for uninitialized isExpanded
Claus Gittinger <cg@exept.de>
parents:
1571
diff
changeset
|
386 |
] ifFalse:[ |
33202082065d
care for uninitialized isExpanded
Claus Gittinger <cg@exept.de>
parents:
1571
diff
changeset
|
387 |
self recursiveExpand |
33202082065d
care for uninitialized isExpanded
Claus Gittinger <cg@exept.de>
parents:
1571
diff
changeset
|
388 |
] |
1390 | 389 |
! |
390 |
||
391 |
toggleExpand |
|
2081 | 392 |
"if the item is collapsed, the item is expanded otherwise |
2547 | 393 |
collapsed" |
394 |
||
395 |
isExpanded ifTrue:[ |
|
2081 | 396 |
self collapse |
397 |
] ifFalse:[ |
|
398 |
self expand |
|
399 |
]. |
|
1390 | 400 |
! ! |
401 |
||
1818 | 402 |
!HierarchicalItem methodsFor:'accessing-mvc'! |
1390 | 403 |
|
404 |
application |
|
2927 | 405 |
"returns the responsible application or nil" |
406 |
||
1390 | 407 |
|model| |
408 |
||
409 |
(model := self model) notNil ifTrue:[ |
|
410 |
^ model application |
|
411 |
]. |
|
412 |
^ nil |
|
413 |
! |
|
414 |
||
415 |
applicationsDo:aOneArgBlock |
|
2927 | 416 |
"evaluate the block for each dependent application" |
417 |
||
1390 | 418 |
|model| |
419 |
||
420 |
(model := self model) notNil ifTrue:[ |
|
421 |
model applicationsDo:aOneArgBlock |
|
422 |
] |
|
423 |
! |
|
424 |
||
425 |
model |
|
426 |
"returns the hierachicalList model or nil |
|
427 |
" |
|
2386 | 428 |
|item next| |
429 |
||
2716 | 430 |
item := self. |
431 |
[ (next := item parentOrModel) notNil ] whileTrue:[ |
|
432 |
item := next. |
|
433 |
]. |
|
2386 | 434 |
|
435 |
item isHierarchicalItem ifFalse:[^ item]. |
|
436 |
^ nil |
|
1390 | 437 |
! ! |
438 |
||
439 |
!HierarchicalItem methodsFor:'adding & removing'! |
|
440 |
||
441 |
add:aChildItem |
|
2927 | 442 |
"add a child at end" |
443 |
||
1390 | 444 |
^ self add:aChildItem beforeIndex:(self children size + 1). |
445 |
! |
|
446 |
||
447 |
add:aChildItem after:aChild |
|
2927 | 448 |
"add an item after an existing item" |
449 |
||
1390 | 450 |
|index| |
451 |
||
2315 | 452 |
index := self identityIndexOf:aChild. |
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
453 |
index == 0 ifTrue:[ self subscriptBoundsError:index ]. |
2315 | 454 |
|
455 |
self add:aChildItem beforeIndex:(index + 1). |
|
2927 | 456 |
^ aChildItem |
1390 | 457 |
! |
458 |
||
459 |
add:aChildItem afterIndex:anIndex |
|
2927 | 460 |
"add an item after an index" |
461 |
||
1390 | 462 |
^ self add:aChildItem beforeIndex:(anIndex + 1). |
463 |
! |
|
464 |
||
465 |
add:aChildItem before:aChild |
|
2927 | 466 |
"add an item before an existing item" |
467 |
||
1390 | 468 |
|index| |
469 |
||
2315 | 470 |
index := self identityIndexOf:aChild. |
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
471 |
index == 0 ifTrue:[ self subscriptBoundsError:index ]. |
2315 | 472 |
|
473 |
self add:aChildItem beforeIndex:index. |
|
2927 | 474 |
^ aChild |
1390 | 475 |
! |
476 |
||
477 |
add:aChildItem beforeIndex:anIndex |
|
2927 | 478 |
"add an item before an index" |
479 |
||
1390 | 480 |
aChildItem notNil ifTrue:[ |
481 |
self addAll:(Array with:aChildItem) beforeIndex:anIndex |
|
482 |
]. |
|
483 |
^ aChildItem |
|
484 |
! |
|
485 |
||
1488 | 486 |
add:aChild sortBlock:aBlock |
2927 | 487 |
"add a child sorted" |
488 |
||
1733 | 489 |
self criticalDo:[ |
490 |
self basicAdd:aChild sortBlock:aBlock |
|
1488 | 491 |
]. |
1733 | 492 |
^ aChild |
1488 | 493 |
! |
494 |
||
1390 | 495 |
addAll:aList |
2927 | 496 |
"add children at the end" |
497 |
||
1390 | 498 |
^ self addAll:aList beforeIndex:(self children size + 1) |
499 |
! |
|
500 |
||
1650 | 501 |
addAll:aList before:aChild |
2927 | 502 |
"add an item before an existing item" |
503 |
||
1650 | 504 |
|index| |
505 |
||
2315 | 506 |
index := self identityIndexOf:aChild. |
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
507 |
index == 0 ifTrue:[ self subscriptBoundsError:index ]. |
2315 | 508 |
|
2927 | 509 |
^ self addAll:aList beforeIndex:index |
1650 | 510 |
! |
511 |
||
1390 | 512 |
addAll:aList beforeIndex:anIndex |
2927 | 513 |
"add children before an index" |
514 |
||
1733 | 515 |
aList size ~~ 0 ifTrue:[ |
516 |
self criticalDo:[ |
|
517 |
self basicAddAll:aList beforeIndex:anIndex |
|
518 |
] |
|
519 |
]. |
|
520 |
^ aList |
|
521 |
! |
|
522 |
||
523 |
addAll:aList sortBlock:aBlock |
|
2927 | 524 |
"add children sorted" |
525 |
||
2357 | 526 |
aList size == 0 ifTrue:[ ^ aList ]. |
527 |
||
528 |
aBlock isNil ifTrue:[ |
|
529 |
self addAll:aList. |
|
530 |
] ifFalse:[ |
|
531 |
self criticalDo:[ |
|
532 |
aList do:[:el| self basicAdd:el sortBlock:aBlock ] |
|
1733 | 533 |
] |
534 |
]. |
|
535 |
^ aList |
|
536 |
! |
|
537 |
||
538 |
addAllFirst:aCollectionOfItems |
|
2927 | 539 |
"add children at the beginning" |
540 |
||
1733 | 541 |
^ self addAll:aCollectionOfItems beforeIndex:1 |
542 |
! |
|
543 |
||
544 |
addAllLast:aCollectionOfItems |
|
2927 | 545 |
"add children at the end" |
546 |
||
1733 | 547 |
^ self addAll:aCollectionOfItems |
548 |
! |
|
549 |
||
550 |
addFirst:aChildItem |
|
2927 | 551 |
"add a child at the beginning" |
552 |
||
1733 | 553 |
^ self add:aChildItem beforeIndex:1. |
554 |
! |
|
555 |
||
556 |
addLast:anItem |
|
2927 | 557 |
"add a child at the end" |
558 |
||
1733 | 559 |
^ self add:anItem |
560 |
! |
|
561 |
||
1804 | 562 |
remove |
563 |
"remove the item |
|
564 |
" |
|
565 |
parent notNil ifTrue:[ "check whether parent exists" |
|
566 |
parent isHierarchicalItem ifTrue:[parent remove:self] "parent is HierarchicalItem" |
|
567 |
ifFalse:[parent root:nil] "parent is HierarchicalList" |
|
568 |
]. |
|
569 |
^ self |
|
570 |
! |
|
571 |
||
1733 | 572 |
remove:aChild |
573 |
"remove a child |
|
574 |
" |
|
575 |
self removeIndex:(self identityIndexOf:aChild) |
|
576 |
||
577 |
! |
|
578 |
||
579 |
removeAll |
|
580 |
"remove all children |
|
581 |
" |
|
582 |
|size| |
|
583 |
||
1942 | 584 |
(size := children size) ~~ 0 ifTrue:[ |
1733 | 585 |
self removeFromIndex:1 toIndex:size |
586 |
] |
|
587 |
! |
|
588 |
||
589 |
removeAll:aList |
|
590 |
"remove all children in the collection |
|
591 |
" |
|
592 |
|index| |
|
593 |
||
594 |
aList size ~~ 0 ifTrue:[ |
|
595 |
self criticalDo:[ |
|
596 |
aList do:[:el| |
|
597 |
(index := self identityIndexOf:el) ~~ 0 ifTrue:[ |
|
598 |
self removeIndex:index |
|
599 |
] |
|
600 |
] |
|
601 |
] |
|
602 |
]. |
|
603 |
^ aList |
|
604 |
! |
|
605 |
||
1899 | 606 |
removeFromIndex:startIndex |
607 |
"remove the children from startIndex up to end of children |
|
608 |
" |
|
609 |
^ self removeFromIndex:startIndex toIndex:(children size) |
|
610 |
! |
|
611 |
||
1733 | 612 |
removeFromIndex:startIndex toIndex:stopIndex |
613 |
"remove the children from startIndex up to and including |
|
614 |
the child under stopIndex. |
|
615 |
" |
|
2853
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
616 |
|nrOfChildren stop| |
1899 | 617 |
|
2853
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
618 |
nrOfChildren := children size. |
1899 | 619 |
|
2853
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
620 |
(startIndex <= stopIndex and:[startIndex <= nrOfChildren]) ifTrue:[ |
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
621 |
stop := stopIndex min:nrOfChildren. |
1899 | 622 |
|
623 |
self criticalDo:[ |
|
624 |
self basicRemoveFromIndex:startIndex toIndex:stop |
|
625 |
] |
|
1733 | 626 |
]. |
2853
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
627 |
|
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
628 |
children size == 0 ifTrue:[ |
2854
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
629 |
self clearExpandedWhenLastChildWasRemoved ifTrue:[ |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
630 |
isExpanded := false. |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
631 |
] |
2853
e852742cbd10
when the last child is removed,
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
632 |
]. |
1733 | 633 |
! |
634 |
||
635 |
removeIndex:anIndex |
|
636 |
"remove the child at an index |
|
637 |
" |
|
638 |
anIndex > 0 ifTrue:[ |
|
639 |
self removeFromIndex:anIndex toIndex:anIndex |
|
640 |
] |
|
641 |
! ! |
|
642 |
||
643 |
!HierarchicalItem methodsFor:'basic adding & removing'! |
|
644 |
||
645 |
basicAdd:aChild sortBlock:aBlock |
|
2927 | 646 |
"add a child sorted" |
647 |
||
2357 | 648 |
|size list| |
649 |
||
650 |
size := children size. |
|
651 |
list := Array with:aChild. |
|
652 |
||
653 |
(aBlock notNil and:[size ~~ 0]) ifTrue:[ |
|
654 |
children keysAndValuesDo:[:i :el| |
|
655 |
(aBlock value:aChild value:el) ifTrue:[ |
|
656 |
self basicAddAll:list beforeIndex:i. |
|
657 |
^ aChild |
|
1733 | 658 |
] |
659 |
] |
|
660 |
]. |
|
2357 | 661 |
self basicAddAll:list beforeIndex:(size + 1). |
662 |
^ aChild. |
|
1733 | 663 |
! |
664 |
||
665 |
basicAddAll:aList beforeIndex:anIndex |
|
2927 | 666 |
"add children before an index" |
667 |
||
1602 | 668 |
|coll model notify index size| |
1390 | 669 |
|
1942 | 670 |
size := children size. |
1390 | 671 |
|
672 |
anIndex == 1 ifTrue:[ |
|
673 |
notify := self |
|
674 |
] ifFalse:[ |
|
675 |
anIndex > size ifTrue:[ |
|
676 |
anIndex > (1 + size) ifTrue:[ |
|
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
677 |
^ self subscriptBoundsError:index |
1390 | 678 |
]. |
679 |
notify := self at:size |
|
680 |
] ifFalse:[ |
|
681 |
notify := nil |
|
682 |
] |
|
683 |
]. |
|
1669 | 684 |
children isArray ifTrue:[ |
685 |
children := children asOrderedCollection |
|
686 |
]. |
|
1390 | 687 |
|
688 |
size == 0 ifTrue:[ |
|
689 |
children := OrderedCollection new |
|
690 |
]. |
|
691 |
aList do:[:anItem| anItem parent:self ]. |
|
692 |
children addAll:aList beforeIndex:anIndex. |
|
693 |
||
694 |
(model := self model) isNil ifTrue:[ |
|
695 |
^ aList |
|
696 |
]. |
|
697 |
||
2547 | 698 |
isExpanded ifFalse:[ |
1390 | 699 |
notify notNil ifTrue:[ |
700 |
notify changed |
|
701 |
]. |
|
2547 | 702 |
^ aList |
1390 | 703 |
]. |
704 |
(index := self listIndex) isNil ifTrue:[ |
|
705 |
^ aList |
|
706 |
]. |
|
707 |
||
708 |
children from:1 to:(anIndex - 1) do:[:anItem| |
|
709 |
index := 1 + index + anItem numberOfVisibleChildren |
|
710 |
]. |
|
711 |
coll := OrderedCollection new. |
|
712 |
||
713 |
aList do:[:anItem| |
|
714 |
coll add:anItem. |
|
715 |
anItem addVisibleChildrenTo:coll. |
|
716 |
]. |
|
717 |
model itemAddAll:coll beforeIndex:(index + 1). |
|
718 |
||
719 |
notify notNil ifTrue:[ |
|
720 |
notify changed |
|
721 |
]. |
|
722 |
^ aList |
|
723 |
! |
|
724 |
||
1733 | 725 |
basicRemoveFromIndex:startIndex toIndex:stopIndex |
1390 | 726 |
"remove the children from startIndex up to and including |
2927 | 727 |
the child under stopIndex." |
728 |
||
1390 | 729 |
|model notify |
730 |
index "{ Class:SmallInteger }" |
|
731 |
start "{ Class:SmallInteger }" |
|
732 |
stop "{ Class:SmallInteger }" |
|
733 |
size "{ Class:SmallInteger }" |
|
734 |
| |
|
735 |
size := self children size. |
|
736 |
stop := stopIndex. |
|
737 |
start := startIndex. |
|
738 |
||
739 |
(stop <= size and:[start between:1 and:stop]) ifFalse:[ |
|
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
740 |
^ self subscriptBoundsError:index |
1390 | 741 |
]. |
742 |
start == 1 ifTrue:[ |
|
743 |
notify := self |
|
744 |
] ifFalse:[ |
|
745 |
stop == size ifTrue:[ |
|
746 |
notify := self at:(start - 1) |
|
747 |
] ifFalse:[ |
|
748 |
notify := nil |
|
749 |
] |
|
750 |
]. |
|
751 |
||
752 |
(model := self model) notNil ifTrue:[ |
|
753 |
index := model identityIndexOf:(children at:start). |
|
754 |
size := stop - start + 1. |
|
755 |
] ifFalse:[ |
|
756 |
index := 0 |
|
757 |
]. |
|
1669 | 758 |
|
1390 | 759 |
children from:start to:stop do:[:aChild| |
760 |
index ~~ 0 ifTrue:[ |
|
761 |
size := size + aChild numberOfVisibleChildren |
|
762 |
]. |
|
763 |
aChild parent:nil |
|
764 |
]. |
|
765 |
children removeFromIndex:start toIndex:stop. |
|
766 |
||
767 |
index ~~ 0 ifTrue:[ |
|
768 |
model itemRemoveFromIndex:index toIndex:(index + size - 1) |
|
769 |
]. |
|
770 |
notify notNil ifTrue:[ |
|
771 |
notify changed |
|
772 |
]. |
|
773 |
! ! |
|
774 |
||
775 |
!HierarchicalItem methodsFor:'change & update'! |
|
776 |
||
1606 | 777 |
changed:what with:anArgument |
1390 | 778 |
"the item changed; raise change notification |
2854
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
779 |
#icon icon is modified; height and width are unchanged |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
780 |
#hierarchy collapsed/expanded; height and width are unchanged |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
781 |
#redraw redraw but height and width are unchanged |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
782 |
....... all others: the height and width are reset |
1390 | 783 |
" |
1974 | 784 |
|model why| |
1390 | 785 |
|
1974 | 786 |
what ~~ #redraw ifTrue:[ |
787 |
(what ~~ #hierarchy and:[what ~~ #icon]) ifTrue:[ |
|
2081 | 788 |
self class doResetExtentOnChange ifTrue:[ |
789 |
width := height := nil |
|
790 |
]. |
|
1974 | 791 |
]. |
792 |
why := what |
|
2230 | 793 |
] ifFalse:[ |
794 |
why := #redraw |
|
1606 | 795 |
]. |
796 |
(model := self model) notNil ifTrue:[ |
|
1974 | 797 |
model itemChanged:why with:anArgument from:self |
1390 | 798 |
]. |
1974 | 799 |
super changed:why with:anArgument |
1390 | 800 |
! |
801 |
||
2193
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
802 |
childrenOrderChanged |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
803 |
"called if the order of the children changed by a user |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
804 |
operation. Update the model and raise a change notification for |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
805 |
each item which has changed its position |
2927 | 806 |
triggered by the user operation !!" |
807 |
||
2193
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
808 |
|model visStart list| |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
809 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
810 |
self isExpanded ifFalse:[ ^ self ]. "/ not expanded |
2206 | 811 |
children size > 1 ifFalse:[ ^ self ]. |
2193
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
812 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
813 |
model := self model. |
3166 | 814 |
model isNil ifTrue:[^ self]. "/ no model |
2193
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
815 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
816 |
visStart := model identityIndexOf:self. |
2260 | 817 |
visStart == 0 ifTrue:[ |
2305 | 818 |
model root ~~ self ifTrue:[ ^ self ]. |
819 |
"/ I'am the root but switched of by setting #showRoot to false |
|
2260 | 820 |
]. |
2193
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
821 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
822 |
self criticalDo:[ |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
823 |
list := OrderedCollection new. |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
824 |
self addVisibleChildrenTo:list. |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
825 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
826 |
list do:[:el| |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
827 |
visStart := visStart + 1. |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
828 |
|
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
829 |
(model at:visStart ifAbsent:el) ~~ el ifTrue:[ |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
830 |
model at:visStart put:el |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
831 |
]. |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
832 |
] |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
833 |
]. |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
834 |
! |
41d5d33c9f78
add method to synchronize the model with the changed children order
ca
parents:
2117
diff
changeset
|
835 |
|
1843 | 836 |
fontChanged |
837 |
"called if the font has changed |
|
838 |
" |
|
839 |
width := height := nil. |
|
840 |
||
841 |
children size ~~ 0 ifTrue:[ |
|
842 |
children do:[:el| el fontChanged ]. |
|
843 |
]. |
|
844 |
! |
|
845 |
||
1390 | 846 |
hierarchyChanged |
847 |
"hierarchy changed; optimize redrawing |
|
848 |
" |
|
849 |
self changed:#hierarchy with:nil |
|
850 |
! |
|
851 |
||
852 |
iconChanged |
|
853 |
"icon changed; optimize redrawing |
|
854 |
" |
|
855 |
self changed:#icon with:nil |
|
856 |
! ! |
|
857 |
||
858 |
!HierarchicalItem methodsFor:'enumerating'! |
|
859 |
||
1804 | 860 |
collect:aBlock |
861 |
"for each child in the receiver, evaluate the argument, aBlock |
|
2927 | 862 |
and return a new collection with the results" |
863 |
||
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
864 |
|coll| |
1804 | 865 |
|
2081 | 866 |
coll := OrderedCollection new. |
867 |
self do:[:el| coll add:(aBlock value:el) ]. |
|
2927 | 868 |
^ coll |
1804 | 869 |
! |
870 |
||
2465 | 871 |
contains:aBlock |
872 |
"return true if aBlock returns true for any of the receivers items" |
|
873 |
||
874 |
self do:[:el | (aBlock value:el) ifTrue:[^ true] ]. |
|
875 |
^ false |
|
876 |
! |
|
877 |
||
1390 | 878 |
do:aOneArgBlock |
2879 | 879 |
"evaluate a block for each child" |
880 |
||
2081 | 881 |
^ self from:1 do:aOneArgBlock |
1390 | 882 |
! |
883 |
||
884 |
from:startIndex do:aOneArgBlock |
|
885 |
"evaluate a block on each child starting with the |
|
886 |
child at startIndex to the end. |
|
887 |
" |
|
2117 | 888 |
^ self from:startIndex to:nil do:aOneArgBlock |
2081 | 889 |
! |
890 |
||
891 |
from:startIndex reverseDo:aOneArgBlock |
|
892 |
"evaluate a block on each child starting at end to the startIndex |
|
893 |
" |
|
2117 | 894 |
^ self from:startIndex to:nil reverseDo:aOneArgBlock |
1390 | 895 |
! |
896 |
||
897 |
from:startIndex to:endIndex do:aOneArgBlock |
|
898 |
"evaluate a block on each child starting with the |
|
899 |
child at startIndex to the endIndex. |
|
900 |
" |
|
2081 | 901 |
|res| |
902 |
||
903 |
self size < startIndex ifTrue:[^ nil]. |
|
904 |
res := nil. |
|
905 |
||
906 |
self criticalDo:[ |
|
2117 | 907 |
res := self nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
908 |
]. |
2081 | 909 |
^ res |
1390 | 910 |
! |
911 |
||
912 |
from:startIndex to:endIndex reverseDo:aOneArgBlock |
|
913 |
"evaluate a block on each child starting with the |
|
914 |
child at endIndex to the startIndex. |
|
915 |
" |
|
2081 | 916 |
|res| |
917 |
||
918 |
self size < startIndex ifTrue:[^ nil]. |
|
919 |
res := nil. |
|
920 |
||
921 |
self criticalDo:[ |
|
2117 | 922 |
res := self nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
923 |
]. |
2081 | 924 |
^ res |
1390 | 925 |
! |
926 |
||
1966 | 927 |
keysAndValuesDo:aTwoArgBlock |
928 |
"evaluate the argument, aBlock for every child, |
|
2081 | 929 |
passing both index and element as arguments. |
930 |
" |
|
931 |
|key res| |
|
1966 | 932 |
|
2081 | 933 |
key := 1. |
934 |
res := nil. |
|
935 |
||
936 |
self do:[:el| |
|
937 |
res := el value:key value:el. |
|
938 |
key := key + 1. |
|
1966 | 939 |
]. |
2081 | 940 |
^ res |
1966 | 941 |
! |
942 |
||
943 |
keysAndValuesReverseDo:aTwoArgBlock |
|
944 |
"evaluate the argument, aBlock in reverse order for every |
|
2081 | 945 |
child, passing both index and element as arguments. |
946 |
" |
|
947 |
|res| |
|
1966 | 948 |
|
2081 | 949 |
self size == 0 ifTrue:[^ nil]. |
950 |
res := nil. |
|
951 |
||
952 |
self criticalDo:[ |
|
2117 | 953 |
res := self nonCriticalKeysAndValuesReverseDo:aTwoArgBlock |
1966 | 954 |
]. |
2081 | 955 |
^ res |
1966 | 956 |
! |
957 |
||
1804 | 958 |
recursiveCollect:aBlock |
959 |
"for each child in the receiver, evaluate the argument, aBlock |
|
960 |
and return a new collection with the results |
|
961 |
" |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
962 |
|coll| |
1804 | 963 |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
964 |
coll := OrderedCollection new. |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
965 |
self recursiveDo:[:el| coll add:(aBlock value:el) ]. |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
966 |
^ coll |
1804 | 967 |
! |
968 |
||
1390 | 969 |
recursiveDo:aOneArgBlock |
970 |
"evaluate a block on each item and all the sub-items |
|
971 |
" |
|
972 |
self do:[:aChild| |
|
973 |
aOneArgBlock value:aChild. |
|
2117 | 974 |
aChild nonCriticalRecursiveDo:aOneArgBlock |
1390 | 975 |
]. |
976 |
! |
|
977 |
||
1804 | 978 |
recursiveReverseDo:aOneArgBlock |
979 |
"evaluate a block on each item and all the sub-items; |
|
980 |
proccesing children in reverse direction |
|
981 |
" |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
982 |
self reverseDo:[:aChild| |
2117 | 983 |
aChild nonCriticalRecursiveReverseDo:aOneArgBlock. |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
984 |
aOneArgBlock value:aChild. |
1804 | 985 |
]. |
986 |
! |
|
987 |
||
988 |
recursiveSelect:aBlock |
|
989 |
"return a new collection with all children and subChildren from the receiver, for which |
|
990 |
the argument aBlock evaluates to true. |
|
991 |
" |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
992 |
|coll| |
1804 | 993 |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
994 |
coll := OrderedCollection new. |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
995 |
self recursiveDo:[:el| (aBlock value:el) ifTrue:[coll add:el] ]. |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
996 |
^ coll |
1804 | 997 |
! |
998 |
||
1390 | 999 |
reverseDo:aOneArgBlock |
2081 | 1000 |
"evaluate a block on each child in reverse direction |
1390 | 1001 |
" |
2081 | 1002 |
^ self from:1 reverseDo:aOneArgBlock |
1804 | 1003 |
! |
1004 |
||
1005 |
select:aBlock |
|
2081 | 1006 |
"return a new collection with all items from the receiver, for which |
1804 | 1007 |
the argument aBlock evaluates to true. |
1008 |
" |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1009 |
|coll| |
1831
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1010 |
|
2081 | 1011 |
coll := OrderedCollection new. |
1012 |
self do:[:el| (aBlock value:el) ifTrue:[coll add:el] ]. |
|
1013 |
^ coll |
|
1876 | 1014 |
! |
1015 |
||
1016 |
withAllDo:aOneArgBlock |
|
2081 | 1017 |
"evaluate the block on each item and subitem including self |
1876 | 1018 |
" |
2081 | 1019 |
aOneArgBlock value:self. |
1020 |
||
1021 |
self do:[:el| |
|
1022 |
aOneArgBlock value:el. |
|
2117 | 1023 |
el nonCriticalRecursiveDo:aOneArgBlock. |
1883 | 1024 |
]. |
1025 |
! ! |
|
1804 | 1026 |
|
1027 |
!HierarchicalItem methodsFor:'enumerating parents'! |
|
1028 |
||
1029 |
parentsDetect:aBlock |
|
1030 |
"find the first parent, for which evaluation of the block returns |
|
1031 |
true; if none does so, report an error |
|
1032 |
" |
|
1033 |
^ self parentsDetect:aBlock ifNone:[self errorNotFound] |
|
1034 |
! |
|
1035 |
||
1036 |
parentsDetect:aBlock ifNone:anExceptionBlock |
|
1037 |
"find the first parent, for which evaluation of the block returns |
|
1038 |
true; if none does so, return the evaluation of anExceptionBlock |
|
1039 |
" |
|
1040 |
|prnt| |
|
1041 |
||
1042 |
prnt := self. |
|
1043 |
||
1044 |
self criticalDo:[ |
|
1045 |
[(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[ |
|
1046 |
(aBlock value:prnt) ifTrue:[^ prnt] |
|
1047 |
] |
|
1048 |
]. |
|
1049 |
^ anExceptionBlock value |
|
1050 |
! |
|
1051 |
||
1052 |
parentsDo:aBlock |
|
1053 |
"evaluate a block on each parent |
|
1054 |
" |
|
1055 |
|prnt| |
|
1056 |
||
1057 |
prnt := self. |
|
1058 |
||
1059 |
self criticalDo:[ |
|
1060 |
[(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[ |
|
1061 |
aBlock value:prnt |
|
1062 |
] |
|
1063 |
]. |
|
1390 | 1064 |
! ! |
1065 |
||
1066 |
!HierarchicalItem methodsFor:'initialization'! |
|
1067 |
||
1068 |
initialize |
|
1069 |
isExpanded := false |
|
1070 |
! ! |
|
1071 |
||
1072 |
!HierarchicalItem methodsFor:'private'! |
|
1073 |
||
1074 |
addVisibleChildrenTo:aList |
|
2547 | 1075 |
"add all visible children and sub-children to the list" |
1076 |
||
1077 |
isExpanded ifFalse:[^ self]. |
|
1390 | 1078 |
|
2117 | 1079 |
self nonCriticalFrom:1 to:nil do:[:el| |
2081 | 1080 |
aList add:el. |
1081 |
el addVisibleChildrenTo:aList. |
|
1082 |
]. |
|
1390 | 1083 |
! |
1084 |
||
2854
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
1085 |
clearExpandedWhenLastChildWasRemoved |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
1086 |
^ true |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
1087 |
! |
20b890ba0f6c
allow subclasses to define the collapse-behavior
Claus Gittinger <cg@exept.de>
parents:
2853
diff
changeset
|
1088 |
|
1733 | 1089 |
criticalDo:aBlock |
1090 |
|model| |
|
1091 |
||
1092 |
(model := self model) notNil ifTrue:[ |
|
1093 |
model recursionLock critical:aBlock |
|
1094 |
] ifFalse:[ |
|
1095 |
aBlock value |
|
1096 |
] |
|
1097 |
! |
|
1098 |
||
1390 | 1099 |
listIndex |
1100 |
"returns the visible index or nil; for a none visible root |
|
1101 |
0 is returned |
|
1102 |
" |
|
1103 |
|index model| |
|
1104 |
||
1105 |
(model := self model) notNil ifTrue:[ |
|
1106 |
index := model identityIndexOf:self. |
|
1107 |
||
1108 |
(index ~~ 0 or:[parent == model]) ifTrue:[ |
|
1109 |
^ index |
|
1110 |
] |
|
1111 |
]. |
|
1112 |
^ nil |
|
1113 |
! |
|
1114 |
||
1115 |
numberOfVisibleChildren |
|
2547 | 1116 |
"returns number of all visible children including subchildren" |
1117 |
||
2081 | 1118 |
|size| |
1119 |
||
2547 | 1120 |
isExpanded ifFalse:[^ 0]. |
2081 | 1121 |
size := 0. |
1122 |
||
2117 | 1123 |
self nonCriticalFrom:1 to:nil do:[:el| |
2081 | 1124 |
size := 1 + size + el numberOfVisibleChildren |
1390 | 1125 |
]. |
2081 | 1126 |
^ size |
1390 | 1127 |
! |
1128 |
||
1129 |
parentOrModel |
|
1130 |
"returns the parent without checking for item or model |
|
1131 |
" |
|
1132 |
^ parent |
|
1133 |
! |
|
1134 |
||
1135 |
setExpanded:aBoolean |
|
2547 | 1136 |
"set expanded flag without any computation or notification" |
1137 |
||
1390 | 1138 |
isExpanded := aBoolean |
1139 |
! ! |
|
1140 |
||
2493 | 1141 |
!HierarchicalItem methodsFor:'private-displaying'! |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1142 |
|
1606 | 1143 |
displayLabel:aLabel h:lH on:aGC x:x y:y h:h |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1144 |
"display the label at x@y |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1145 |
" |
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1146 |
|y0| |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1147 |
|
1606 | 1148 |
lH ~~ 0 ifTrue:[ |
1149 |
y0 := y - (lH + 1 - h // 2). |
|
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1150 |
|
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1151 |
y0 := y0 + (aLabel ascentOn:aGC). |
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1152 |
(aLabel isString not |
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1153 |
or:[(aLabel includes:(Character cr)) not]) ifTrue:[ |
1606 | 1154 |
^ aLabel displayOn:aGC x:x y:y0 |
1155 |
]. |
|
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1156 |
|
1606 | 1157 |
aLabel asCollectionOfLines do:[:el| |
1158 |
el displayOn:aGC x:x y:y0. |
|
2484
92f9e42980ab
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1159 |
y0 := y0 + (el heightOn:aGC) |
1606 | 1160 |
] |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1161 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1162 |
! |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1163 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1164 |
heightOf:aLabel on:aGC |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1165 |
"returns the height of the label or 0 |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1166 |
" |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1167 |
|h| |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1168 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1169 |
aLabel isSequenceable ifFalse:[ |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1170 |
^ aLabel notNil ifTrue:[aLabel heightOn:aGC] ifFalse:[0] |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1171 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1172 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1173 |
aLabel isString ifFalse:[ |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1174 |
h := 0. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1175 |
aLabel do:[:el|h := h max:(self heightOf:el on:aGC)]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1176 |
^ h |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1177 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1178 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1179 |
h := 1 + (aLabel occurrencesOf:(Character cr)). |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1180 |
^ h * (aGC font height) |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1181 |
! |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1182 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1183 |
widthOf:aLabel on:aGC |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1184 |
"returns the height of the label or 0 |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1185 |
" |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1186 |
|w| |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1187 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1188 |
aLabel isSequenceable ifFalse:[ |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1189 |
^ aLabel notNil ifTrue:[aLabel widthOn:aGC] ifFalse:[0] |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1190 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1191 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1192 |
aLabel isString ifFalse:[ |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1193 |
w := -5. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1194 |
aLabel do:[:el|w := w + 5 + (self widthOf:el on:aGC)]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1195 |
^ w |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1196 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1197 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1198 |
(aLabel indexOf:(Character cr)) == 0 ifTrue:[ |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1199 |
^ aLabel widthOn:aGC |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1200 |
]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1201 |
|
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1202 |
w := 0. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1203 |
aLabel asCollectionOfLines do:[:el|w := w max:(el widthOn:aGC)]. |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1204 |
^ w |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1205 |
! ! |
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1206 |
|
2493 | 1207 |
!HierarchicalItem methodsFor:'private-enumerating'! |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1208 |
|
2117 | 1209 |
nonCriticalDo:aOneArgBlock |
1210 |
"evaluate a block noncritical on each child. |
|
1211 |
" |
|
1212 |
^ self nonCriticalFrom:1 to:nil do:aOneArgBlock |
|
1213 |
! |
|
1214 |
||
1215 |
nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock |
|
1216 |
"evaluate a block noncritical on each child starting with the |
|
2081 | 1217 |
child at startIndex to the endIndex (if nil to end of list). |
1218 |
" |
|
1219 |
|list size resp| |
|
1220 |
||
1221 |
list := self children. |
|
1222 |
size := list size. |
|
1223 |
||
1224 |
startIndex > size ifTrue:[^ nil]. |
|
1225 |
resp := nil. |
|
1226 |
||
1227 |
endIndex notNil ifTrue:[ |
|
1228 |
size := size min:endIndex |
|
1229 |
]. |
|
1230 |
startIndex to:size do:[:i| |item| |
|
1231 |
item := list at:i ifAbsent:nil. |
|
1232 |
item isNil ifTrue:[^ resp]. |
|
1233 |
resp := aOneArgBlock value:item. |
|
1234 |
]. |
|
1235 |
^ resp |
|
1236 |
! |
|
1237 |
||
2117 | 1238 |
nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock |
1239 |
"evaluate a block non critical on each child starting with the |
|
2081 | 1240 |
child at endIndex (if nil to end of list) to startIndex. |
1241 |
" |
|
1242 |
|list size resp| |
|
1243 |
||
1244 |
list := self children. |
|
1245 |
size := list size. |
|
1246 |
resp := nil. |
|
1247 |
||
1248 |
endIndex notNil ifTrue:[ |
|
1249 |
size := size min:endIndex |
|
1250 |
]. |
|
1251 |
size to:startIndex by:-1 do:[:i| |item| |
|
1252 |
item := list at:i ifAbsent:nil. |
|
1253 |
item isNil ifTrue:[^ resp]. |
|
1254 |
resp := aOneArgBlock value:item. |
|
1255 |
]. |
|
1256 |
^ resp |
|
1257 |
! |
|
1258 |
||
2117 | 1259 |
nonCriticalKeysAndValuesReverseDo:aOneArgBlock |
2081 | 1260 |
"evaluate the argument, aBlock in reverse order for every |
1261 |
child, passing both index and element as arguments. |
|
1262 |
" |
|
1263 |
|list size resp| |
|
1264 |
||
1265 |
list := self children. |
|
1266 |
size := list size. |
|
1267 |
resp := nil. |
|
1268 |
||
1269 |
size to:1 by:-1 do:[:i| |item| |
|
1270 |
item := list at:i ifAbsent:nil. |
|
1271 |
item isNil ifTrue:[^ resp]. |
|
1272 |
resp := aOneArgBlock value:i value:item. |
|
1273 |
]. |
|
1274 |
^ resp |
|
1275 |
! |
|
1276 |
||
2117 | 1277 |
nonCriticalRecursiveDo:anOneArgBlock |
1278 |
"evaluate the block non critical on each item and all the sub-items |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1279 |
" |
2117 | 1280 |
self nonCriticalFrom:1 to:nil do:[:aChild| |
2081 | 1281 |
anOneArgBlock value:aChild. |
2117 | 1282 |
aChild nonCriticalRecursiveDo:anOneArgBlock |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1283 |
]. |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1284 |
! |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1285 |
|
2117 | 1286 |
nonCriticalRecursiveReverseDo:anOneArgBlock |
1287 |
"evaluate the block non critical on each item and all the sub-items; |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1288 |
proccesing children in reverse direction |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1289 |
" |
2117 | 1290 |
self nonCriticalFrom:1 to:nil reverseDo:[:aChild| |
1291 |
aChild nonCriticalRecursiveReverseDo:anOneArgBlock. |
|
2081 | 1292 |
anOneArgBlock value:aChild. |
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1293 |
]. |
2294 | 1294 |
! |
1295 |
||
1296 |
nonCriticalRecursiveSort:aSortBlock |
|
1297 |
"evaluate a block noncritical on each child. |
|
1298 |
" |
|
1299 |
|unsorted sorted| |
|
1300 |
||
1301 |
unsorted := children. |
|
1302 |
||
1303 |
unsorted size ~~ 0 ifTrue:[ |
|
1304 |
sorted := unsorted sort:aSortBlock. |
|
1305 |
sorted do:[:el| el nonCriticalRecursiveSort:aSortBlock ]. |
|
1306 |
children := sorted. |
|
1307 |
]. |
|
2008
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1308 |
! ! |
916175defb9e
add none critical blocks for recursive operations (optimize)
ca
parents:
1974
diff
changeset
|
1309 |
|
2493 | 1310 |
!HierarchicalItem methodsFor:'private-hierarchy'! |
1390 | 1311 |
|
1312 |
recursiveSetCollapsed |
|
2547 | 1313 |
"collapse all children and sub-children without notifications" |
1314 |
||
1390 | 1315 |
isExpanded := false. |
1316 |
||
2547 | 1317 |
"/ do not call #size: children will be autoloaded !!!! |
2081 | 1318 |
children size ~~ 0 ifTrue:[ |
2547 | 1319 |
self nonCriticalFrom:1 to:nil do:[:el| el canRecursiveCollapse ifTrue:[el recursiveSetCollapsed]]. |
1390 | 1320 |
] |
1321 |
! |
|
1322 |
||
1323 |
recursiveSetExpandedAndAddToList:aList |
|
1324 |
"expand all children and sub-children without notifications; |
|
2547 | 1325 |
add children to list" |
1326 |
||
1390 | 1327 |
isExpanded := true. |
1328 |
||
2547 | 1329 |
self do:[:eachChild| |
2601 | 1330 |
aList add:eachChild. |
1331 |
||
2547 | 1332 |
eachChild canRecursiveExpand ifTrue:[ |
1333 |
eachChild recursiveSetExpandedAndAddToList:aList. |
|
1334 |
]. |
|
2081 | 1335 |
]. |
1390 | 1336 |
! ! |
1337 |
||
2851 | 1338 |
!HierarchicalItem methodsFor:'protocol-accessing'! |
1390 | 1339 |
|
1340 |
children |
|
2851 | 1341 |
"returns a list of children |
2927 | 1342 |
*** to optimize: redefine by subClass" |
1343 |
||
1390 | 1344 |
|model| |
1345 |
||
1346 |
children isNil ifTrue:[ |
|
1347 |
(model := self model) notNil ifTrue:[ |
|
1486 | 1348 |
children := model childrenFor:self |
1390 | 1349 |
]. |
1350 |
]. |
|
1351 |
^ children |
|
1352 |
! |
|
1353 |
||
1354 |
icon |
|
1355 |
"returns the icon or nil; |
|
1356 |
*** to optimize:redefine by subClass |
|
1357 |
" |
|
1358 |
|model| |
|
1359 |
||
1360 |
(model := self model) notNil ifTrue:[ |
|
1361 |
^ model iconFor:self |
|
1362 |
]. |
|
1363 |
^ nil |
|
1364 |
! |
|
1365 |
||
1366 |
label |
|
1367 |
"returns the label displayed on aGC; |
|
1368 |
*** to optimize:redefine by subClass |
|
1369 |
" |
|
1370 |
|model| |
|
1371 |
||
1372 |
(model := self model) notNil ifTrue:[ |
|
1373 |
^ model labelFor:self |
|
1374 |
]. |
|
1375 |
^ nil |
|
1376 |
||
1377 |
! |
|
1378 |
||
1379 |
middleButtonMenu |
|
2602 | 1380 |
"returns the items middleButtonMenu or nil if no menu is defined. |
1381 |
If nil is returned, the view is asked for a menu. |
|
1390 | 1382 |
" |
1383 |
|model| |
|
1384 |
||
1385 |
(model := self model) notNil ifTrue:[ |
|
1386 |
^ model middleButtonMenuFor:self |
|
1387 |
]. |
|
1388 |
^ nil |
|
1831
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1389 |
! |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1390 |
|
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1391 |
recursiveSortChildren:aSortBlock |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1392 |
|children| |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1393 |
|
2832 | 1394 |
(children := self children) notEmptyOrNil ifTrue:[ |
1831
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1395 |
self criticalDo:[ |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1396 |
children sort:aSortBlock. |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1397 |
children do:[:aChild| aChild recursiveSortChildren:aSortBlock ] |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1398 |
] |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1399 |
]. |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1400 |
! |
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1401 |
|
8efa00e1247a
sort stuff; height fix when label changes
Claus Gittinger <cg@exept.de>
parents:
1818
diff
changeset
|
1402 |
sortChildren:aSortBlock |
2708 | 1403 |
"sort the children inplace using the 2-arg block sortBlock for comparison" |
1404 |
||
1405 |
<resource: #obsolete> |
|
1406 |
self obsoleteMethodWarning:'use #sort:'. |
|
2252 | 1407 |
self sort:aSortBlock. |
1390 | 1408 |
! ! |
1409 |
||
2851 | 1410 |
!HierarchicalItem methodsFor:'protocol-displaying'! |
1390 | 1411 |
|
1532
56e0fafc4349
change display protocol for item
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
1412 |
displayOn:aGC x:x y:y h:h |
1390 | 1413 |
"draw the receiver in the graphicsContext, aGC. |
1414 |
" |
|
1415 |
|label |
|
1398 | 1416 |
x0 "{ Class:SmallInteger }" |
1390 | 1417 |
| |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1418 |
(label := self label) isNil ifTrue:[^ self]. |
1398 | 1419 |
|
1420 |
(label isSequenceable and:[label isString not]) ifFalse:[ |
|
1606 | 1421 |
^ self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h |
1398 | 1422 |
]. |
1423 |
||
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1424 |
x0 := x. |
1398 | 1425 |
label do:[:el| |
1426 |
el notNil ifTrue:[ |
|
1606 | 1427 |
self displayLabel:el h:(self heightOf:el on:aGC) on:aGC x:x0 y:y h:h. |
1398 | 1428 |
x0 := x0 + 5 + (el widthOn:aGC). |
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1429 |
]. |
1390 | 1430 |
] |
1431 |
! |
|
1432 |
||
1433 |
heightOn:aGC |
|
1434 |
"return the width of the receiver, if it is to be displayed on aGC |
|
1435 |
" |
|
1606 | 1436 |
height isNil ifTrue:[ |
1437 |
height := self heightOf:(self label) on:aGC |
|
1438 |
]. |
|
1439 |
^ height |
|
1390 | 1440 |
! |
1441 |
||
1442 |
widthOn:aGC |
|
1443 |
"return the width of the receiver, if it is to be displayed on aGC |
|
1444 |
" |
|
1606 | 1445 |
width isNil ifTrue:[ |
1446 |
width := self widthOf:(self label) on:aGC |
|
1447 |
]. |
|
1448 |
^ width |
|
1449 |
||
1390 | 1450 |
! ! |
1451 |
||
2851 | 1452 |
!HierarchicalItem methodsFor:'protocol-event processing'! |
2313 | 1453 |
|
1454 |
processButtonPress:button x:x y:y |
|
1455 |
"a mouse button was pressed in my label. |
|
2519 | 1456 |
Return true, if the event is eaten (ignored by the gc). |
1457 |
On default false is returned (should be handled by the gc). |
|
1458 |
" |
|
1459 |
^ false |
|
1460 |
! |
|
1461 |
||
1462 |
processButtonPress:button x:x y:y on:aGC |
|
1463 |
"a mouse button was pressed in my label. |
|
1464 |
Return true, if the event is eaten (ignored by the gc). |
|
1465 |
On default false is returned (should be handled by the gc). |
|
1466 |
" |
|
1467 |
^ self processButtonPress:button x:x y:y |
|
1468 |
! |
|
1469 |
||
1470 |
processButtonPressOnIcon:button on:aGC |
|
1471 |
"a mouse button was pressed in my icon. |
|
1472 |
Return true, if the event is eaten (ignored by the gc). |
|
1473 |
On default false is returned (should be handled by the gc). |
|
2313 | 1474 |
" |
1475 |
^ false |
|
1476 |
! ! |
|
1477 |
||
2851 | 1478 |
!HierarchicalItem methodsFor:'protocol-monitoring'! |
1390 | 1479 |
|
1480 |
monitoringCycle |
|
1481 |
"called all 'n' seconds by the model, if the monitoring |
|
1482 |
cycle is enabled. The item can perform some checks, .. |
|
1483 |
**** can be redefined by subclass to perform some actions |
|
1484 |
" |
|
1485 |
! ! |
|
1486 |
||
2851 | 1487 |
!HierarchicalItem methodsFor:'protocol-queries'! |
1390 | 1488 |
|
2305 | 1489 |
canCollapse |
1490 |
"called before collapsing the item; can be redefined |
|
2547 | 1491 |
by subclass to omit the collapse operation" |
1492 |
||
1493 |
^ isExpanded |
|
2305 | 1494 |
! |
1495 |
||
1496 |
canExpand |
|
1497 |
"called before expanding the item; can be redefined |
|
2549 | 1498 |
by subclass to omit the expand operation" |
2547 | 1499 |
|
2549 | 1500 |
^ self hasChildren |
2547 | 1501 |
! |
1502 |
||
1503 |
canRecursiveCollapse |
|
1504 |
"called before collapsing the item; can be redefined |
|
1505 |
by subclass to omit the collapse operation " |
|
1506 |
||
1507 |
^ self canCollapse |
|
1508 |
! |
|
1509 |
||
1510 |
canRecursiveExpand |
|
1511 |
"called before expanding the item; can be redefined |
|
1512 |
by subclass to omit the collapse operation" |
|
1513 |
||
1514 |
^ self canExpand |
|
2305 | 1515 |
! |
1516 |
||
1571 | 1517 |
drawHorizontalLineUpToText |
1518 |
"draw the horizizontal line for the selected item up to the text |
|
1519 |
or on default to the start of the the vertical line; only used by |
|
1520 |
the hierarchical view |
|
1521 |
" |
|
1522 |
^ false |
|
1523 |
! |
|
1524 |
||
1390 | 1525 |
hasChildren |
2851 | 1526 |
"checks whether the item has children; |
1527 |
the list needs not to be loaded yet( example. FileDirectory ). |
|
1528 |
*** to optimize: redefine in subClass |
|
1390 | 1529 |
" |
2081 | 1530 |
^ self children size ~~ 0 |
1390 | 1531 |
! |
1532 |
||
2201
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1533 |
hasIndicator |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1534 |
"on default the indicator is drawn if the item |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1535 |
has children |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1536 |
" |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1537 |
^ self hasChildren |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1538 |
! |
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2193
diff
changeset
|
1539 |
|
2305 | 1540 |
isSelectable |
1541 |
"returns true if the item is selectable otherwise false |
|
1542 |
" |
|
1543 |
^ true |
|
1544 |
! |
|
1545 |
||
1390 | 1546 |
string |
1547 |
"access the printable string used for steping through a list |
|
1548 |
searching for an entry starting with a character. |
|
1549 |
*** to optimize:redefine by subClass |
|
1550 |
" |
|
1398 | 1551 |
|label| |
1552 |
||
1553 |
(label := self label) notNil ifTrue:[ |
|
1554 |
label isString ifTrue:[ ^ label string ]. |
|
1555 |
label isImageOrForm ifTrue:[ ^ nil ]. |
|
1556 |
||
1557 |
label isSequenceable ifFalse:[ |
|
1558 |
^ label perform:#string ifNotUnderstood:nil |
|
1559 |
]. |
|
1560 |
||
1561 |
label do:[:el||s| |
|
1562 |
(el notNil and:[el isImageOrForm not]) ifTrue:[ |
|
1563 |
s := el perform:#string ifNotUnderstood:nil. |
|
1564 |
s notNil ifTrue:[^ s]. |
|
1565 |
] |
|
1566 |
] |
|
1567 |
]. |
|
1568 |
^ nil |
|
1569 |
||
1390 | 1570 |
|
1571 |
! ! |
|
1572 |
||
1573 |
!HierarchicalItem methodsFor:'queries'! |
|
1574 |
||
1804 | 1575 |
isChildOf:anItem |
1576 |
"returns true if the item is a child of anItem |
|
1577 |
" |
|
1578 |
|item| |
|
1579 |
||
1580 |
item := self. |
|
1581 |
||
1582 |
[anItem ~~ item] whileTrue:[ |
|
1583 |
((item := item parent) notNil and:[item isHierarchicalItem]) ifFalse:[ |
|
1584 |
^ false |
|
1585 |
] |
|
1586 |
]. |
|
1587 |
^ true |
|
1588 |
||
1589 |
! |
|
1590 |
||
2305 | 1591 |
isCollapsed |
2547 | 1592 |
"returns true if the item is collapsed" |
1593 |
||
1594 |
^ isExpanded not |
|
2305 | 1595 |
! |
1596 |
||
3173 | 1597 |
isDirectoryItem |
1598 |
^ false |
|
1599 |
||
1600 |
"Created: / 23-06-2006 / 12:47:05 / fm" |
|
1601 |
"Modified: / 23-02-2007 / 12:04:23 / User" |
|
1602 |
! |
|
1603 |
||
1390 | 1604 |
isExpanded |
2547 | 1605 |
"returns true if the item is expanded" |
1606 |
||
1607 |
^ isExpanded |
|
1390 | 1608 |
! |
1609 |
||
1610 |
isHierarchicalItem |
|
1611 |
"used to decide if the parent is a hierarchical item |
|
1612 |
or the model |
|
1613 |
" |
|
1614 |
^ true |
|
1615 |
! |
|
1616 |
||
2033 | 1617 |
isRealChildOf:anItem |
1618 |
"returns true if the item is a child of anItem |
|
1619 |
" |
|
1620 |
|item| |
|
1621 |
item := self parent. |
|
1622 |
||
1623 |
[item notNil] whileTrue:[ |
|
1624 |
item == anItem ifTrue:[^ true]. |
|
1625 |
item := item parent. |
|
1626 |
]. |
|
1627 |
^ false |
|
1628 |
! |
|
1629 |
||
1876 | 1630 |
isRootItem |
1631 |
"returns true if the item is the root item |
|
1632 |
" |
|
1883 | 1633 |
^ parent isHierarchicalItem not |
1634 |
! |
|
1876 | 1635 |
|
1390 | 1636 |
size |
1637 |
"return the number of children |
|
1638 |
" |
|
2081 | 1639 |
^ self children size |
1390 | 1640 |
! ! |
1641 |
||
1642 |
!HierarchicalItem methodsFor:'searching'! |
|
1643 |
||
1644 |
detect:aOneArgBlock |
|
1645 |
"find the first child, for which evaluation of the block returns |
|
2927 | 1646 |
true; if none does so, report an error" |
1647 |
||
1390 | 1648 |
^ self detect:aOneArgBlock ifNone:[self errorNotFound] |
1649 |
! |
|
1650 |
||
3071 | 1651 |
detect:aOneArgBlock ifNone:exceptionBlock |
1390 | 1652 |
"find the first child, for which evaluation of the block returns |
2927 | 1653 |
true; if none does so, return the evaluation of anExceptionBlock" |
1654 |
||
3071 | 1655 |
self do:[:el| |
1656 |
(aOneArgBlock value:el) ifTrue:[^ el] |
|
1657 |
]. |
|
1658 |
^ exceptionBlock value |
|
1659 |
||
1660 |
"Modified: / 13-09-2006 / 11:17:53 / cg" |
|
1804 | 1661 |
! |
1662 |
||
1663 |
detectLast:aOneArgBlock |
|
1664 |
"find the last child, for which evaluation of the block returns |
|
2927 | 1665 |
true; if none does so, an exception is raised" |
1666 |
||
1804 | 1667 |
^ self detectLast:aOneArgBlock ifNone:[self errorNotFound] |
1668 |
! |
|
1669 |
||
2081 | 1670 |
detectLast:anOneArgBlock ifNone:anExceptionBlock |
1804 | 1671 |
"find the last child, for which evaluation of the block returns |
2927 | 1672 |
true; if none does so, return the evaluation of anExceptionBlock" |
1673 |
||
2081 | 1674 |
self reverseDo:[:el| (anOneArgBlock value:el) ifTrue:[^ el] ]. |
2927 | 1675 |
^ anExceptionBlock value |
1390 | 1676 |
! |
1677 |
||
2081 | 1678 |
findFirst:anOneArgBlock |
1966 | 1679 |
"find the first child, for which evaluation of the argument, aOneArgBlock |
1680 |
returns true; return its index or 0 if none detected. |
|
1681 |
" |
|
2081 | 1682 |
self keysAndValuesDo:[:i :el| (anOneArgBlock value:el) ifTrue:[^ i] ]. |
1683 |
^ 0 |
|
1966 | 1684 |
! |
1685 |
||
2081 | 1686 |
findLast:anOneArgBlock |
1966 | 1687 |
"find the last child, for which evaluation of the argument, aOneArgBlock |
1688 |
returns true; return its index or 0 if none detected. |
|
1689 |
" |
|
2081 | 1690 |
self keysAndValuesReverseDo:[:i :el| (anOneArgBlock value:el) ifTrue:[^ i] ]. |
1691 |
^ 0 |
|
1966 | 1692 |
! |
1693 |
||
1390 | 1694 |
identityIndexOf:aChild |
1695 |
"return the index of aChild or 0 if not found. Compare using == |
|
1696 |
" |
|
1733 | 1697 |
^ self identityIndexOf:aChild startingAt:1 |
1390 | 1698 |
! |
1699 |
||
1700 |
identityIndexOf:aChild startingAt:startIndex |
|
1701 |
"return the index of aChild, starting search at startIndex. |
|
1702 |
Compare using ==; return 0 if not found |
|
1703 |
" |
|
1733 | 1704 |
|index| |
1705 |
||
2081 | 1706 |
index := startIndex. |
1733 | 1707 |
|
2081 | 1708 |
self from:startIndex do:[:el| |
1709 |
el == aChild ifTrue:[^ index ]. |
|
1710 |
index := index + 1. |
|
1390 | 1711 |
]. |
2081 | 1712 |
^ 0 |
1489 | 1713 |
! |
1714 |
||
1715 |
recursiveDetect:aOneArgBlock |
|
1716 |
"recursive find the first child, for which evaluation |
|
1717 |
of the block returns true; if none nil is returned |
|
1718 |
" |
|
1804 | 1719 |
self recursiveDo:[:aChild| |
1720 |
(aOneArgBlock value:aChild) ifTrue:[^ aChild] |
|
1721 |
]. |
|
1722 |
^ nil |
|
1723 |
! |
|
1489 | 1724 |
|
1804 | 1725 |
recursiveDetectLast:aBlock |
1726 |
"find the last child, for which evaluation of the block returns |
|
1727 |
true; if none does so, nil id returned |
|
1728 |
" |
|
1729 |
self recursiveReverseDo:[:aChild| |
|
1730 |
(aBlock value:aChild) ifTrue:[^ aChild]. |
|
1489 | 1731 |
]. |
1732 |
^ nil |
|
1876 | 1733 |
! |
1734 |
||
1735 |
withAllDetect:aOneArgBlock |
|
1736 |
"recursive find the first item including self, for which evaluation |
|
1737 |
of the block returns true; if none nil is returned |
|
1738 |
" |
|
1739 |
(aOneArgBlock value:self) ifTrue:[^ self]. |
|
1740 |
||
1883 | 1741 |
^ self recursiveDetect:aOneArgBlock |
1742 |
! ! |
|
1390 | 1743 |
|
2486 | 1744 |
!HierarchicalItem methodsFor:'sorting & reordering'! |
2252 | 1745 |
|
2294 | 1746 |
recursiveSort:aSortBlock |
1747 |
"recursive sort the children inplace using the 2-arg block sortBlock for comparison |
|
1748 |
" |
|
1749 |
self criticalDo:[ |
|
1750 |
children size ~~ 0 ifTrue:[ |
|
1751 |
self nonCriticalRecursiveSort:aSortBlock. |
|
1752 |
self childrenOrderChanged. |
|
1753 |
] |
|
1754 |
]. |
|
1755 |
! |
|
1756 |
||
2252 | 1757 |
sort:aSortBlock |
1758 |
"sort the children inplace using the 2-arg block sortBlock for comparison |
|
1759 |
" |
|
1760 |
|unsorted| |
|
1761 |
||
1762 |
self criticalDo:[ |
|
2294 | 1763 |
unsorted := children. |
2252 | 1764 |
|
1765 |
unsorted size ~~ 0 ifTrue:[ |
|
1766 |
children := unsorted sort:aSortBlock. |
|
1767 |
self childrenOrderChanged. |
|
1768 |
] |
|
1769 |
]. |
|
1770 |
! ! |
|
1771 |
||
1390 | 1772 |
!HierarchicalItem::Example class methodsFor:'instance creation'! |
1773 |
||
1774 |
labeled:aLabel |
|
1775 |
^ self new setLabel:aLabel |
|
1776 |
||
1777 |
||
1778 |
! |
|
1779 |
||
1780 |
labeled:aLabel icon:anIcon |
|
1781 |
^ self new setLabel:aLabel icon:anIcon |
|
1782 |
||
1783 |
||
1784 |
! ! |
|
1785 |
||
1786 |
!HierarchicalItem::Example class methodsFor:'resources'! |
|
1787 |
||
1788 |
iconForLevel:aLevel |
|
1789 |
"returns an icon |
|
1790 |
" |
|
1791 |
aLevel == 2 ifTrue:[ ^ ResourceSelectionBrowser iconPrivateClass ]. |
|
1792 |
aLevel == 3 ifTrue:[ ^ ResourceSelectionBrowser iconClass ]. |
|
1793 |
aLevel == 4 ifTrue:[ ^ ResourceSelectionBrowser iconCategory ]. |
|
1794 |
||
1795 |
^ nil |
|
1796 |
! |
|
1797 |
||
1798 |
penguinIcon |
|
1799 |
PenguinIcon isNil ifTrue:[ |
|
1794 | 1800 |
PenguinIcon := Smalltalk imageFromFileNamed:'xpmBitmaps/misc_logos/linux_penguin.xpm' |
1801 |
inPackage:'stx:goodies' |
|
1390 | 1802 |
]. |
1803 |
^ PenguinIcon |
|
1804 |
! ! |
|
1805 |
||
1806 |
!HierarchicalItem::Example methodsFor:'accessing'! |
|
1807 |
||
1808 |
children |
|
2781 | 1809 |
|lvl lbl txt image img icon| |
1390 | 1810 |
|
1811 |
children notNil ifTrue:[ |
|
1812 |
^ children |
|
1813 |
]. |
|
1814 |
||
1815 |
(lvl := self level) == 5 ifTrue:[ |
|
1816 |
children := #(). |
|
1817 |
^ children |
|
1818 |
]. |
|
1819 |
icon := self class iconForLevel:(lvl + 1). |
|
1820 |
children := OrderedCollection new. |
|
1821 |
||
1822 |
lvl < 4 ifTrue:[ |
|
1823 |
txt := (lvl + 1) printString, ' ['. |
|
2781 | 1824 |
img := Icon saveIcon. |
1390 | 1825 |
|
1826 |
1 to:5 do:[:i| |
|
1827 |
(i == 2 or:[i == 3]) ifTrue:[ |
|
1828 |
lbl := img |
|
1829 |
] ifFalse:[ |
|
1830 |
i == 4 ifTrue:[ |
|
1540
3fab5658652a
support carrige return in labels
Claus Gittinger <cg@exept.de>
parents:
1539
diff
changeset
|
1831 |
lbl := Array with:(self class penguinIcon) |
1733 | 1832 |
with:('penguin#and#text' replaceAll:$# with:(Character cr)). |
1390 | 1833 |
] ifFalse:[ |
1834 |
lbl := txt, (i printString), ']' |
|
1835 |
] |
|
1836 |
]. |
|
1837 |
children add:(self class labeled:lbl icon:icon) |
|
1838 |
]. |
|
1839 |
] ifFalse:[ |
|
1840 |
image := ResourceSelectionBrowser iconPrivateClass. |
|
1841 |
txt := LabelAndIcon icon:image string:'Text'. |
|
1842 |
img := Icon copyIcon. |
|
1843 |
||
1844 |
1 to:5 do:[:i| |
|
1845 |
lbl := i odd ifTrue:[txt] ifFalse:[img]. |
|
1398 | 1846 |
lbl := Array with:lbl with:'test' with:img. |
1390 | 1847 |
children add:(self class labeled:lbl icon:icon). |
3333 | 1848 |
]. |
1849 |
children add:(self class labeled:'Edit Text'). |
|
1390 | 1850 |
]. |
1851 |
||
1852 |
children do:[:aChild| aChild parent:self ]. |
|
1853 |
^ children |
|
1854 |
! |
|
1855 |
||
1856 |
icon |
|
1857 |
"returns the icon |
|
1858 |
" |
|
1859 |
^ icon |
|
1860 |
! |
|
1861 |
||
1862 |
icon:anIcon |
|
1863 |
"set the icon; if icon changed, a notification |
|
1864 |
is raised. |
|
1865 |
" |
|
1866 |
icon ~= anIcon ifTrue:[ |
|
1867 |
icon := anIcon. |
|
1868 |
self iconChanged |
|
1869 |
] |
|
1870 |
! |
|
1871 |
||
1872 |
label |
|
1873 |
"returns the label |
|
1874 |
" |
|
1875 |
^ label |
|
1876 |
||
1877 |
! |
|
1878 |
||
1879 |
label:aLabel |
|
1880 |
"set the label; if label changed, a notification |
|
1881 |
is raised. |
|
1882 |
" |
|
1883 |
label ~= aLabel ifTrue:[ |
|
1884 |
label := aLabel. |
|
1885 |
self changed. |
|
1886 |
] |
|
1887 |
||
1888 |
! |
|
1889 |
||
1890 |
setIcon:anIcon |
|
1891 |
"set the icon without any change notification |
|
1892 |
" |
|
1893 |
icon := anIcon |
|
1894 |
! |
|
1895 |
||
1896 |
setLabel:aLabel |
|
1897 |
"set the label without any change notification |
|
1898 |
" |
|
1899 |
label := aLabel |
|
1900 |
! |
|
1901 |
||
1902 |
setLabel:aLabel icon:anIcon |
|
1903 |
"set the label and icon without any change notification |
|
1904 |
" |
|
1905 |
label := aLabel. |
|
1906 |
icon := anIcon. |
|
1907 |
! ! |
|
1908 |
||
1909 |
!HierarchicalItem class methodsFor:'documentation'! |
|
1910 |
||
1911 |
version |
|
3333 | 1912 |
^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.82 2008-02-05 10:33:43 stefan Exp $' |
1390 | 1913 |
! ! |