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