author | Claus Gittinger <cg@exept.de> |
Wed, 29 Oct 1997 17:07:57 +0100 | |
changeset 359 | 6193ef5b6e74 |
parent 337 | 7c36c8b2b495 |
child 372 | 042713cfe1ed |
permissions | -rw-r--r-- |
300 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
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 |
" |
|
12 |
||
13 |
||
14 |
||
15 |
||
16 |
ApplicationModel subclass:#HierarchicalListEditor |
|
17 |
instanceVariableNames:'didInstall treeView specClass specSelector' |
|
18 |
classVariableNames:'CopyBuffer IconCreateChild IconCreateSister' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!HierarchicalListEditor class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
||
39 |
||
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
HierarchicalListEditor is used by the UIPainter to |
|
45 |
create or maintain a hierarchical list. |
|
46 |
||
47 |
[start with:] |
|
48 |
HierarchicalListEditor open |
|
49 |
||
50 |
[see also:] |
|
51 |
UIPainter |
|
52 |
||
53 |
[author:] |
|
54 |
Claus Atzkern |
|
55 |
" |
|
56 |
||
57 |
||
58 |
||
59 |
! ! |
|
60 |
||
61 |
!HierarchicalListEditor class methodsFor:'icons'! |
|
62 |
||
63 |
iconCreateChild |
|
64 |
||
65 |
IconCreateChild isNil ifTrue:[ |
|
337 | 66 |
IconCreateChild := Image fromFile:'bitmaps/ui_hierListChild.xpm'. |
300 | 67 |
]. |
68 |
^ IconCreateChild. |
|
69 |
||
70 |
" |
|
71 |
IconCreateChild := nil |
|
72 |
" |
|
73 |
! |
|
74 |
||
75 |
iconCreateSister |
|
76 |
||
77 |
IconCreateSister isNil ifTrue:[ |
|
337 | 78 |
IconCreateSister := Image fromFile:'bitmaps/ui_hierListSister.xpm'. |
300 | 79 |
]. |
80 |
^ IconCreateSister. |
|
81 |
||
82 |
" |
|
83 |
IconCreateSister := nil |
|
84 |
" |
|
85 |
! ! |
|
86 |
||
87 |
!HierarchicalListEditor class methodsFor:'interface specs'! |
|
88 |
||
89 |
classAndMethodSpec |
|
90 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
91 |
||
92 |
"do not manually edit this - the painter/builder may not be able to |
|
93 |
handle the specification if its corrupted." |
|
94 |
||
95 |
" |
|
96 |
UIPainter new openOnClass:HierarchicalListEditor andSelector:#classAndMethodSpec |
|
97 |
HierarchicalListEditor new openInterface:#classAndMethodSpec |
|
98 |
" |
|
99 |
||
100 |
<resource: #canvas> |
|
101 |
||
102 |
^ |
|
103 |
||
104 |
#(#FullSpec |
|
105 |
#'window:' |
|
106 |
#(#WindowSpec |
|
107 |
#'name:' 'Painter' |
|
108 |
#'layout:' #(#LayoutFrame 199 0 167 0 589 0 336 0) |
|
109 |
#'label:' 'Painter' |
|
110 |
#'min:' #(#Point 10 10) |
|
111 |
#'max:' #(#Point 1160 870) |
|
112 |
#'bounds:' #(#Rectangle 199 167 590 337) |
|
113 |
) |
|
114 |
#'component:' |
|
115 |
#(#SpecCollection |
|
116 |
#'collection:' |
|
117 |
#( |
|
118 |
#(#LabelSpec |
|
119 |
#'name:' 'boxLabel' |
|
120 |
#'layout:' #(#Point 5 10) |
|
121 |
#'label:' 'class & method for code:' |
|
122 |
#'adjust:' #left |
|
123 |
#'resizeForLabel:' true |
|
124 |
) |
|
125 |
#(#LabelSpec |
|
126 |
#'name:' 'classLabel' |
|
127 |
#'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5) |
|
128 |
#'label:' 'class:' |
|
129 |
#'adjust:' #right |
|
130 |
#'resizeForLabel:' true |
|
131 |
) |
|
132 |
#(#InputFieldSpec |
|
133 |
#'name:' 'classField' |
|
134 |
#'layout:' #(#LayoutFrame 47 0.11 39 0 -2 1.0 61 0) |
|
135 |
#'tabable:' true |
|
136 |
#'model:' #specClassChannel |
|
137 |
) |
|
138 |
#(#LabelSpec |
|
139 |
#'name:' 'methodLabel' |
|
140 |
#'layout:' #(#AlignmentOrigin 45 0.11 74 0 1 0.5) |
|
141 |
#'label:' 'method:' |
|
142 |
#'adjust:' #right |
|
143 |
#'resizeForLabel:' true |
|
144 |
) |
|
145 |
#(#InputFieldSpec |
|
146 |
#'name:' 'methodField' |
|
147 |
#'layout:' #(#LayoutFrame 47 0.11 64 0 -2 1.0 86 0) |
|
148 |
#'tabable:' true |
|
149 |
#'model:' #specSelectorChannel |
|
150 |
#'type:' #string |
|
151 |
) |
|
152 |
#(#HorizontalPanelViewSpec |
|
153 |
#'name:' 'commitPanel' |
|
154 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0) |
|
155 |
#'component:' |
|
156 |
#(#SpecCollection |
|
157 |
#'collection:' |
|
158 |
#( |
|
159 |
#(#ActionButtonSpec |
|
160 |
#'name:' 'cancel' |
|
161 |
#'label:' 'cancel' |
|
162 |
#'tabable:' true |
|
163 |
#'model:' #cancel |
|
164 |
#'extent:' #(#Point 191 24) |
|
165 |
) |
|
166 |
#(#ActionButtonSpec |
|
167 |
#'name:' 'accept' |
|
168 |
#'label:' 'ok' |
|
169 |
#'tabable:' true |
|
170 |
#'isDefault:' true |
|
171 |
#'model:' #accept |
|
172 |
#'extent:' #(#Point 191 24) |
|
173 |
) |
|
174 |
) |
|
175 |
) |
|
176 |
#'horizontalLayout:' #fitSpace |
|
177 |
#'verticalLayout:' #fit |
|
178 |
#'horizontalSpace:' 3 |
|
179 |
#'verticalSpace:' 3 |
|
180 |
) |
|
181 |
) |
|
182 |
) |
|
183 |
) |
|
184 |
! |
|
185 |
||
186 |
menuButtons |
|
187 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
188 |
||
189 |
"do not manually edit this - the builder may not be able to |
|
190 |
handle the specification if its corrupted." |
|
191 |
||
192 |
" |
|
193 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menuButtons |
|
194 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menuButtons)) startUp |
|
195 |
" |
|
196 |
||
197 |
<resource: #menu> |
|
198 |
||
199 |
^ |
|
200 |
||
201 |
#(#Menu |
|
202 |
||
203 |
#( |
|
204 |
#(#MenuItem |
|
205 |
#'label:' 'createChild' |
|
206 |
#'value:' #doCreateChild |
|
207 |
#'enabled:' #canCreateChildChannel |
|
208 |
#'labelImage:' #(#ResourceRetriever #HierarchicalListEditor #iconCreateChild) |
|
209 |
) |
|
210 |
#(#MenuItem |
|
211 |
#'label:' 'createSister' |
|
212 |
#'value:' #doCreateSister |
|
213 |
#'enabled:' #canCreateSisterChannel |
|
214 |
#'labelImage:' #(#ResourceRetriever #HierarchicalListEditor #iconCreateSister) |
|
215 |
) |
|
216 |
#(#MenuItem |
|
217 |
#'label:' '-' |
|
218 |
) |
|
219 |
#(#MenuItem |
|
220 |
#'label:' '' |
|
221 |
) |
|
222 |
#(#MenuItem |
|
223 |
#'label:' '-' |
|
224 |
) |
|
225 |
#(#MenuItem |
|
226 |
#'label:' 'stepUp' |
|
227 |
#'value:' #doStepUp |
|
228 |
#'enabled:' #canStepOverChannel |
|
229 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepUp) |
|
230 |
) |
|
231 |
#(#MenuItem |
|
232 |
#'label:' '-' |
|
233 |
) |
|
234 |
#(#MenuItem |
|
235 |
#'label:' 'stepDown' |
|
236 |
#'value:' #doStepDown |
|
237 |
#'enabled:' #canStepOverChannel |
|
238 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepDown) |
|
239 |
) |
|
240 |
#(#MenuItem |
|
241 |
#'label:' '-' |
|
242 |
) |
|
243 |
#(#MenuItem |
|
244 |
#'label:' 'stepIn' |
|
245 |
#'value:' #doStepIn |
|
246 |
#'enabled:' #canStepInChannel |
|
247 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepIn) |
|
248 |
) |
|
249 |
#(#MenuItem |
|
250 |
#'label:' '-' |
|
251 |
) |
|
252 |
#(#MenuItem |
|
253 |
#'label:' 'stepOut' |
|
254 |
#'value:' #doStepOut |
|
255 |
#'enabled:' #canStepOutChannel |
|
256 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepOut) |
|
257 |
) |
|
258 |
#(#MenuItem |
|
259 |
#'label:' '-' |
|
260 |
) |
|
261 |
) nil |
|
262 |
nil |
|
263 |
) |
|
264 |
! |
|
265 |
||
266 |
menuMain |
|
267 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
268 |
||
269 |
"do not manually edit this - the builder may not be able to |
|
270 |
handle the specification if its corrupted." |
|
271 |
||
272 |
" |
|
273 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menuMain |
|
274 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menuMain)) startUp |
|
275 |
" |
|
276 |
||
277 |
<resource: #menu> |
|
278 |
||
279 |
^ |
|
280 |
||
281 |
#(#Menu |
|
282 |
||
283 |
#( |
|
284 |
#(#MenuItem |
|
285 |
#'label:' 'file' |
|
286 |
#'submenu:' |
|
287 |
#(#Menu |
|
288 |
||
289 |
#( |
|
290 |
#(#MenuItem |
|
291 |
#'label:' 'new' |
|
292 |
#'value:' #doNew |
|
293 |
) |
|
294 |
#(#MenuItem |
|
295 |
#'label:' 'reload' |
|
296 |
#'value:' #doReload |
|
297 |
) |
|
298 |
#(#MenuItem |
|
299 |
#'label:' '=' |
|
300 |
) |
|
301 |
#(#MenuItem |
|
302 |
#'label:' 'quit' |
|
303 |
#'value:' #closeRequest |
|
304 |
) |
|
305 |
) nil |
|
306 |
nil |
|
307 |
) |
|
308 |
) |
|
309 |
#(#MenuItem |
|
310 |
#'label:' 'code' |
|
311 |
#'submenu:' |
|
312 |
#(#Menu |
|
313 |
||
314 |
#( |
|
315 |
#(#MenuItem |
|
316 |
#'label:' 'class && method' |
|
317 |
#'value:' #doDefineClass |
|
318 |
#'enabled:' #canChangeClassName |
|
319 |
) |
|
320 |
#(#MenuItem |
|
321 |
#'label:' 'method' |
|
322 |
#'value:' #doDefineSelector |
|
323 |
#'enabled:' #hasValidClass |
|
324 |
) |
|
325 |
#(#MenuItem |
|
326 |
#'label:' '-' |
|
327 |
) |
|
328 |
#(#MenuItem |
|
329 |
#'label:' 'install spec.' |
|
330 |
#'value:' #doInstall |
|
331 |
#'enabled:' #hasValidClass |
|
332 |
) |
|
333 |
#(#MenuItem |
|
334 |
#'label:' '-' |
|
335 |
) |
|
336 |
#(#MenuItem |
|
337 |
#'label:' 'browse' |
|
338 |
#'enabled:' #hasValidClass |
|
339 |
#'submenu:' |
|
340 |
#(#Menu |
|
341 |
||
342 |
#( |
|
343 |
#(#MenuItem |
|
344 |
#'label:' 'class' |
|
345 |
#'value:' #'doBrowse:' |
|
346 |
#'argument:' #class |
|
347 |
) |
|
348 |
#(#MenuItem |
|
349 |
#'label:' '-' |
|
350 |
) |
|
351 |
#(#MenuItem |
|
352 |
#'label:' 'specification' |
|
353 |
#'value:' #'doBrowse:' |
|
354 |
#'enabled:' #hasValidSpecSelector |
|
355 |
#'argument:' #spec |
|
356 |
) |
|
357 |
#(#MenuItem |
|
358 |
#'label:' 'method' |
|
359 |
#'value:' #'doBrowse:' |
|
360 |
#'enabled:' #hasValidMethodSelector |
|
361 |
#'argument:' #method |
|
362 |
) |
|
363 |
) nil |
|
364 |
nil |
|
365 |
) |
|
366 |
) |
|
367 |
) nil |
|
368 |
nil |
|
369 |
) |
|
370 |
) |
|
371 |
) nil |
|
372 |
nil |
|
373 |
) |
|
374 |
! |
|
375 |
||
376 |
menuTree |
|
377 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
378 |
||
379 |
"do not manually edit this - the builder may not be able to |
|
380 |
handle the specification if its corrupted." |
|
381 |
||
382 |
" |
|
383 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menuTree |
|
384 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menuTree)) startUp |
|
385 |
" |
|
386 |
||
387 |
<resource: #menu> |
|
388 |
||
389 |
^ |
|
390 |
||
391 |
#(#Menu |
|
392 |
||
393 |
#( |
|
394 |
#(#MenuItem |
|
395 |
#'label:' 'copy' |
|
396 |
#'value:' #doCopy |
|
397 |
#'enabled:' #canCopy |
|
398 |
) |
|
399 |
#(#MenuItem |
|
400 |
#'label:' 'cut' |
|
401 |
#'value:' #doCut |
|
402 |
#'enabled:' #canCut |
|
403 |
) |
|
404 |
#(#MenuItem |
|
405 |
#'label:' 'paste' |
|
406 |
#'value:' #doPaste |
|
407 |
#'enabled:' #canPaste |
|
408 |
) |
|
409 |
) nil |
|
410 |
nil |
|
411 |
) |
|
412 |
! |
|
413 |
||
414 |
methodSpec |
|
415 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
416 |
||
417 |
"do not manually edit this - the painter/builder may not be able to |
|
418 |
handle the specification if its corrupted." |
|
419 |
||
420 |
" |
|
421 |
UIPainter new openOnClass:HierarchicalListEditor andSelector:#methodSpec |
|
422 |
HierarchicalListEditor new openInterface:#methodSpec |
|
423 |
" |
|
424 |
||
425 |
<resource: #canvas> |
|
426 |
||
427 |
^ |
|
428 |
||
429 |
#(#FullSpec |
|
430 |
#'window:' |
|
431 |
#(#WindowSpec |
|
432 |
#'name:' 'Painter' |
|
433 |
#'layout:' #(#LayoutFrame 275 0 381 0 665 0 550 0) |
|
434 |
#'label:' 'Painter' |
|
435 |
#'min:' #(#Point 10 10) |
|
436 |
#'max:' #(#Point 1160 870) |
|
437 |
#'bounds:' #(#Rectangle 275 381 666 551) |
|
438 |
) |
|
439 |
#'component:' |
|
440 |
#(#SpecCollection |
|
441 |
#'collection:' |
|
442 |
#( |
|
443 |
#(#LabelSpec |
|
444 |
#'name:' 'boxLabel' |
|
445 |
#'layout:' #(#Point 5 10) |
|
446 |
#'label:' 'class & method for code:' |
|
447 |
#'adjust:' #left |
|
448 |
#'resizeForLabel:' true |
|
449 |
) |
|
450 |
#(#LabelSpec |
|
451 |
#'name:' 'methodLabel' |
|
452 |
#'layout:' #(#AlignmentOrigin 45 0.11 74 0 1 0.5) |
|
453 |
#'label:' 'method:' |
|
454 |
#'adjust:' #right |
|
455 |
#'resizeForLabel:' true |
|
456 |
) |
|
457 |
#(#InputFieldSpec |
|
458 |
#'name:' 'methodField' |
|
459 |
#'layout:' #(#LayoutFrame 47 0.11 64 0 -2 1.0 86 0) |
|
460 |
#'tabable:' true |
|
461 |
#'model:' #specSelectorChannel |
|
462 |
#'type:' #string |
|
463 |
) |
|
464 |
#(#HorizontalPanelViewSpec |
|
465 |
#'name:' 'commitPanel' |
|
466 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0) |
|
467 |
#'component:' |
|
468 |
#(#SpecCollection |
|
469 |
#'collection:' |
|
470 |
#( |
|
471 |
#(#ActionButtonSpec |
|
472 |
#'name:' 'cancel' |
|
473 |
#'label:' 'cancel' |
|
474 |
#'tabable:' true |
|
475 |
#'model:' #cancel |
|
476 |
#'extent:' #(#Point 191 24) |
|
477 |
) |
|
478 |
#(#ActionButtonSpec |
|
479 |
#'name:' 'accept' |
|
480 |
#'label:' 'ok' |
|
481 |
#'tabable:' true |
|
482 |
#'isDefault:' true |
|
483 |
#'model:' #accept |
|
484 |
#'extent:' #(#Point 191 24) |
|
485 |
) |
|
486 |
) |
|
487 |
) |
|
488 |
#'horizontalLayout:' #fitSpace |
|
489 |
#'verticalLayout:' #fit |
|
490 |
#'horizontalSpace:' 3 |
|
491 |
#'verticalSpace:' 3 |
|
492 |
) |
|
493 |
) |
|
494 |
) |
|
495 |
) |
|
496 |
! |
|
497 |
||
498 |
windowSpec |
|
499 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
500 |
||
501 |
"do not manually edit this - the painter/builder may not be able to |
|
502 |
handle the specification if its corrupted." |
|
503 |
||
504 |
" |
|
505 |
UIPainter new openOnClass:HierarchicalListEditor andSelector:#windowSpec |
|
506 |
HierarchicalListEditor new openInterface:#windowSpec |
|
507 |
" |
|
508 |
"HierarchicalListEditor open" |
|
509 |
||
510 |
<resource: #canvas> |
|
511 |
||
512 |
^ |
|
513 |
||
514 |
#(#FullSpec |
|
515 |
#'window:' |
|
516 |
#(#WindowSpec |
|
517 |
#'name:' 'HierarchicalListEditor' |
|
518 |
#'layout:' #(#LayoutFrame 437 0 260 0 1004 0 554 0) |
|
519 |
#'label:' 'Hierarchical List Editor' |
|
520 |
#'min:' #(#Point 10 10) |
|
521 |
#'max:' #(#Point 1160 870) |
|
522 |
#'bounds:' #(#Rectangle 437 260 1005 555) |
|
523 |
) |
|
524 |
#'component:' |
|
525 |
#(#SpecCollection |
|
526 |
#'collection:' |
|
527 |
#( |
|
528 |
#(#MenuPanelSpec |
|
529 |
#'name:' 'menuMain' |
|
530 |
#'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
531 |
#'menu:' #menuMain |
|
532 |
) |
|
533 |
#(#VariableHorizontalPanelSpec |
|
534 |
#'name:' 'variableHorizontalPanel1' |
|
535 |
#'layout:' #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
536 |
#'component:' |
|
537 |
#(#SpecCollection |
|
538 |
#'collection:' |
|
539 |
#( |
|
540 |
#(#ViewSpec |
|
541 |
#'name:' 'view1' |
|
542 |
#'component:' |
|
543 |
#(#SpecCollection |
|
544 |
#'collection:' |
|
545 |
#( |
|
546 |
#(#MenuPanelSpec |
|
547 |
#'name:' 'menuButtons' |
|
548 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 28 0) |
|
549 |
#'menu:' #menuButtons |
|
550 |
) |
|
551 |
#(#ArbitraryComponentSpec |
|
552 |
#'name:' 'treeView' |
|
553 |
#'layout:' #(#LayoutFrame 0 0.0 28 0.0 0 1.0 0 1.0) |
|
554 |
#'menu:' #menuTree |
|
555 |
#'hasHorizontalScrollBar:' true |
|
556 |
#'hasVerticalScrollBar:' true |
|
557 |
#'miniScrollerHorizontal:' true |
|
558 |
#'miniScrollerVertical:' true |
|
559 |
#'component:' #treeView |
|
560 |
#'hasBorder:' false |
|
561 |
) |
|
562 |
) |
|
563 |
) |
|
564 |
) |
|
565 |
#(#ViewSpec |
|
566 |
#'name:' 'view2' |
|
567 |
#'component:' |
|
568 |
#(#SpecCollection |
|
569 |
#'collection:' |
|
570 |
#( |
|
571 |
#(#ViewSpec |
|
572 |
#'name:' 'viewSpec' |
|
573 |
#'layout:' #(#LayoutFrame 0 0 0 0 0 0 0 0) |
|
574 |
#'component:' |
|
575 |
#(#SpecCollection |
|
576 |
#'collection:' |
|
577 |
#( |
|
578 |
#(#LabelSpec |
|
579 |
#'name:' 'nameLabel' |
|
580 |
#'layout:' #(#AlignmentOrigin 75 0 36 0 1 0.5) |
|
581 |
#'label:' 'Name:' |
|
582 |
#'resizeForLabel:' true |
|
583 |
) |
|
584 |
#(#InputFieldSpec |
|
585 |
#'name:' 'nameFiled' |
|
586 |
#'layout:' #(#LayoutFrame 81 0 26 0 -5 1.0 48 0) |
|
587 |
#'model:' #itemName |
|
588 |
) |
|
589 |
#(#LabelSpec |
|
590 |
#'name:' 'valueLabel' |
|
591 |
#'layout:' #(#AlignmentOrigin 75 0 71 0 1 0.5) |
|
592 |
#'label:' 'Value:' |
|
593 |
#'resizeForLabel:' true |
|
594 |
) |
|
595 |
#(#InputFieldSpec |
|
596 |
#'name:' 'valueField' |
|
597 |
#'layout:' #(#LayoutFrame 81 0 61 0 -5 1.0 83 0) |
|
598 |
#'model:' #itemValue |
|
599 |
#'type:' #symbolOrNil |
|
600 |
) |
|
601 |
#(#HorizontalPanelViewSpec |
|
602 |
#'name:' 'commitPanel' |
|
603 |
#'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0) |
|
604 |
#'component:' |
|
605 |
#(#SpecCollection |
|
606 |
#'collection:' |
|
607 |
#( |
|
608 |
#(#ActionButtonSpec |
|
609 |
#'name:' 'cancelButton' |
|
610 |
#'label:' 'cancel' |
|
611 |
#'model:' #cancel |
|
612 |
#'enableChannel:' #modifiedChannel |
|
613 |
#'extent:' #(#Point 1 22) |
|
614 |
) |
|
615 |
#(#ActionButtonSpec |
|
616 |
#'name:' 'acceptButton' |
|
617 |
#'label:' 'ok' |
|
618 |
#'model:' #accept |
|
619 |
#'enableChannel:' #modifiedChannel |
|
620 |
#'extent:' #(#Point 1 22) |
|
621 |
) |
|
622 |
) |
|
623 |
) |
|
624 |
#'horizontalLayout:' #fitSpace |
|
625 |
#'verticalLayout:' #center |
|
626 |
#'horizontalSpace:' 3 |
|
627 |
#'verticalSpace:' 3 |
|
628 |
) |
|
629 |
) |
|
630 |
) |
|
631 |
) |
|
632 |
) |
|
633 |
) |
|
634 |
#'borderWidth:' 1 |
|
635 |
) |
|
636 |
) |
|
637 |
) |
|
638 |
#'handles:' #(#Any 0.5 1.0) |
|
639 |
) |
|
640 |
) |
|
641 |
) |
|
642 |
) |
|
643 |
! ! |
|
644 |
||
645 |
!HierarchicalListEditor class methodsFor:'printing'! |
|
646 |
||
647 |
prettyPrintArray:anArray on:aStream indent:anIndent |
|
648 |
"print a literal array in a nice format |
|
649 |
" |
|
650 |
|arg sol| |
|
651 |
||
652 |
sol := aStream position. |
|
653 |
aStream spaces:anIndent. |
|
654 |
aStream nextPutAll:'#('. |
|
655 |
||
656 |
anArray first isSymbol ifTrue:[ |
|
657 |
arg := anArray first. |
|
658 |
aStream nextPut:$#. |
|
659 |
aStream nextPutAll:anArray first. |
|
660 |
aStream cr. |
|
661 |
anArray size == 2 ifTrue:[ |
|
662 |
self prettyPrintArray:(anArray last) |
|
663 |
on:aStream |
|
664 |
indent:(anIndent + 4). |
|
665 |
]. |
|
666 |
aStream spaces:anIndent. |
|
667 |
aStream nextPut:$). |
|
668 |
^ self |
|
669 |
]. |
|
670 |
||
671 |
aStream nextPut:$'. |
|
672 |
aStream nextPutAll:(anArray at:1). |
|
673 |
aStream nextPut:$'. |
|
674 |
arg := anArray at:2 ifAbsent:nil. |
|
675 |
||
676 |
arg isString ifTrue:[ |
|
677 |
aStream spaces:((50 - (aStream position - sol)) max:4). |
|
678 |
||
679 |
arg isSymbol ifTrue:[ |
|
680 |
aStream nextPut:$#. |
|
681 |
]. |
|
682 |
aStream nextPut:$'. |
|
683 |
aStream nextPutAll:arg. |
|
684 |
aStream nextPut:$'. |
|
685 |
arg := anArray at:3 ifAbsent:nil. |
|
686 |
]. |
|
687 |
arg isArray ifTrue:[ |
|
688 |
aStream nextPutAll:' #('. |
|
689 |
aStream cr. |
|
690 |
arg do:[:e|self prettyPrintArray:e on:aStream indent:(anIndent + 4)]. |
|
691 |
aStream spaces:anIndent. |
|
692 |
aStream nextPut:$). |
|
693 |
]. |
|
694 |
aStream nextPut:$). |
|
695 |
aStream cr. |
|
696 |
! ! |
|
697 |
||
698 |
!HierarchicalListEditor methodsFor:'accessing'! |
|
699 |
||
700 |
didInstall |
|
701 |
"returns true if spec was installed by operator |
|
702 |
" |
|
703 |
^ didInstall ? false |
|
704 |
! |
|
705 |
||
706 |
selectorName |
|
707 |
"returns current spec. selector |
|
708 |
" |
|
709 |
^ specSelector |
|
710 |
! ! |
|
711 |
||
712 |
!HierarchicalListEditor methodsFor:'actions'! |
|
713 |
||
714 |
accept |
|
715 |
"accept changes" |
|
716 |
||
717 |
|node index| |
|
718 |
||
719 |
(index := treeView selectedIndex) ~~ 0 ifTrue:[ |
|
720 |
node := treeView nodeAtIndex:index. |
|
721 |
node name:(self itemName value). |
|
722 |
node contents:(self itemValue value). |
|
723 |
treeView redrawLine:index. |
|
724 |
]. |
|
725 |
self modifiedChannel value:false. |
|
726 |
||
727 |
! |
|
728 |
||
729 |
cancel |
|
730 |
"reload selected item and update channels |
|
731 |
" |
|
732 |
|node| |
|
733 |
||
734 |
(node := treeView selectedNode) notNil ifTrue:[ |
|
735 |
self itemName value:node name. |
|
736 |
self itemValue value:node contents. |
|
737 |
(builder componentAt:#viewSpec) extent:1.0@1.0. |
|
738 |
] ifFalse:[ |
|
739 |
(builder componentAt:#viewSpec) extent:0@0. |
|
740 |
self itemName value:''. |
|
741 |
self itemValue value:nil. |
|
742 |
]. |
|
743 |
self modifiedChannel value:false. |
|
744 |
! ! |
|
745 |
||
746 |
!HierarchicalListEditor methodsFor:'aspects'! |
|
747 |
||
748 |
canCreateChildChannel |
|
749 |
"automatically generated by UIPainter ..." |
|
750 |
||
751 |
^ builder booleanValueAspectFor:#canCreateChildChannel |
|
752 |
||
753 |
! |
|
754 |
||
755 |
canCreateSisterChannel |
|
756 |
"automatically generated by UIPainter ..." |
|
757 |
||
758 |
^ builder booleanValueAspectFor:#canCreateSisterChannel |
|
759 |
||
760 |
! |
|
761 |
||
762 |
canStepInChannel |
|
763 |
"automatically generated by UIPainter ..." |
|
764 |
||
765 |
^ builder booleanValueAspectFor:#canStepInChannel |
|
766 |
||
767 |
! |
|
768 |
||
769 |
canStepOutChannel |
|
770 |
"automatically generated by UIPainter ..." |
|
771 |
||
772 |
^ builder booleanValueAspectFor:#canStepOutChannel |
|
773 |
||
774 |
! |
|
775 |
||
776 |
canStepOverChannel |
|
777 |
"automatically generated by UIPainter ..." |
|
778 |
||
779 |
^ builder booleanValueAspectFor:#canStepOverChannel |
|
780 |
||
781 |
! |
|
782 |
||
783 |
itemName |
|
784 |
"automatically generated by UIPainter ..." |
|
785 |
||
786 |
|holder| |
|
787 |
||
788 |
(holder := builder bindingAt:#itemName) isNil ifTrue:[ |
|
789 |
builder aspectAt:#itemName put:(holder := ValueHolder new). |
|
790 |
holder addDependent:self. |
|
791 |
]. |
|
792 |
^ holder |
|
793 |
! |
|
794 |
||
795 |
itemValue |
|
796 |
"automatically generated by UIPainter ..." |
|
797 |
||
798 |
|holder| |
|
799 |
||
800 |
(holder := builder bindingAt:#itemValue) isNil ifTrue:[ |
|
801 |
builder aspectAt:#itemValue put:(holder := ValueHolder new). |
|
802 |
holder addDependent:self. |
|
803 |
]. |
|
804 |
^ holder |
|
805 |
! |
|
806 |
||
807 |
modifiedChannel |
|
808 |
"automatically generated by UIPainter ..." |
|
809 |
||
810 |
^ builder booleanValueAspectFor:#modifiedChannel |
|
811 |
||
812 |
! |
|
813 |
||
814 |
treeView |
|
815 |
"automatically generated by UIPainter ..." |
|
816 |
||
817 |
^ treeView |
|
818 |
! ! |
|
819 |
||
820 |
!HierarchicalListEditor methodsFor:'change & update'! |
|
821 |
||
822 |
update:something with:aParameter from:someObject |
|
823 |
"one of my models changed |
|
824 |
" |
|
825 |
self modifiedChannel value:true |
|
826 |
! ! |
|
827 |
||
828 |
!HierarchicalListEditor methodsFor:'menu buttons'! |
|
829 |
||
830 |
doCreateChild |
|
831 |
"create a child within selected parent |
|
832 |
" |
|
833 |
|node| |
|
834 |
||
835 |
(node := treeView selectedNode) notNil ifTrue:[ |
|
836 |
treeView model add:(self newItem) beforeIndex:1 below:node. |
|
837 |
treeView selectedNodeExpand:true. |
|
838 |
self updateChannels. |
|
839 |
]. |
|
840 |
! |
|
841 |
||
842 |
doCreateSister |
|
843 |
"create a sister next to selected item |
|
844 |
" |
|
845 |
|node| |
|
846 |
||
847 |
(node := treeView selectedNode) notNil ifTrue:[ |
|
848 |
node parent notNil ifTrue:[ |
|
849 |
treeView model add:(self newItem) after:node |
|
850 |
] ifFalse:[ |
|
851 |
treeView model add:(self newItem) beforeIndex:1 below:node |
|
852 |
]. |
|
853 |
self updateChannels |
|
854 |
]. |
|
855 |
! |
|
856 |
||
857 |
doStepDown |
|
858 |
"move selected item after next item |
|
859 |
" |
|
860 |
treeView selectedNodeChangeSequenceOrder:1. |
|
861 |
self updateChannels. |
|
862 |
! |
|
863 |
||
864 |
doStepIn |
|
865 |
"lets become the selected item a child of its next sister |
|
866 |
" |
|
867 |
treeView selectedNodeBecomeChildOfNext. |
|
868 |
self updateChannels. |
|
869 |
! |
|
870 |
||
871 |
doStepOut |
|
872 |
"let selected node become a sister of its current parent |
|
873 |
" |
|
874 |
treeView selectedNodeBecomeSisterOfParent. |
|
875 |
self updateChannels. |
|
876 |
! |
|
877 |
||
878 |
doStepUp |
|
879 |
"move selected item before previous item |
|
880 |
" |
|
881 |
treeView selectedNodeChangeSequenceOrder:-1. |
|
882 |
self updateChannels. |
|
883 |
! |
|
884 |
||
885 |
menuButtons |
|
886 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
887 |
||
888 |
^ self class menuButtons |
|
889 |
||
890 |
||
891 |
! ! |
|
892 |
||
893 |
!HierarchicalListEditor methodsFor:'menu main'! |
|
894 |
||
895 |
doBrowse:what |
|
896 |
"open a system browser |
|
897 |
" |
|
898 |
|cls sel| |
|
899 |
||
900 |
(cls := specClass) notNil ifTrue:[ |
|
901 |
what == #class ifFalse:[ |
|
902 |
(sel := specSelector) isNil ifTrue:[ |
|
903 |
^ self |
|
904 |
]. |
|
905 |
what == #spec ifTrue:[cls := cls class] |
|
906 |
]. |
|
907 |
||
908 |
SystemBrowser openInClass:cls selector:sel |
|
909 |
] |
|
910 |
! |
|
911 |
||
912 |
doDefineClass |
|
913 |
"define class and selector |
|
914 |
" |
|
915 |
|sel cls bindings accepted| |
|
916 |
||
917 |
masterApplication notNil ifTrue:[ |
|
918 |
^ self information:'only selector could be changed.' |
|
919 |
]. |
|
920 |
accepted := true. |
|
921 |
bindings := IdentityDictionary new. |
|
922 |
||
923 |
specClass notNil ifTrue:[cls := specClass name asString] |
|
924 |
ifFalse:[cls := '']. |
|
925 |
||
926 |
specSelector notNil ifTrue:[sel := specSelector asString] |
|
927 |
ifFalse:[sel := '']. |
|
928 |
||
929 |
bindings at:#specSelectorChannel put:(sel asValue). |
|
930 |
bindings at:#specClassChannel put:(cls asValue). |
|
931 |
||
932 |
[accepted] whileTrue:[ |
|
933 |
accepted := self openDialogInterface:#classAndMethodSpec withBindings:bindings. |
|
934 |
||
935 |
accepted ifTrue:[ |
|
337 | 936 |
cls := self resolveName:(bindings at:#specClassChannel) value. |
300 | 937 |
|
938 |
cls notNil ifTrue:[ |
|
939 |
sel := (bindings at:#specSelectorChannel) value withoutSeparators. |
|
940 |
||
941 |
sel size ~~ 0 ifTrue:[ |
|
942 |
specClass := cls. |
|
943 |
specSelector := sel asSymbol. |
|
944 |
^ self |
|
945 |
] |
|
946 |
] |
|
947 |
] |
|
948 |
] |
|
949 |
||
950 |
! |
|
951 |
||
952 |
doDefineSelector |
|
953 |
"define selector only |
|
954 |
" |
|
327
0040d47658c6
check - warnings eliminated. Fix in InspectorList.st
Claus Gittinger <cg@exept.de>
parents:
306
diff
changeset
|
955 |
|sel bindings accepted| |
300 | 956 |
|
957 |
accepted := true. |
|
958 |
bindings := IdentityDictionary new. |
|
959 |
||
960 |
specSelector notNil ifTrue:[sel := specSelector asString] |
|
961 |
ifFalse:[sel := '']. |
|
962 |
||
963 |
bindings at:#specSelectorChannel put:(sel asValue). |
|
964 |
||
965 |
[accepted] whileTrue:[ |
|
966 |
accepted := self openDialogInterface:#methodSpec withBindings:bindings. |
|
967 |
||
968 |
accepted ifTrue:[ |
|
969 |
sel := (bindings at:#specSelectorChannel) value withoutSeparators. |
|
970 |
||
971 |
sel size ~~ 0 ifTrue:[ |
|
972 |
specSelector := sel asSymbol. |
|
973 |
^ self |
|
974 |
] |
|
975 |
] |
|
976 |
] |
|
977 |
||
978 |
! |
|
979 |
||
980 |
doInstall |
|
981 |
"install code |
|
982 |
" |
|
983 |
|code spec category mthd stream| |
|
984 |
||
985 |
(specClass notNil and:[specSelector notNil]) ifFalse:[ |
|
986 |
^ self information:'no valid class & method defined'. |
|
987 |
]. |
|
988 |
||
989 |
spec := (treeView nodeAtIndex:1) literalArrayEncoding. |
|
990 |
stream := WriteStream on:String new. |
|
991 |
self class prettyPrintArray:spec on:stream indent:4. |
|
992 |
spec := stream contents. |
|
993 |
category := 'interface specs'. |
|
994 |
didInstall := true. |
|
995 |
||
996 |
(mthd := specClass class compiledMethodAt:specSelector) notNil ifTrue:[ |
|
997 |
category := mthd category. |
|
998 |
]. |
|
999 |
||
1000 |
code := Character excla asString |
|
1001 |
, specClass name , ' class methodsFor:' , category storeString |
|
1002 |
, Character excla asString , '\\' |
|
1003 |
||
1004 |
, specSelector , '\' |
|
1005 |
, ' "this window spec was automatically generated by the ST/X HierarchicalListEditor"\\' |
|
1006 |
, ' "do not manually edit this - the builder may not be able to\' |
|
1007 |
, ' handle the specification if its corrupted."\\' |
|
1008 |
, ' "\' |
|
1009 |
, ' HierarchicalListEditor new openOnClass:' , specClass name , ' andSelector:#' , specSelector , '\' |
|
1010 |
, ' "\'. |
|
1011 |
||
1012 |
code := code |
|
1013 |
, '\' |
|
1014 |
, ' <resource: #hierarchicalList>\\' |
|
1015 |
, ' ^\' |
|
1016 |
, spec |
|
1017 |
, ' decodeAsLiteralArray\' |
|
1018 |
, Character excla asString |
|
1019 |
, ' ' |
|
1020 |
, Character excla asString |
|
1021 |
, '\\'. |
|
1022 |
||
1023 |
code := code withCRs. |
|
1024 |
(ReadStream on:code) fileIn. |
|
1025 |
||
1026 |
(specClass compiledMethodAt:specSelector) isNil ifTrue:[ |
|
1027 |
category := 'aspects'. |
|
1028 |
||
1029 |
code := Character excla asString |
|
1030 |
, specClass name , ' methodsFor:' , category storeString |
|
1031 |
, Character excla asString , '\\' |
|
1032 |
||
1033 |
, specSelector , '\' |
|
1034 |
, ' "this window spec was automatically generated by the ST/X HierarchicalListEditor"\\' |
|
306 | 1035 |
, ' ^ self class ', specSelector |
300 | 1036 |
, '\' |
1037 |
, Character excla asString |
|
1038 |
, ' ' |
|
1039 |
, Character excla asString |
|
1040 |
, '\\'. |
|
1041 |
||
1042 |
code := code withCRs. |
|
1043 |
(ReadStream on:code) fileIn. |
|
1044 |
]. |
|
1045 |
||
1046 |
||
1047 |
! |
|
1048 |
||
1049 |
doNew |
|
1050 |
"remove all items; restart |
|
1051 |
" |
|
306 | 1052 |
treeView root:(TreeItem name:'Anchor' contents:#anchor). |
300 | 1053 |
treeView selection:0. |
1054 |
||
1055 |
! |
|
1056 |
||
1057 |
doReload |
|
1058 |
"reload spec from current class and selector |
|
1059 |
" |
|
1060 |
self buildFrom:specClass andSelector:specSelector |
|
1061 |
||
1062 |
! |
|
1063 |
||
1064 |
menuMain |
|
1065 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1066 |
||
1067 |
^ self class menuMain |
|
1068 |
||
1069 |
||
1070 |
! ! |
|
1071 |
||
1072 |
!HierarchicalListEditor methodsFor:'menu tree'! |
|
1073 |
||
1074 |
doCopy |
|
1075 |
"copy current selected nodes into copy buffer |
|
1076 |
" |
|
1077 |
CopyBuffer := OrderedCollection new. |
|
1078 |
treeView selectedNodesDo:[:aNode| CopyBuffer add:(aNode copy)]. |
|
1079 |
||
1080 |
! |
|
1081 |
||
1082 |
doCut |
|
1083 |
"cut current selected nodes |
|
1084 |
" |
|
1085 |
treeView hasSelection ifTrue:[ |
|
1086 |
self doCopy. |
|
1087 |
treeView selectedNodesRemove. |
|
1088 |
self updateChannels. |
|
1089 |
] |
|
1090 |
! |
|
1091 |
||
1092 |
doPaste |
|
1093 |
"paste after current selected item |
|
1094 |
" |
|
1095 |
treeView selectedNodeAdd:CopyBuffer. |
|
1096 |
self updateChannels. |
|
1097 |
! |
|
1098 |
||
1099 |
menuTree |
|
1100 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1101 |
||
1102 |
^ self class menuTree |
|
1103 |
||
1104 |
||
1105 |
! ! |
|
1106 |
||
1107 |
!HierarchicalListEditor methodsFor:'private'! |
|
1108 |
||
1109 |
newItem |
|
1110 |
"creates and returns a new default item |
|
1111 |
" |
|
1112 |
^ TreeItem name:'undefined' contents:nil |
|
1113 |
! |
|
1114 |
||
1115 |
updateChannels |
|
1116 |
"update channels |
|
1117 |
" |
|
1118 |
|node parent chnStepIn chnStepOut chnStepOvr chnChild chnSister| |
|
1119 |
||
1120 |
chnStepIn := chnStepOut := chnStepOvr := chnChild := chnSister := false. |
|
1121 |
||
1122 |
(node := treeView selectedNode) notNil ifTrue:[ |
|
1123 |
chnChild := true. |
|
1124 |
||
1125 |
(parent := node parent) notNil ifTrue:[ |
|
1126 |
chnSister := true. |
|
1127 |
chnStepOvr := parent numberOfChildren > 1. |
|
1128 |
chnStepOut := parent parent notNil. |
|
1129 |
chnStepIn := node ~~ parent lastChild. |
|
1130 |
] |
|
1131 |
]. |
|
1132 |
self canCreateChildChannel value:chnChild. |
|
1133 |
self canCreateSisterChannel value:chnSister. |
|
1134 |
self canStepOverChannel value:chnStepOvr. |
|
1135 |
self canStepOutChannel value:chnStepOut. |
|
1136 |
self canStepInChannel value:chnStepIn. |
|
1137 |
! ! |
|
1138 |
||
1139 |
!HierarchicalListEditor methodsFor:'queries'! |
|
1140 |
||
1141 |
canChangeClassName |
|
1142 |
"returns true if current class could be changed which is dependent on |
|
1143 |
the mode: standalone or started by UIPainter |
|
1144 |
" |
|
1145 |
^ masterApplication isNil |
|
1146 |
! |
|
1147 |
||
1148 |
canCopy |
|
1149 |
"returns true if any selection exists |
|
1150 |
" |
|
1151 |
^ treeView selection notNil |
|
1152 |
! |
|
1153 |
||
1154 |
canCut |
|
1155 |
"returns true if any selection exists and not includes |
|
1156 |
the anchor (first element into list). |
|
1157 |
" |
|
1158 |
treeView selection notNil ifTrue:[ |
|
1159 |
^ (treeView isInSelection:1) not |
|
1160 |
]. |
|
1161 |
^ false |
|
1162 |
! |
|
1163 |
||
1164 |
canPaste |
|
1165 |
"returns true if something to be paste exists and a |
|
1166 |
single selection exists |
|
1167 |
" |
|
1168 |
^ (CopyBuffer notNil and:[treeView selectedNode notNil]) |
|
1169 |
! |
|
1170 |
||
1171 |
hasValidClass |
|
1172 |
"returns true if the class defined allready exists |
|
1173 |
" |
|
1174 |
^ specClass isBehavior |
|
1175 |
! |
|
1176 |
||
1177 |
hasValidMethodSelector |
|
1178 |
"returns true if the class and the instance selector defined |
|
1179 |
allready exists. |
|
1180 |
" |
|
1181 |
(specSelector notNil and:[self hasValidClass]) ifTrue:[ |
|
1182 |
^ (specClass compiledMethodAt:specSelector) notNil |
|
1183 |
]. |
|
1184 |
^ false |
|
1185 |
! |
|
1186 |
||
1187 |
hasValidSpecSelector |
|
1188 |
"returns true if the class and the class selector defined |
|
1189 |
allready exists. |
|
1190 |
" |
|
1191 |
(specSelector notNil and:[self hasValidClass]) ifTrue:[ |
|
1192 |
^ (specClass class compiledMethodAt:specSelector) notNil |
|
1193 |
]. |
|
1194 |
! ! |
|
1195 |
||
1196 |
!HierarchicalListEditor methodsFor:'startup/release'! |
|
1197 |
||
1198 |
buildFrom:aClass andSelector:aSelector |
|
1199 |
"rebuild window from a class and selector |
|
1200 |
" |
|
327
0040d47658c6
check - warnings eliminated. Fix in InspectorList.st
Claus Gittinger <cg@exept.de>
parents:
306
diff
changeset
|
1201 |
|sel anchor| |
300 | 1202 |
|
337 | 1203 |
specClass := self resolveName:aClass. |
300 | 1204 |
specSelector := nil. |
1205 |
||
1206 |
aSelector size ~~ 0 ifTrue:[ |
|
1207 |
sel := aSelector asString withoutSeparators. |
|
1208 |
sel size ~~ 0 ifTrue:[ |
|
1209 |
specSelector := sel asSymbol |
|
1210 |
] |
|
1211 |
]. |
|
1212 |
treeView selection:nil. |
|
1213 |
||
1214 |
(specSelector notNil and:[specClass notNil]) ifTrue:[ |
|
1215 |
(specClass respondsTo:specSelector) ifTrue:[ |
|
1216 |
anchor := specClass perform:specSelector. |
|
1217 |
||
1218 |
anchor isArray ifTrue:[ |
|
1219 |
anchor := anchor decodeAsLiteralArray. |
|
1220 |
] |
|
1221 |
] |
|
1222 |
]. |
|
1223 |
anchor notNil ifTrue:[ |
|
1224 |
anchor expand. |
|
306 | 1225 |
treeView root:anchor. |
300 | 1226 |
] ifFalse:[ |
1227 |
self doNew |
|
1228 |
]. |
|
1229 |
! |
|
1230 |
||
1231 |
initialize |
|
1232 |
"setup default values |
|
1233 |
" |
|
1234 |
super initialize. |
|
1235 |
||
1236 |
treeView := SelectionInTreeView new. |
|
1237 |
treeView multipleSelectOk:true. |
|
1238 |
treeView action:[:aNr| self updateChannels. self cancel ]. |
|
1239 |
self doNew. |
|
1240 |
! |
|
1241 |
||
1242 |
openModalOnClass:aClass andSelector:aSelector |
|
1243 |
"open modal on class and selector |
|
1244 |
" |
|
1245 |
specClass := Association key:aClass value:aSelector. |
|
1246 |
super openInterfaceModal. |
|
1247 |
||
1248 |
||
1249 |
! |
|
1250 |
||
1251 |
openOnClass:aClass andSelector:aSelector |
|
1252 |
"open on class and selector |
|
1253 |
" |
|
1254 |
specClass := Association key:aClass value:aSelector. |
|
1255 |
super openInterface. |
|
1256 |
||
1257 |
! |
|
1258 |
||
1259 |
postBuildWith:builder |
|
1260 |
"setup view |
|
1261 |
" |
|
1262 |
|cls sel| |
|
1263 |
||
1264 |
specClass isAssociation ifTrue:[ |
|
1265 |
cls := specClass key. |
|
1266 |
sel := specClass value. |
|
1267 |
]. |
|
1268 |
self buildFrom:cls andSelector:sel. |
|
1269 |
||
1270 |
! ! |
|
1271 |
||
1272 |
!HierarchicalListEditor class methodsFor:'documentation'! |
|
1273 |
||
1274 |
version |
|
1275 |
^ '$Header$' |
|
1276 |
! ! |