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