author | Claus Gittinger <cg@exept.de> |
Mon, 20 Apr 1998 15:38:13 +0200 | |
changeset 790 | 79bc027907ee |
parent 747 | c76003b74d7b |
child 882 | d06b7fd56f47 |
permissions | -rw-r--r-- |
300 | 1 |
" |
736 | 2 |
COPYRIGHT (c) 1997 by eXept Software AG |
300 | 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 |
|
736 | 7 |
inclusion of the above copyright notice. This software may not |
300 | 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 |
||
736 | 16 |
ResourceSpecEditor subclass:#HierarchicalListEditor |
731 | 17 |
instanceVariableNames:'treeView' |
18 |
classVariableNames:'' |
|
300 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!HierarchicalListEditor class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
736 | 27 |
COPYRIGHT (c) 1997 by eXept Software AG |
300 | 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 |
|
736 | 32 |
inclusion of the above copyright notice. This software may not |
300 | 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 |
" |
|
731 | 44 |
The HierarchicalListEditor allows you to create, modify or just inspect |
45 |
(statical) hierarchical lists for the SelectionInListView. |
|
300 | 46 |
|
47 |
[start with:] |
|
48 |
HierarchicalListEditor open |
|
49 |
||
50 |
[see also:] |
|
51 |
UIPainter |
|
52 |
||
53 |
[author:] |
|
546 | 54 |
Claus Atzkern, eXept Software AG |
731 | 55 |
Thomas Zwick, eXept Software AG |
300 | 56 |
" |
57 |
||
58 |
||
59 |
||
60 |
! ! |
|
61 |
||
731 | 62 |
!HierarchicalListEditor class methodsFor:'instance creation'! |
63 |
||
64 |
openModalOnTreeItem: aTreeItem |
|
65 |
"Open a HierarchicalListEditor modal on aTreeItem" |
|
66 |
"self openModalOnTreeItem: (TreeItem name: 'Label' contents: #Contents)" |
|
67 |
||
68 |
^self new openModalOnTreeItem: aTreeItem |
|
69 |
||
70 |
! ! |
|
71 |
||
72 |
!HierarchicalListEditor class methodsFor:'accessing'! |
|
73 |
||
74 |
resourceType |
|
75 |
"get the type of resource of the method generated by the HierarchicalListEditor" |
|
76 |
||
77 |
^#hierarchicalList |
|
78 |
||
79 |
! ! |
|
80 |
||
551 | 81 |
!HierarchicalListEditor class methodsFor:'help specs'! |
82 |
||
83 |
helpSpec |
|
736 | 84 |
"This resource specification was automatically generated |
85 |
by the UIHelpTool of ST/X." |
|
86 |
||
87 |
"Do not manually edit this!! If it is corrupted, |
|
88 |
the UIHelpTool may not be able to read the specification." |
|
551 | 89 |
|
90 |
" |
|
736 | 91 |
UIHelpTool openOnClass:HierarchicalListEditor |
551 | 92 |
" |
93 |
||
736 | 94 |
<resource: #help> |
95 |
||
96 |
^super helpSpec addPairsFrom:#( |
|
551 | 97 |
|
98 |
#addChild |
|
99 |
'Adds a new child item.' |
|
100 |
||
101 |
#addSister |
|
102 |
'Adds a new sister item.' |
|
103 |
||
581 | 104 |
#contents |
105 |
'Contents of the tree item.' |
|
106 |
||
731 | 107 |
#fileLoad |
108 |
'Opens a dialog for selecting and loading a hierarchical list spec from a class.' |
|
109 |
||
551 | 110 |
#fileNew |
736 | 111 |
'Creates a new hierarchical list. ' |
551 | 112 |
|
731 | 113 |
#fileSave |
114 |
'Saves current hierarchical list spec.' |
|
552 | 115 |
|
731 | 116 |
#fileSaveAs |
117 |
'Opens a dialog to save current hierarchical list spec.' |
|
552 | 118 |
|
581 | 119 |
#label |
120 |
'Label of the tree item.' |
|
121 |
||
551 | 122 |
) |
123 |
! ! |
|
124 |
||
731 | 125 |
!HierarchicalListEditor class methodsFor:'image specs'! |
300 | 126 |
|
731 | 127 |
createChildIcon |
736 | 128 |
"This resource specification was automatically generated |
129 |
by the ImageEditor of ST/X." |
|
130 |
||
131 |
"Do not manually edit this!! If it is corrupted, |
|
132 |
the ImageEditor may not be able to read the specification." |
|
133 |
||
300 | 134 |
" |
736 | 135 |
ImageEditor openOnClass:self andSelector:#createChildIcon |
300 | 136 |
" |
137 |
||
731 | 138 |
<resource: #image> |
139 |
||
140 |
^Icon |
|
141 |
constantNamed:#'HierarchicalListEditor createChildIcon' |
|
142 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@AUUUUP@@A????2@@A????2 @A????0@@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A<3L308@A33L33H@A30L33H@A33L33H@A<3L008@A?????8@C*****(@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8') ; yourself); yourself]! |
|
300 | 143 |
|
731 | 144 |
createSisterIcon |
736 | 145 |
"This resource specification was automatically generated |
146 |
by the ImageEditor of ST/X." |
|
147 |
||
148 |
"Do not manually edit this!! If it is corrupted, |
|
149 |
the ImageEditor may not be able to read the specification." |
|
150 |
||
731 | 151 |
" |
736 | 152 |
ImageEditor openOnClass:self andSelector:#createSisterIcon |
731 | 153 |
" |
154 |
||
155 |
<resource: #image> |
|
156 |
||
157 |
^Icon |
|
158 |
constantNamed:#'HierarchicalListEditor createSisterIcon' |
|
159 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@AUUUUP@@A????2@@A????2 @A????0@@A?????8@A?????8@A?????8@A<L<O?8@A3<3??8@A<<<<C8@A?L?O?8@A0<0??8@A?????8@A0LCC?8@A<<?L?8@A<<CC?8@A<<?L?8@A<<CL?8@A?????8@C*****(@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8') ; yourself); yourself]! ! |
|
160 |
||
161 |
!HierarchicalListEditor class methodsFor:'interface specs'! |
|
300 | 162 |
|
163 |
windowSpec |
|
736 | 164 |
"This resource specification was automatically generated |
165 |
by the UIPainter of ST/X." |
|
300 | 166 |
|
736 | 167 |
"Do not manually edit this!! If it is corrupted, |
168 |
the UIPainter may not be able to read the specification." |
|
300 | 169 |
|
170 |
" |
|
171 |
UIPainter new openOnClass:HierarchicalListEditor andSelector:#windowSpec |
|
172 |
HierarchicalListEditor new openInterface:#windowSpec |
|
736 | 173 |
HierarchicalListEditor open |
300 | 174 |
" |
175 |
||
176 |
<resource: #canvas> |
|
177 |
||
178 |
^ |
|
179 |
||
180 |
#(#FullSpec |
|
731 | 181 |
#window: |
300 | 182 |
#(#WindowSpec |
731 | 183 |
#name: 'Hierarchical List Editor' |
747 | 184 |
#layout: #(#LayoutFrame 223 0 340 0 692 0 669 0) |
731 | 185 |
#label: 'Hierarchical List Editor' |
747 | 186 |
#min: #(#Point 450 280) |
187 |
#max: #(#Point 1152 900) |
|
188 |
#bounds: #(#Rectangle 223 340 693 670) |
|
731 | 189 |
#menu: #menu |
190 |
#usePreferredExtent: false |
|
300 | 191 |
) |
731 | 192 |
#component: |
300 | 193 |
#(#SpecCollection |
731 | 194 |
#collection: |
300 | 195 |
#( |
196 |
#(#MenuPanelSpec |
|
731 | 197 |
#name: 'menuToolbarView' |
198 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 32 0) |
|
199 |
#menu: #menuToolbar |
|
300 | 200 |
) |
201 |
#(#VariableHorizontalPanelSpec |
|
731 | 202 |
#name: 'VariableHorizontalPanel' |
203 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
204 |
#component: |
|
300 | 205 |
#(#SpecCollection |
731 | 206 |
#collection: |
300 | 207 |
#( |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
208 |
#(#ArbitraryComponentSpec |
731 | 209 |
#name: 'TreeView' |
210 |
#menu: #menuEdit |
|
211 |
#hasHorizontalScrollBar: true |
|
212 |
#hasVerticalScrollBar: true |
|
213 |
#miniScrollerHorizontal: true |
|
214 |
#miniScrollerVertical: true |
|
215 |
#component: #treeView |
|
216 |
#hasBorder: false |
|
300 | 217 |
) |
218 |
#(#ViewSpec |
|
731 | 219 |
#name: 'SpecView' |
220 |
#component: |
|
300 | 221 |
#(#SpecCollection |
731 | 222 |
#collection: |
300 | 223 |
#( |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
224 |
#(#LabelSpec |
731 | 225 |
#name: 'nameLabel' |
736 | 226 |
#layout: #(#AlignmentOrigin 98 0 26 0 1 0.5) |
731 | 227 |
#label: 'Label:' |
228 |
#resizeForLabel: true |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
229 |
) |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
230 |
#(#InputFieldSpec |
731 | 231 |
#name: 'labelInputField' |
736 | 232 |
#layout: #(#LayoutFrame 100 0 15 0 -5 1.0 37 0) |
731 | 233 |
#activeHelpKey: #label |
234 |
#tabable: true |
|
235 |
#model: #itemName |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
236 |
) |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
237 |
#(#LabelSpec |
731 | 238 |
#name: 'valueLabel' |
736 | 239 |
#layout: #(#AlignmentOrigin 98 0 52 0 1 0.5) |
731 | 240 |
#activeHelpKey: #contents |
241 |
#label: 'Contents:' |
|
242 |
#resizeForLabel: true |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
243 |
) |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
244 |
#(#InputFieldSpec |
731 | 245 |
#name: 'valueInputField' |
736 | 246 |
#layout: #(#LayoutFrame 100 0 41 0 -5 1.0 63 0) |
731 | 247 |
#activeHelpKey: #contents |
248 |
#tabable: true |
|
249 |
#model: #itemValue |
|
250 |
#type: #symbolOrNil |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
251 |
) |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
252 |
#(#UISubSpecification |
731 | 253 |
#name: 'SubSpecification' |
254 |
#layout: #(#LayoutFrame 2 0.0 -26 1.0 -2 1.0 -2 1.0) |
|
255 |
#majorKey: #ToolApplicationModel |
|
256 |
#minorKey: #windowSpecForCommit |
|
300 | 257 |
) |
258 |
) |
|
259 |
) |
|
731 | 260 |
#level: -1 |
300 | 261 |
) |
262 |
) |
|
263 |
) |
|
731 | 264 |
#handles: #(#Any 0.368421 1.0) |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
265 |
) |
484 | 266 |
#(#UISubSpecification |
731 | 267 |
#name: 'InfoBarSubSpec' |
268 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
269 |
#majorKey: #ToolApplicationModel |
|
270 |
#minorKey: #windowSpecForInfoBar |
|
300 | 271 |
) |
272 |
) |
|
273 |
) |
|
274 |
) |
|
275 |
! ! |
|
276 |
||
506 | 277 |
!HierarchicalListEditor class methodsFor:'menu specs'! |
278 |
||
279 |
menu |
|
736 | 280 |
"This resource specification was automatically generated |
281 |
by the MenuEditor of ST/X." |
|
506 | 282 |
|
736 | 283 |
"Do not manually edit this!! If it is corrupted, |
284 |
the MenuEditor may not be able to read the specification." |
|
506 | 285 |
|
286 |
" |
|
287 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menu |
|
288 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menu)) startUp |
|
289 |
" |
|
290 |
||
291 |
<resource: #menu> |
|
292 |
||
293 |
^ |
|
294 |
||
295 |
#(#Menu |
|
296 |
||
297 |
#( |
|
298 |
#(#MenuItem |
|
731 | 299 |
#label: 'About' |
300 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
301 |
#submenuChannel: #menuAbout |
|
506 | 302 |
) |
303 |
#(#MenuItem |
|
731 | 304 |
#label: 'File' |
305 |
#submenu: |
|
506 | 306 |
#(#Menu |
307 |
||
308 |
#( |
|
309 |
#(#MenuItem |
|
731 | 310 |
#label: 'New' |
311 |
#value: #doNew |
|
312 |
#activeHelpKey: #fileNew |
|
506 | 313 |
) |
314 |
#(#MenuItem |
|
731 | 315 |
#label: '-' |
522 | 316 |
) |
317 |
#(#MenuItem |
|
731 | 318 |
#label: 'Load...' |
319 |
#translateLabel: true |
|
320 |
#value: #doLoad |
|
321 |
#activeHelpKey: #fileLoad |
|
506 | 322 |
) |
323 |
#(#MenuItem |
|
731 | 324 |
#label: '-' |
506 | 325 |
) |
326 |
#(#MenuItem |
|
731 | 327 |
#label: 'Save' |
328 |
#value: #doSave |
|
329 |
#activeHelpKey: #fileSave |
|
506 | 330 |
) |
331 |
#(#MenuItem |
|
731 | 332 |
#label: 'Save As...' |
333 |
#value: #doSaveAs |
|
334 |
#activeHelpKey: #fileSaveAs |
|
506 | 335 |
) |
336 |
#(#MenuItem |
|
731 | 337 |
#label: '-' |
506 | 338 |
) |
339 |
#(#MenuItem |
|
731 | 340 |
#label: 'Browse Class' |
341 |
#value: #doBrowseClass |
|
342 |
#activeHelpKey: #fileBrowseClass |
|
343 |
#enabled: #hasValidClass |
|
581 | 344 |
) |
345 |
#(#MenuItem |
|
731 | 346 |
#label: '-' |
581 | 347 |
) |
348 |
#(#MenuItem |
|
731 | 349 |
#label: 'Exit' |
350 |
#value: #closeRequest |
|
351 |
#activeHelpKey: #fileExit |
|
506 | 352 |
) |
353 |
) nil |
|
354 |
nil |
|
355 |
) |
|
356 |
) |
|
357 |
#(#MenuItem |
|
731 | 358 |
#label: 'Edit' |
359 |
#submenuChannel: #menuEdit |
|
506 | 360 |
) |
361 |
#(#MenuItem |
|
731 | 362 |
#label: 'Add' |
363 |
#submenu: |
|
522 | 364 |
#(#Menu |
365 |
||
366 |
#( |
|
367 |
#(#MenuItem |
|
731 | 368 |
#label: 'Child' |
369 |
#value: #doCreateChild |
|
370 |
#activeHelpKey: #addChild |
|
371 |
#enabled: #canCreateChildChannel |
|
372 |
#labelImage: #(#ResourceRetriever #HierarchicalListEditor #createChildIcon 'Child') |
|
522 | 373 |
) |
374 |
#(#MenuItem |
|
731 | 375 |
#label: 'Sister' |
376 |
#value: #doCreateSister |
|
377 |
#activeHelpKey: #addSister |
|
378 |
#enabled: #canCreateSisterChannel |
|
379 |
#labelImage: #(#ResourceRetriever #HierarchicalListEditor #createSisterIcon 'Sister') |
|
522 | 380 |
) |
381 |
) nil |
|
382 |
nil |
|
383 |
) |
|
384 |
) |
|
385 |
#(#MenuItem |
|
736 | 386 |
#label: 'Settings' |
387 |
#submenu: |
|
388 |
#(#Menu |
|
389 |
||
390 |
#( |
|
391 |
#(#MenuItem |
|
392 |
#label: 'Fonts' |
|
393 |
#submenuChannel: #menuFont |
|
394 |
) |
|
395 |
) nil |
|
396 |
nil |
|
397 |
) |
|
398 |
) |
|
399 |
#(#MenuItem |
|
747 | 400 |
#label: 'History' |
401 |
#submenuChannel: #menuHistory |
|
402 |
) |
|
403 |
#(#MenuItem |
|
731 | 404 |
#label: 'Help' |
405 |
#startGroup: #right |
|
406 |
#submenuChannel: #menuHelp |
|
546 | 407 |
) |
506 | 408 |
) nil |
409 |
nil |
|
410 |
) |
|
411 |
! |
|
412 |
||
413 |
menuEdit |
|
736 | 414 |
"This resource specification was automatically generated |
415 |
by the MenuEditor of ST/X." |
|
506 | 416 |
|
736 | 417 |
"Do not manually edit this!! If it is corrupted, |
418 |
the MenuEditor may not be able to read the specification." |
|
506 | 419 |
|
420 |
" |
|
421 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menuEdit |
|
422 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menuEdit)) startUp |
|
423 |
" |
|
424 |
||
425 |
<resource: #menu> |
|
426 |
||
427 |
^ |
|
428 |
||
429 |
#(#Menu |
|
430 |
||
431 |
#( |
|
432 |
#(#MenuItem |
|
731 | 433 |
#label: 'Cut' |
434 |
#value: #doCut |
|
435 |
#activeHelpKey: #editCut |
|
436 |
#enabled: #valueOfCanCut |
|
437 |
) |
|
438 |
#(#MenuItem |
|
439 |
#label: 'Copy' |
|
440 |
#value: #doCopy |
|
441 |
#activeHelpKey: #editCopy |
|
442 |
#enabled: #valueOfCanCopy |
|
506 | 443 |
) |
444 |
#(#MenuItem |
|
731 | 445 |
#label: 'Paste' |
446 |
#value: #doPaste |
|
447 |
#activeHelpKey: #editPaste |
|
448 |
#enabled: #valueOfCanPaste |
|
506 | 449 |
) |
450 |
#(#MenuItem |
|
731 | 451 |
#label: 'Delete' |
452 |
#value: #doDelete |
|
453 |
#activeHelpKey: #editPaste |
|
454 |
#enabled: #valueOfCanCut |
|
506 | 455 |
) |
456 |
#(#MenuItem |
|
731 | 457 |
#label: '-' |
506 | 458 |
) |
459 |
#(#MenuItem |
|
731 | 460 |
#label: 'Move Up' |
461 |
#value: #doStepUp |
|
462 |
#activeHelpKey: #editMoveUp |
|
463 |
#enabled: #canStepOverChannel |
|
464 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #upIcon 'Move Up') |
|
506 | 465 |
) |
466 |
#(#MenuItem |
|
731 | 467 |
#label: 'Move Down' |
468 |
#value: #doStepDown |
|
469 |
#activeHelpKey: #editMoveDown |
|
470 |
#enabled: #canStepOverChannel |
|
471 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #downIcon 'Move Down') |
|
506 | 472 |
) |
473 |
#(#MenuItem |
|
731 | 474 |
#label: 'Move In' |
475 |
#value: #doStepIn |
|
476 |
#activeHelpKey: #editMoveIn |
|
477 |
#enabled: #canStepInChannel |
|
478 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #downRightIcon 'Move In') |
|
506 | 479 |
) |
480 |
#(#MenuItem |
|
731 | 481 |
#label: 'Move Out' |
482 |
#value: #doStepOut |
|
483 |
#activeHelpKey: #editMoveOut |
|
484 |
#enabled: #canStepOutChannel |
|
485 |
#labelImage: #(#ResourceRetriever #ToolApplicationModel #leftDownIcon 'Move Out') |
|
506 | 486 |
) |
487 |
) nil |
|
488 |
nil |
|
489 |
) |
|
490 |
! |
|
491 |
||
492 |
menuToolbar |
|
736 | 493 |
"This resource specification was automatically generated |
494 |
by the MenuEditor of ST/X." |
|
506 | 495 |
|
736 | 496 |
"Do not manually edit this!! If it is corrupted, |
497 |
the MenuEditor may not be able to read the specification." |
|
506 | 498 |
|
499 |
" |
|
500 |
MenuEditor new openOnClass:HierarchicalListEditor andSelector:#menuToolbar |
|
501 |
(Menu new fromLiteralArrayEncoding:(HierarchicalListEditor menuToolbar)) startUp |
|
502 |
" |
|
503 |
||
504 |
<resource: #menu> |
|
505 |
||
506 |
^ |
|
507 |
||
508 |
#(#Menu |
|
509 |
||
510 |
#( |
|
511 |
#(#MenuItem |
|
731 | 512 |
#label: 'New' |
513 |
#isButton: true |
|
514 |
#value: #doNew |
|
515 |
#activeHelpKey: #fileNew |
|
516 |
#labelImage: #(#ResourceRetriever nil #newIcon) |
|
506 | 517 |
) |
518 |
#(#MenuItem |
|
731 | 519 |
#label: 'Load' |
520 |
#isButton: true |
|
521 |
#value: #doLoad |
|
522 |
#activeHelpKey: #fileLoad |
|
523 |
#labelImage: #(#ResourceRetriever nil #loadIcon) |
|
524 |
) |
|
525 |
#(#MenuItem |
|
526 |
#label: 'Save' |
|
527 |
#isButton: true |
|
528 |
#value: #doSave |
|
529 |
#activeHelpKey: #fileSave |
|
530 |
#labelImage: #(#ResourceRetriever nil #saveIcon) |
|
506 | 531 |
) |
532 |
#(#MenuItem |
|
731 | 533 |
#label: '' |
534 |
) |
|
535 |
#(#MenuItem |
|
536 |
#label: 'Cut' |
|
537 |
#isButton: true |
|
538 |
#value: #doCut |
|
539 |
#activeHelpKey: #editCut |
|
540 |
#enabled: #valueOfCanCut |
|
541 |
#labelImage: #(#ResourceRetriever nil #cutIcon) |
|
506 | 542 |
) |
543 |
#(#MenuItem |
|
731 | 544 |
#label: 'Copy' |
545 |
#isButton: true |
|
546 |
#value: #doCopy |
|
547 |
#activeHelpKey: #editCopy |
|
548 |
#enabled: #valueOfCanCopy |
|
549 |
#labelImage: #(#ResourceRetriever nil #copyIcon) |
|
506 | 550 |
) |
551 |
#(#MenuItem |
|
731 | 552 |
#label: 'Paste' |
553 |
#isButton: true |
|
554 |
#value: #doPaste |
|
555 |
#activeHelpKey: #editPaste |
|
556 |
#enabled: #valueOfCanPaste |
|
557 |
#labelImage: #(#ResourceRetriever nil #pasteIcon) |
|
506 | 558 |
) |
559 |
#(#MenuItem |
|
731 | 560 |
#label: 'Delete' |
561 |
#isButton: true |
|
562 |
#value: #doDelete |
|
563 |
#activeHelpKey: #editDelete |
|
564 |
#enabled: #valueOfCanCut |
|
565 |
#labelImage: #(#ResourceRetriever nil #deleteIcon) |
|
566 |
) |
|
567 |
#(#MenuItem |
|
568 |
#label: '' |
|
506 | 569 |
) |
570 |
#(#MenuItem |
|
731 | 571 |
#label: 'Add Child' |
572 |
#isButton: true |
|
573 |
#value: #doCreateChild |
|
574 |
#activeHelpKey: #addChild |
|
575 |
#enabled: #canCreateChildChannel |
|
576 |
#labelImage: #(#ResourceRetriever nil #createChildIcon) |
|
577 |
) |
|
578 |
#(#MenuItem |
|
579 |
#label: 'Add Sister' |
|
580 |
#isButton: true |
|
581 |
#value: #doCreateSister |
|
582 |
#activeHelpKey: #addSister |
|
583 |
#enabled: #canCreateSisterChannel |
|
584 |
#labelImage: #(#ResourceRetriever nil #createSisterIcon) |
|
585 |
) |
|
586 |
#(#MenuItem |
|
587 |
#label: '' |
|
506 | 588 |
) |
589 |
#(#MenuItem |
|
731 | 590 |
#label: 'Move Up' |
591 |
#isButton: true |
|
592 |
#value: #doStepUp |
|
593 |
#activeHelpKey: #editMoveUp |
|
594 |
#enabled: #canStepOverChannel |
|
595 |
#labelImage: #(#ResourceRetriever nil #upIcon) |
|
506 | 596 |
) |
597 |
#(#MenuItem |
|
731 | 598 |
#label: 'Move Down' |
599 |
#isButton: true |
|
600 |
#value: #doStepDown |
|
601 |
#activeHelpKey: #editMoveDown |
|
602 |
#enabled: #canStepOverChannel |
|
603 |
#labelImage: #(#ResourceRetriever nil #downIcon) |
|
506 | 604 |
) |
605 |
#(#MenuItem |
|
731 | 606 |
#label: 'Move In' |
607 |
#isButton: true |
|
608 |
#value: #doStepIn |
|
609 |
#activeHelpKey: #editMoveIn |
|
610 |
#enabled: #canStepInChannel |
|
611 |
#labelImage: #(#ResourceRetriever nil #downRightIcon) |
|
612 |
) |
|
613 |
#(#MenuItem |
|
614 |
#label: 'Move Out' |
|
615 |
#isButton: true |
|
616 |
#value: #doStepOut |
|
617 |
#activeHelpKey: #editMoveOut |
|
618 |
#enabled: #canStepOutChannel |
|
619 |
#labelImage: #(#ResourceRetriever nil #leftDownIcon) |
|
506 | 620 |
) |
621 |
) nil |
|
622 |
nil |
|
623 |
) |
|
624 |
! ! |
|
625 |
||
300 | 626 |
!HierarchicalListEditor class methodsFor:'printing'! |
627 |
||
628 |
prettyPrintArray:anArray on:aStream indent:anIndent |
|
629 |
"print a literal array in a nice format |
|
630 |
" |
|
631 |
|arg sol| |
|
632 |
||
633 |
sol := aStream position. |
|
634 |
aStream spaces:anIndent. |
|
635 |
aStream nextPutAll:'#('. |
|
636 |
||
637 |
anArray first isSymbol ifTrue:[ |
|
638 |
arg := anArray first. |
|
639 |
aStream nextPut:$#. |
|
640 |
aStream nextPutAll:anArray first. |
|
641 |
aStream cr. |
|
642 |
anArray size == 2 ifTrue:[ |
|
643 |
self prettyPrintArray:(anArray last) |
|
644 |
on:aStream |
|
645 |
indent:(anIndent + 4). |
|
646 |
]. |
|
647 |
aStream spaces:anIndent. |
|
648 |
aStream nextPut:$). |
|
649 |
^ self |
|
650 |
]. |
|
651 |
||
652 |
aStream nextPut:$'. |
|
653 |
aStream nextPutAll:(anArray at:1). |
|
654 |
aStream nextPut:$'. |
|
655 |
arg := anArray at:2 ifAbsent:nil. |
|
656 |
||
657 |
arg isString ifTrue:[ |
|
658 |
aStream spaces:((50 - (aStream position - sol)) max:4). |
|
659 |
||
660 |
arg isSymbol ifTrue:[ |
|
661 |
aStream nextPut:$#. |
|
662 |
]. |
|
663 |
aStream nextPut:$'. |
|
664 |
aStream nextPutAll:arg. |
|
665 |
aStream nextPut:$'. |
|
666 |
arg := anArray at:3 ifAbsent:nil. |
|
667 |
]. |
|
668 |
arg isArray ifTrue:[ |
|
669 |
aStream nextPutAll:' #('. |
|
670 |
aStream cr. |
|
671 |
arg do:[:e|self prettyPrintArray:e on:aStream indent:(anIndent + 4)]. |
|
672 |
aStream spaces:anIndent. |
|
673 |
aStream nextPut:$). |
|
674 |
]. |
|
675 |
aStream nextPut:$). |
|
676 |
aStream cr. |
|
677 |
! ! |
|
678 |
||
679 |
!HierarchicalListEditor methodsFor:'aspects'! |
|
680 |
||
681 |
canCreateChildChannel |
|
682 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
683 |
^builder booleanValueAspectFor:#canCreateChildChannel |
300 | 684 |
|
685 |
! |
|
686 |
||
687 |
canCreateSisterChannel |
|
688 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
689 |
^builder booleanValueAspectFor:#canCreateSisterChannel |
300 | 690 |
|
691 |
! |
|
692 |
||
693 |
canStepInChannel |
|
694 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
695 |
^builder booleanValueAspectFor:#canStepInChannel |
300 | 696 |
|
697 |
! |
|
698 |
||
699 |
canStepOutChannel |
|
700 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
701 |
^builder booleanValueAspectFor:#canStepOutChannel |
300 | 702 |
|
703 |
! |
|
704 |
||
705 |
canStepOverChannel |
|
706 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
707 |
^builder booleanValueAspectFor:#canStepOverChannel |
300 | 708 |
|
709 |
! |
|
710 |
||
711 |
itemName |
|
712 |
||
713 |
|holder| |
|
714 |
||
715 |
(holder := builder bindingAt:#itemName) isNil ifTrue:[ |
|
716 |
builder aspectAt:#itemName put:(holder := ValueHolder new). |
|
717 |
holder addDependent:self. |
|
718 |
]. |
|
719 |
^ holder |
|
720 |
! |
|
721 |
||
722 |
itemValue |
|
723 |
||
724 |
|holder| |
|
725 |
||
726 |
(holder := builder bindingAt:#itemValue) isNil ifTrue:[ |
|
727 |
builder aspectAt:#itemValue put:(holder := ValueHolder new). |
|
728 |
holder addDependent:self. |
|
729 |
]. |
|
730 |
^ holder |
|
731 |
! |
|
732 |
||
733 |
treeView |
|
734 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
735 |
^treeView |
300 | 736 |
! ! |
737 |
||
731 | 738 |
!HierarchicalListEditor methodsFor:'building'! |
739 |
||
740 |
buildFromClass:aClass andSelector:aSelector |
|
741 |
"rebuild window from a class and selector" |
|
742 |
||
743 |
|cls sel anchor| |
|
300 | 744 |
|
731 | 745 |
cls := self resolveName:aClass. |
746 |
specSelector := nil. |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
747 |
|
731 | 748 |
aSelector size ~~ 0 |
749 |
ifTrue: |
|
750 |
[ |
|
751 |
sel := aSelector asString withoutSeparators. |
|
752 |
sel size ~~ 0 ifTrue:[specSelector := sel asSymbol] |
|
753 |
]. |
|
754 |
treeView selection:nil. |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
755 |
|
731 | 756 |
(specSelector notNil and:[cls notNil]) |
757 |
ifTrue: |
|
758 |
[ |
|
759 |
(cls respondsTo:specSelector) |
|
760 |
ifTrue: |
|
761 |
[ |
|
762 |
anchor := cls perform:specSelector. |
|
763 |
anchor isArray ifTrue:[anchor := anchor decodeAsLiteralArray] |
|
764 |
]. |
|
765 |
]. |
|
766 |
anchor notNil |
|
767 |
ifTrue: [anchor expand. treeView root:anchor] |
|
768 |
ifFalse: [treeView root isNil ifTrue: [self buildRoot]]. |
|
581 | 769 |
|
731 | 770 |
treeView selection: 1. |
581 | 771 |
|
731 | 772 |
self updateHistory. |
773 |
self updateInfoLabel. |
|
774 |
||
775 |
||
776 |
||
777 |
! |
|
778 |
||
736 | 779 |
buildFromResourceSpec: aListSpec |
581 | 780 |
|
731 | 781 |
treeView root: aListSpec |
782 |
||
783 |
! |
|
784 |
||
785 |
buildRoot |
|
786 |
"build just a root" |
|
787 |
||
788 |
treeView root:(TreeItem name:'Root' contents:#Anchor). |
|
789 |
treeView selection:1. |
|
581 | 790 |
! ! |
791 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
792 |
!HierarchicalListEditor methodsFor:'private'! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
793 |
|
731 | 794 |
getDepthAndSistersNumberOfNode: aNode onParentNode: aParentNode |
795 |
"return depth of selected node" |
|
796 |
||
797 |
|parent childNode depthAndSistersNumbers str| |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
798 |
|
731 | 799 |
depthAndSistersNumbers := OrderedCollection new. |
800 |
childNode := aNode. |
|
801 |
parent := aParentNode. |
|
802 |
[parent notNil] |
|
803 |
whileTrue: |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
804 |
[ |
731 | 805 |
depthAndSistersNumbers add: (parent children indexOf: childNode). |
806 |
childNode := parent. |
|
807 |
parent := parent parent. |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
808 |
]. |
731 | 809 |
depthAndSistersNumbers removeFirst; addFirst: aParentNode children size. |
810 |
str := ''. |
|
811 |
depthAndSistersNumbers reverseDo: [:n| str := str, n printString, '.']. |
|
812 |
^str copyFrom: 1 to: str size - 1 |
|
506 | 813 |
! |
814 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
815 |
newItem |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
816 |
"creates and returns a new default item" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
817 |
|
558 | 818 |
^TreeItem name: 'Item' contents: nil |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
819 |
! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
820 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
821 |
updateChannels |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
822 |
"update channels" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
823 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
824 |
|node parent chnStepIn chnStepOut chnStepOvr chnChild chnSister| |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
825 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
826 |
chnStepIn := chnStepOut := chnStepOvr := chnChild := chnSister := false. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
827 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
828 |
(node := treeView selectedNode) notNil |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
829 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
830 |
[ |
731 | 831 |
(builder componentAt: #SpecView) beVisible. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
832 |
chnChild := true. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
833 |
(parent := node parent) notNil |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
834 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
835 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
836 |
chnSister := true. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
837 |
chnStepOvr := parent numberOfChildren > 1. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
838 |
chnStepOut := parent parent notNil. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
839 |
chnStepIn := node ~~ parent lastChild |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
840 |
] |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
841 |
] |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
842 |
ifFalse: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
843 |
[ |
731 | 844 |
(builder componentAt: #SpecView) beInvisible |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
845 |
]. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
846 |
self canCreateChildChannel value:chnChild. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
847 |
self canCreateSisterChannel value:chnSister. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
848 |
self canStepOverChannel value:chnStepOvr. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
849 |
self canStepOutChannel value:chnStepOut. |
506 | 850 |
self canStepInChannel value:chnStepIn. |
851 |
||
731 | 852 |
self valueOfCanCut value: (treeView selection notNil |
853 |
ifTrue:[(treeView isInSelection:1) not] |
|
854 |
ifFalse: [false]). |
|
506 | 855 |
|
731 | 856 |
self valueOfCanCopy value: self valueOfCanCut value. |
857 |
||
736 | 858 |
self valueOfCanPaste value: treeView selectedNode notNil & self valueOfCanPaste value. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
859 |
! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
860 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
861 |
updateInputFields |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
862 |
"reload item value into input fields" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
863 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
864 |
|node| |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
865 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
866 |
(node := treeView selectedNode) notNil |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
867 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
868 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
869 |
self itemName value:node name. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
870 |
self itemValue value:node contents |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
871 |
] |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
872 |
ifFalse: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
873 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
874 |
self itemName value:''. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
875 |
self itemValue value:nil |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
876 |
]. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
877 |
self valueOfEnablingCommitButtons value: false |
300 | 878 |
! ! |
879 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
880 |
!HierarchicalListEditor methodsFor:'startup / release'! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
881 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
882 |
initialize |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
883 |
"setup default values" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
884 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
885 |
super initialize. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
886 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
887 |
treeView := SelectionInTreeView new. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
888 |
treeView multipleSelectOk: true. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
889 |
treeView showDirectoryIndicator: true. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
890 |
treeView showDirectoryIndicatorForRoot: false. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
891 |
treeView action:[:aNr| self updateChannels. self updateInputFields]. |
731 | 892 |
treeView selectConditionBlock: [:i|self askForItemModification]. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
893 |
treeView validateDoubleClickBlock: [:node| node ~~ treeView model list first]. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
894 |
! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
895 |
|
731 | 896 |
openModalOnTreeItem: aTreeItem |
897 |
"build a tree from aTreeItem and open it modal" |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
898 |
|
736 | 899 |
super openModalOnResourceSpec: aTreeItem |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
900 |
! ! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
901 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
902 |
!HierarchicalListEditor methodsFor:'user actions'! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
903 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
904 |
accept |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
905 |
"invoked by button 'OK'" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
906 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
907 |
|node index| |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
908 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
909 |
(index := treeView selectedIndex) ~~ 0 |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
910 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
911 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
912 |
node := treeView nodeAtIndex:index. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
913 |
node name: self itemName value. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
914 |
node contents: self itemValue value. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
915 |
treeView redrawLine:index. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
916 |
]. |
731 | 917 |
modified := true. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
918 |
self valueOfEnablingCommitButtons value: false |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
919 |
! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
920 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
921 |
cancel |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
922 |
"invoked by button 'Cancel'" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
923 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
924 |
self updateInputFields. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
925 |
|
731 | 926 |
modified := false. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
927 |
self valueOfEnablingCommitButtons value: false |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
928 |
! |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
929 |
|
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
930 |
doCopy |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
931 |
"copy current selected nodes into copy buffer" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
932 |
|
731 | 933 |
self class clipboard: OrderedCollection new. |
736 | 934 |
treeView selectedNodesDo:[:aNode| self class clipboard add: aNode copy]. |
747 | 935 |
self updateAllToolInstances |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
936 |
! |
300 | 937 |
|
938 |
doCreateChild |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
939 |
"create a child within selected parent" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
940 |
|
558 | 941 |
|node newItem| |
300 | 942 |
|
731 | 943 |
((node := treeView selectedNode) notNil and: [self askForItemModification]) |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
944 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
945 |
[ |
558 | 946 |
treeView model add: (newItem := self newItem) afterIndex: node children size below:node. |
947 |
newItem name: 'Child ', (self getDepthAndSistersNumberOfNode: newItem onParentNode: node). |
|
300 | 948 |
treeView selectedNodeExpand:true. |
558 | 949 |
treeView selectNode: newItem. |
300 | 950 |
self updateChannels. |
731 | 951 |
modified := true |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
952 |
] |
300 | 953 |
! |
954 |
||
955 |
doCreateSister |
|
956 |
"create a sister next to selected item |
|
957 |
" |
|
558 | 958 |
|node newItem| |
300 | 959 |
|
731 | 960 |
((node := treeView selectedNode) notNil and: [self askForItemModification]) |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
961 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
962 |
[ |
558 | 963 |
newItem := self newItem. |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
964 |
node parent notNil |
562 | 965 |
ifTrue: [treeView model add: newItem after:node] |
558 | 966 |
ifFalse:[treeView model add: newItem beforeIndex:1 below:node]. |
562 | 967 |
|
558 | 968 |
newItem name: 'Child ', (self getDepthAndSistersNumberOfNode: newItem onParentNode: node parent). |
969 |
treeView selectNode: newItem. |
|
506 | 970 |
self updateChannels. |
731 | 971 |
modified := true |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
972 |
] |
300 | 973 |
! |
974 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
975 |
doCut |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
976 |
"cut current selected nodes" |
300 | 977 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
978 |
|selection| |
731 | 979 |
(treeView hasSelection and: [self askForItemModification]) |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
980 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
981 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
982 |
self doCopy. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
983 |
selection := treeView selection asSortedCollection. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
984 |
treeView selectedNodesRemove. |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
985 |
treeView selection: selection first - 1. |
747 | 986 |
self updateAllToolInstances. |
731 | 987 |
modified := true |
988 |
] |
|
989 |
! |
|
990 |
||
991 |
doDelete |
|
992 |
"delete current selected nodes" |
|
993 |
||
994 |
|selection| |
|
995 |
(treeView hasSelection and: [self askForItemModification]) |
|
996 |
ifTrue: |
|
997 |
[ |
|
998 |
selection := treeView selection asSortedCollection. |
|
999 |
treeView selectedNodesRemove. |
|
1000 |
treeView selection: selection first - 1. |
|
1001 |
self updateChannels. |
|
1002 |
modified := true |
|
300 | 1003 |
] |
1004 |
! |
|
1005 |
||
731 | 1006 |
doNew |
736 | 1007 |
"first do super new; then make a build |
1008 |
of a resource spec containing a root" |
|
300 | 1009 |
|
736 | 1010 |
super doNew ifTrue: [self buildRoot] |
300 | 1011 |
|
731 | 1012 |
|
1013 |
||
300 | 1014 |
! |
1015 |
||
731 | 1016 |
doPaste |
1017 |
"paste after current selected item" |
|
1018 |
||
736 | 1019 |
(self askForItemModification and: [self class clipboard notNil]) |
731 | 1020 |
ifTrue: |
1021 |
[ |
|
1022 |
|copiedNode| |
|
1023 |
self class clipboard do: |
|
1024 |
[:node| |
|
1025 |
copiedNode := node copy. |
|
1026 |
treeView selectedNodeAdd: copiedNode. |
|
1027 |
treeView selectNode: copiedNode. |
|
1028 |
]. |
|
1029 |
self updateChannels. |
|
1030 |
modified := true |
|
1031 |
] |
|
1032 |
! |
|
1033 |
||
1034 |
doReload |
|
1035 |
"reload spec from current class and selector" |
|
1036 |
||
1037 |
self buildFrom:specClass andSelector:specSelector |
|
1038 |
||
1039 |
! |
|
1040 |
||
1041 |
doSave |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1042 |
"install code" |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1043 |
|
731 | 1044 |
|cls code spec category mthd stream| |
300 | 1045 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1046 |
(specClass notNil and:[specSelector notNil]) |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1047 |
ifFalse: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1048 |
[ |
731 | 1049 |
^self doSaveAs |
300 | 1050 |
]. |
1051 |
||
731 | 1052 |
cls := self resolveName: specClass. |
300 | 1053 |
spec := (treeView nodeAtIndex:1) literalArrayEncoding. |
1054 |
stream := WriteStream on:String new. |
|
1055 |
self class prettyPrintArray:spec on:stream indent:4. |
|
1056 |
spec := stream contents. |
|
731 | 1057 |
category := 'list specs'. |
300 | 1058 |
|
731 | 1059 |
(mthd := cls class compiledMethodAt:specSelector) notNil |
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1060 |
ifTrue: |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1061 |
[ |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1062 |
category := mthd category |
300 | 1063 |
]. |
1064 |
||
1065 |
code := Character excla asString |
|
731 | 1066 |
, cls name , ' class methodsFor:' , category storeString |
300 | 1067 |
, Character excla asString , '\\' |
1068 |
||
1069 |
, specSelector , '\' |
|
736 | 1070 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
1071 |
, '\\ "\' |
|
731 | 1072 |
, ' HierarchicalListEditor openOnClass:' , cls name , ' andSelector:#' , specSelector , '\' |
300 | 1073 |
, ' "\'. |
1074 |
||
1075 |
code := code |
|
1076 |
, '\' |
|
1077 |
, ' <resource: #hierarchicalList>\\' |
|
1078 |
, ' ^\' |
|
1079 |
, spec |
|
1080 |
, ' decodeAsLiteralArray\' |
|
1081 |
, Character excla asString |
|
1082 |
, ' ' |
|
1083 |
, Character excla asString |
|
1084 |
, '\\'. |
|
1085 |
||
1086 |
code := code withCRs. |
|
1087 |
(ReadStream on:code) fileIn. |
|
1088 |
||
731 | 1089 |
self updateHistory. |
1090 |
hasSaved := true. |
|
1091 |
modified := false. |
|
300 | 1092 |
! |
1093 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1094 |
doStepDown |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1095 |
"move selected item after next item" |
300 | 1096 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1097 |
treeView selectedNodeChangeSequenceOrder:1. |
506 | 1098 |
self updateChannels. |
731 | 1099 |
modified := true |
506 | 1100 |
|
300 | 1101 |
! |
1102 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1103 |
doStepIn |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1104 |
"lets become the selected item a child of its next sister" |
300 | 1105 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1106 |
treeView selectedNodeBecomeChildOfNext. |
506 | 1107 |
self updateChannels. |
731 | 1108 |
modified := true |
506 | 1109 |
|
1110 |
||
1111 |
||
300 | 1112 |
! |
1113 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1114 |
doStepOut |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1115 |
"let selected node become a sister of its current parent" |
300 | 1116 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1117 |
treeView selectedNodeBecomeSisterOfParent. |
506 | 1118 |
self updateChannels. |
731 | 1119 |
modified := true |
506 | 1120 |
|
1121 |
||
1122 |
||
300 | 1123 |
! |
1124 |
||
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1125 |
doStepUp |
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1126 |
"move selected item before previous item" |
300 | 1127 |
|
423
ea6880a0e024
totally revised version; create icons will be changed next days
tz
parents:
372
diff
changeset
|
1128 |
treeView selectedNodeChangeSequenceOrder:-1. |
506 | 1129 |
self updateChannels. |
731 | 1130 |
modified := true |
506 | 1131 |
|
1132 |
||
1133 |
||
300 | 1134 |
! ! |
1135 |
||
1136 |
!HierarchicalListEditor class methodsFor:'documentation'! |
|
1137 |
||
1138 |
version |
|
1139 |
^ '$Header$' |
|
1140 |
! ! |