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