author | tz |
Wed, 13 May 1998 14:42:13 +0200 | |
changeset 823 | 47e7d348e01a |
parent 818 | 5bd68980f09a |
child 825 | 89719cf96c63 |
permissions | -rw-r--r-- |
332 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
15 |
||
16 |
||
818 | 17 |
ResourceSpecEditor subclass:#DataSetBuilder |
18 |
instanceVariableNames:'rowClass rowSuperClass hasChanged columnView columns |
|
19 |
selectedColumnIndex tabSelectionIndex' |
|
816 | 20 |
classVariableNames:'' |
332 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-UIPainter' |
|
23 |
! |
|
24 |
||
25 |
!DataSetBuilder class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
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 |
|
34 |
inclusion of the above copyright notice. This software may not |
|
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 |
||
45 |
documentation |
|
46 |
" |
|
47 |
create and modify or inspect dataset columns; used by UIPainter (DataSetColumnSpec) |
|
48 |
||
49 |
[see also:] |
|
50 |
DataSetColumnSpec |
|
51 |
DataSetSpec |
|
52 |
DataSetView |
|
53 |
DataSetColumn |
|
54 |
||
55 |
[author:] |
|
545 | 56 |
Claus Atzkern, eXept Software AG |
332 | 57 |
" |
58 |
||
59 |
! ! |
|
60 |
||
799
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
61 |
!DataSetBuilder class methodsFor:'instance creation'! |
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
62 |
|
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
63 |
openOnClass:aClass andSelector:aSelector |
818 | 64 |
|
65 |
^ self new openOnClass:aClass andSelector:aSelector |
|
66 |
! ! |
|
67 |
||
68 |
!DataSetBuilder class methodsFor:'constants'! |
|
799
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
69 |
|
818 | 70 |
resourceType |
71 |
"get the type of resource of the method generated by the MenuEditor" |
|
72 |
||
73 |
^#dataset |
|
74 |
||
75 |
||
799
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
76 |
! ! |
22734b99f830
added dummy openOnClass:andSelector: (invoked by Browser)
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
77 |
|
528 | 78 |
!DataSetBuilder class methodsFor:'help specs'! |
79 |
||
80 |
helpSpec |
|
818 | 81 |
"This resource specification was automatically generated |
82 |
by the UIHelpTool of ST/X." |
|
83 |
||
84 |
"Do not manually edit this!! If it is corrupted, |
|
85 |
the UIHelpTool may not be able to read the specification." |
|
528 | 86 |
|
87 |
" |
|
818 | 88 |
UIHelpTool openOnClass:DataSetBuilder |
528 | 89 |
" |
90 |
||
818 | 91 |
<resource: #help> |
92 |
||
93 |
^super helpSpec addPairsFrom:#( |
|
528 | 94 |
|
550 | 95 |
#addColumn |
96 |
'Adds a new column.' |
|
97 |
||
597 | 98 |
#basicsEditor |
99 |
'Default widget type or a selector returning an instance of an user defined widget opened in the cell.' |
|
528 | 100 |
|
597 | 101 |
#basicsFont |
102 |
'Sets the font of the label text.' |
|
528 | 103 |
|
597 | 104 |
#basicsJustification |
105 |
'Aligns the label text to the left, right, or centered in the cell.' |
|
528 | 106 |
|
597 | 107 |
#basicsLabel |
108 |
'The label of the column or a selector returning a string an image.' |
|
109 |
||
110 |
#basicsLabelIsImage |
|
111 |
'Turns on/off image behavior of the label string; i.e. it is used as selector returning an image.' |
|
528 | 112 |
|
597 | 113 |
#basicsRenderer |
114 |
'Specifies displaying cell as Text, CheckToggle, ComboBox, ComboList or as a RowSelector.' |
|
528 | 115 |
|
597 | 116 |
#colorsBackgroundCellColor |
117 |
'Sets the background color of the column.' |
|
118 |
||
119 |
#colorsBackgroundLabelColor |
|
120 |
'Sets the background color of the label.' |
|
528 | 121 |
|
597 | 122 |
#colorsBackgroundSelector |
123 |
'Selector returning the background color for a cell (optional).' |
|
528 | 124 |
|
597 | 125 |
#colorsForegroundCellColor |
126 |
'Sets the foreground color of the column.' |
|
127 |
||
128 |
#colorsForegroundLabelColor |
|
129 |
'Sets the foreground color of the label.' |
|
528 | 130 |
|
597 | 131 |
#colorsForegroundSelector |
132 |
'Selector returning the foreground color for a cell (optional).' |
|
528 | 133 |
|
597 | 134 |
#formatInputType |
135 |
'A type converter symbol used by the input field.' |
|
528 | 136 |
|
597 | 137 |
#formatMaxSize |
138 |
'Maximum size of the string which can be typed in. 0 or nil means unlimited.' |
|
528 | 139 |
|
597 | 140 |
#formatTextFormat |
141 |
'Format string specifying the output format of the cell text. In this release, only numbers are supported (for example: 0.0000).' |
|
142 |
||
143 |
#frameColumnWidth |
|
144 |
'Width (fixed) of a column (optional).' |
|
528 | 145 |
|
597 | 146 |
#frameMinWidth |
147 |
'Minimum width of the column (optional).' |
|
528 | 148 |
|
597 | 149 |
#frameRowHeight |
150 |
'Height of the row (optional).' |
|
151 |
||
152 |
#frameShowColumnSeparator |
|
153 |
'Turns on/off displaying column separators.' |
|
528 | 154 |
|
597 | 155 |
#frameShowRowSeparator |
156 |
'Turns on/off displaying row separators.' |
|
528 | 157 |
|
597 | 158 |
#selectionCellClickSelector |
818 | 159 |
'A selector called if cell was selected.' |
528 | 160 |
|
597 | 161 |
#selectionCellDoubleClickSelector |
162 |
'A selector called if cell was double clicked.' |
|
528 | 163 |
|
597 | 164 |
#selectionCellSelector |
528 | 165 |
'An optional selector, which is used to test whether the cell in the column is selectable; the ''Is Selectable'' flag must be enabled.' |
166 |
||
597 | 167 |
#selectionIsSelectable |
168 |
'Turns on/off selection behavior of a column.' |
|
169 |
||
170 |
#selectionLabelClickSelector |
|
171 |
'A selector called if label cell was clicked.' |
|
528 | 172 |
|
597 | 173 |
#selectionLabelSelectorArgument |
818 | 174 |
'An argument passed to label selection selector.' |
528 | 175 |
|
597 | 176 |
#valuesChoiceSelector |
177 |
'A selector returning a collection of choices for a cell having a ComboBox or a ComboList widget.' |
|
528 | 178 |
|
597 | 179 |
#valuesMenuSelector |
180 |
'A selector returning a middle button menu.' |
|
181 |
||
182 |
#valuesPrintSelector |
|
183 |
'A key selector used to register images on a DSVColumnView (the arg). For more detailed info see #register... methods in DSVColumnView.' |
|
528 | 184 |
|
597 | 185 |
#valuesReadSelector |
186 |
'A selector used to get (string or a bitmap) or set (if the write selector is undefined) the contents of a cell.' |
|
528 | 187 |
|
597 | 188 |
#valuesWriteSelector |
189 |
'A selector used to set the value of a cell.' |
|
528 | 190 |
|
191 |
) |
|
192 |
! ! |
|
193 |
||
194 |
!DataSetBuilder class methodsFor:'interface specs'! |
|
332 | 195 |
|
196 |
basicsEditSpec |
|
817 | 197 |
"This resource specification was automatically generated |
198 |
by the UIPainter of ST/X." |
|
332 | 199 |
|
817 | 200 |
"Do not manually edit this!! If it is corrupted, |
201 |
the UIPainter may not be able to read the specification." |
|
332 | 202 |
|
203 |
" |
|
204 |
UIPainter new openOnClass:DataSetBuilder andSelector:#basicsEditSpec |
|
205 |
DataSetBuilder new openInterface:#basicsEditSpec |
|
206 |
" |
|
207 |
||
208 |
<resource: #canvas> |
|
209 |
||
210 |
^ |
|
211 |
||
212 |
#(#FullSpec |
|
687 | 213 |
#window: |
332 | 214 |
#(#WindowSpec |
687 | 215 |
#name: 'DataSet Basic' |
817 | 216 |
#layout: #(#LayoutFrame 8 0 124 0 296 0 379 0) |
687 | 217 |
#label: 'DataSet Basic' |
218 |
#min: #(#Point 10 10) |
|
219 |
#max: #(#Point 1280 1024) |
|
817 | 220 |
#bounds: #(#Rectangle 8 124 297 380) |
687 | 221 |
#usePreferredExtent: false |
332 | 222 |
) |
687 | 223 |
#component: |
332 | 224 |
#(#SpecCollection |
687 | 225 |
#collection: |
332 | 226 |
#( |
408 | 227 |
#(#FramedBoxSpec |
687 | 228 |
#name: 'framedBox1' |
229 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 145 0) |
|
230 |
#component: |
|
408 | 231 |
#(#SpecCollection |
687 | 232 |
#collection: |
408 | 233 |
#( |
234 |
#(#LabelSpec |
|
687 | 235 |
#name: 'label1' |
236 |
#layout: #(#AlignmentOrigin 107 0 32 0 1 0.5) |
|
237 |
#label: 'Label:' |
|
238 |
#resizeForLabel: true |
|
408 | 239 |
) |
240 |
#(#InputFieldSpec |
|
687 | 241 |
#name: 'labelField' |
242 |
#layout: #(#LayoutFrame 110 0 21 0 15 1.0 43 0) |
|
243 |
#activeHelpKey: #basicsLabel |
|
244 |
#tabable: true |
|
245 |
#model: #label |
|
408 | 246 |
) |
247 |
#(#CheckBoxSpec |
|
687 | 248 |
#name: 'labelIsImage' |
249 |
#layout: #(#LayoutOrigin 107 0 103 0) |
|
250 |
#activeHelpKey: #basicsLabelIsImage |
|
251 |
#tabable: true |
|
252 |
#model: #labelIsImage |
|
253 |
#label: 'Label Is Image' |
|
408 | 254 |
) |
817 | 255 |
#(#LabelSpec |
256 |
#name: 'LabelFont' |
|
257 |
#layout: #(#AlignmentOrigin 107 0 61 0 1 0.5) |
|
258 |
#label: 'Font::' |
|
259 |
#adjust: #left |
|
260 |
#resizeForLabel: true |
|
261 |
) |
|
262 |
#(#FontMenuSpec |
|
263 |
#name: 'fontMenu' |
|
264 |
#layout: #(#LayoutFrame 110 0 49 0 13 1.0 71 0) |
|
265 |
#activeHelpKey: #labelFont |
|
266 |
#model: #style |
|
439 | 267 |
) |
442 | 268 |
#(#PopUpListSpec |
687 | 269 |
#name: 'Alignment' |
270 |
#layout: #(#LayoutFrame 110 0 78 0 15 1.0 100 0) |
|
271 |
#activeHelpKey: #basicsJustification |
|
272 |
#label: 'Alignment' |
|
273 |
#model: #labelAlignment |
|
274 |
#menu: |
|
442 | 275 |
#(#left |
276 |
#right #center |
|
277 |
) |
|
687 | 278 |
#useIndex: false |
442 | 279 |
) |
280 |
#(#LabelSpec |
|
687 | 281 |
#name: 'JustificationLabel' |
282 |
#layout: #(#AlignmentOrigin 107 0 89 0 1 0.5) |
|
283 |
#label: 'Justification:' |
|
284 |
#adjust: #left |
|
285 |
#resizeForLabel: true |
|
442 | 286 |
) |
408 | 287 |
) |
288 |
) |
|
687 | 289 |
#label: 'Header:' |
290 |
#labelPosition: #topLeft |
|
332 | 291 |
) |
292 |
#(#FramedBoxSpec |
|
687 | 293 |
#name: 'typesFrame' |
817 | 294 |
#layout: #(#LayoutFrame 0 0.0 145 0 0 1.0 253 0) |
687 | 295 |
#component: |
332 | 296 |
#(#SpecCollection |
687 | 297 |
#collection: |
332 | 298 |
#( |
299 |
#(#LabelSpec |
|
687 | 300 |
#name: 'rendererLabel' |
301 |
#layout: #(#AlignmentOrigin 107 0 29 0 1 0.5) |
|
302 |
#label: 'Renderer:' |
|
303 |
#resizeForLabel: true |
|
332 | 304 |
) |
305 |
#(#ComboListSpec |
|
687 | 306 |
#name: 'rendererField' |
307 |
#layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0) |
|
308 |
#activeHelpKey: #basicsRenderer |
|
309 |
#tabable: true |
|
310 |
#model: #rendererType |
|
311 |
#comboList: #rendererTypeList |
|
312 |
#useIndex: false |
|
332 | 313 |
) |
314 |
#(#LabelSpec |
|
687 | 315 |
#name: 'editorLabel' |
316 |
#layout: #(#AlignmentOrigin 107 0 55 0 1 0.5) |
|
317 |
#label: 'Editor:' |
|
318 |
#resizeForLabel: true |
|
332 | 319 |
) |
320 |
#(#ComboBoxSpec |
|
687 | 321 |
#name: 'editorField' |
322 |
#layout: #(#LayoutFrame 110 0 44 0 15 1.0 66 0) |
|
323 |
#activeHelpKey: #basicsEditor |
|
324 |
#tabable: true |
|
325 |
#model: #editorType |
|
326 |
#type: #symbolOrNil |
|
327 |
#comboList: #editorTypeList |
|
328 |
#useIndex: false |
|
332 | 329 |
) |
817 | 330 |
#(#LabelSpec |
331 |
#name: 'JustificationC' |
|
332 |
#layout: #(#AlignmentOrigin 107 0 82 0 1 0.5) |
|
333 |
#label: 'Justification:' |
|
334 |
#adjust: #left |
|
335 |
#resizeForLabel: true |
|
336 |
) |
|
337 |
#(#PopUpListSpec |
|
338 |
#name: 'AlignmentC' |
|
339 |
#layout: #(#LayoutFrame 110 0 71 0 15 1.0 93 0) |
|
340 |
#activeHelpKey: #basicsJustification |
|
341 |
#label: 'Alignment' |
|
342 |
#model: #columnAlignment |
|
343 |
#menu: |
|
344 |
#(#left |
|
345 |
#right #center |
|
346 |
) |
|
347 |
#useIndex: false |
|
348 |
) |
|
332 | 349 |
) |
350 |
) |
|
687 | 351 |
#label: 'Cell Type:' |
352 |
#labelPosition: #topLeft |
|
391 | 353 |
) |
354 |
) |
|
355 |
) |
|
356 |
) |
|
357 |
! |
|
358 |
||
408 | 359 |
colorsEditSpec |
332 | 360 |
"this window spec was automatically generated by the ST/X UIPainter" |
361 |
||
362 |
"do not manually edit this - the painter/builder may not be able to |
|
363 |
handle the specification if its corrupted." |
|
364 |
||
365 |
" |
|
408 | 366 |
UIPainter new openOnClass:DataSetBuilder andSelector:#colorsEditSpec |
367 |
DataSetBuilder new openInterface:#colorsEditSpec |
|
332 | 368 |
" |
369 |
||
370 |
<resource: #canvas> |
|
371 |
||
372 |
^ |
|
373 |
||
374 |
#(#FullSpec |
|
687 | 375 |
#window: |
332 | 376 |
#(#WindowSpec |
687 | 377 |
#name: 'DataSet Misc' |
378 |
#layout: #(#LayoutFrame 383 0 282 0 751 0 581 0) |
|
379 |
#label: 'DataSet Misc' |
|
380 |
#min: #(#Point 10 10) |
|
381 |
#max: #(#Point 1280 1024) |
|
382 |
#bounds: #(#Rectangle 383 282 752 582) |
|
383 |
#usePreferredExtent: false |
|
332 | 384 |
) |
687 | 385 |
#component: |
332 | 386 |
#(#SpecCollection |
687 | 387 |
#collection: |
332 | 388 |
#( |
370 | 389 |
#(#FramedBoxSpec |
687 | 390 |
#name: 'ColorsBox' |
391 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 88 0) |
|
392 |
#component: |
|
427 | 393 |
#(#SpecCollection |
687 | 394 |
#collection: |
427 | 395 |
#( |
505 | 396 |
#(#LabelSpec |
687 | 397 |
#name: 'label1' |
398 |
#layout: #(#AlignmentOrigin 107 0 27 0 1 0.5) |
|
399 |
#label: 'Foreground:' |
|
400 |
#adjust: #right |
|
401 |
#resizeForLabel: true |
|
505 | 402 |
) |
427 | 403 |
#(#ColorMenuSpec |
687 | 404 |
#name: 'colorMenu1' |
405 |
#layout: #(#LayoutFrame 110 0 15 0 12 1.0 37 0) |
|
406 |
#activeHelpKey: #colorsForegroundLabelColor |
|
407 |
#model: #labelForegroundColor |
|
408 |
#labelsAreColored: true |
|
427 | 409 |
) |
410 |
#(#LabelSpec |
|
687 | 411 |
#name: 'label2' |
412 |
#layout: #(#AlignmentOrigin 107 0 55 0 1 0.5) |
|
413 |
#label: 'Background:' |
|
414 |
#adjust: #right |
|
415 |
#resizeForLabel: true |
|
427 | 416 |
) |
417 |
#(#ColorMenuSpec |
|
687 | 418 |
#name: 'colorMenu2' |
419 |
#layout: #(#LayoutFrame 110 0 43 0 12 1.0 65 0) |
|
420 |
#activeHelpKey: #colorsBackgroundLabelColor |
|
421 |
#model: #labelBackgroundColor |
|
422 |
#labelsAreColored: false |
|
427 | 423 |
) |
424 |
) |
|
425 |
) |
|
687 | 426 |
#label: 'Label Colors:' |
427 |
#labelPosition: #topLeft |
|
427 | 428 |
) |
429 |
#(#FramedBoxSpec |
|
687 | 430 |
#name: 'defaultColorsBox' |
431 |
#layout: #(#LayoutFrame 0 0.0 88 0 0 1.0 230 0) |
|
432 |
#component: |
|
370 | 433 |
#(#SpecCollection |
687 | 434 |
#collection: |
370 | 435 |
#( |
436 |
#(#LabelSpec |
|
687 | 437 |
#name: 'fgLabel' |
438 |
#layout: #(#AlignmentOrigin 107 0 27 0 1 0.5) |
|
439 |
#label: 'Foreground:' |
|
440 |
#adjust: #right |
|
441 |
#resizeForLabel: true |
|
370 | 442 |
) |
505 | 443 |
#(#ColorMenuSpec |
687 | 444 |
#name: 'fgMenu' |
445 |
#layout: #(#LayoutFrame 110 0 15 0 12 1.0 37 0) |
|
446 |
#activeHelpKey: #colorsForegroundCellColor |
|
447 |
#model: #foregroundColor |
|
448 |
#labelsAreColored: true |
|
505 | 449 |
) |
370 | 450 |
#(#LabelSpec |
687 | 451 |
#name: 'bgLabel' |
452 |
#layout: #(#AlignmentOrigin 107 0 55 0 1 0.5) |
|
453 |
#label: 'Background:' |
|
454 |
#adjust: #right |
|
455 |
#resizeForLabel: true |
|
370 | 456 |
) |
457 |
#(#ColorMenuSpec |
|
687 | 458 |
#name: 'bgMenu' |
459 |
#layout: #(#LayoutFrame 110 0 43 0 12 1.0 65 0) |
|
460 |
#activeHelpKey: #colorsBackgroundCellColor |
|
461 |
#model: #backgroundColor |
|
462 |
#labelsAreColored: false |
|
370 | 463 |
) |
380 | 464 |
#(#LabelSpec |
687 | 465 |
#name: 'fgSelLabel' |
466 |
#layout: #(#AlignmentOrigin 107 0 89 0 1 0.5) |
|
467 |
#label: 'FG-Selector:' |
|
468 |
#adjust: #right |
|
469 |
#resizeForLabel: true |
|
380 | 470 |
) |
471 |
#(#InputFieldSpec |
|
687 | 472 |
#name: 'fgSelField' |
473 |
#layout: #(#LayoutFrame 110 0 78 0 15 1.0 100 0) |
|
474 |
#activeHelpKey: #colorsForegroundSelector |
|
475 |
#tabable: true |
|
476 |
#model: #foregroundSelector |
|
477 |
#type: #symbolOrNil |
|
470 | 478 |
) |
505 | 479 |
#(#LabelSpec |
687 | 480 |
#name: 'bgSelLabel' |
481 |
#layout: #(#AlignmentOrigin 107 0 114 0 1 0.5) |
|
482 |
#label: 'BG-Selector:' |
|
483 |
#adjust: #right |
|
484 |
#resizeForLabel: true |
|
505 | 485 |
) |
470 | 486 |
#(#InputFieldSpec |
687 | 487 |
#name: 'bgSelField' |
488 |
#layout: #(#LayoutFrame 110 0 103 0 15 1.0 125 0) |
|
489 |
#activeHelpKey: #colorsBackgroundSelector |
|
490 |
#tabable: true |
|
491 |
#model: #backgroundSelector |
|
492 |
#type: #symbolOrNil |
|
408 | 493 |
) |
380 | 494 |
) |
495 |
) |
|
687 | 496 |
#label: 'Cell Colors:' |
497 |
#labelPosition: #topLeft |
|
377 | 498 |
) |
332 | 499 |
) |
500 |
) |
|
501 |
) |
|
502 |
! |
|
503 |
||
528 | 504 |
defineClassNameSpec |
505 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
506 |
||
507 |
"do not manually edit this - the painter/builder may not be able to |
|
508 |
handle the specification if its corrupted." |
|
509 |
||
510 |
" |
|
511 |
UIPainter new openOnClass:DataSetBuilder andSelector:#defineClassNameSpec |
|
512 |
DataSetBuilder new openInterface:#defineClassNameSpec |
|
513 |
" |
|
514 |
||
515 |
<resource: #canvas> |
|
516 |
||
517 |
^ |
|
518 |
||
519 |
#(#FullSpec |
|
687 | 520 |
#window: |
528 | 521 |
#(#WindowSpec |
687 | 522 |
#name: 'Data Set Builder' |
523 |
#layout: #(#LayoutFrame 425 0 253 0 751 0 388 0) |
|
524 |
#label: 'Data Set Builder' |
|
525 |
#min: #(#Point 10 10) |
|
526 |
#max: #(#Point 1152 900) |
|
527 |
#bounds: #(#Rectangle 425 253 752 389) |
|
528 |
#usePreferredExtent: false |
|
528 | 529 |
) |
687 | 530 |
#component: |
528 | 531 |
#(#SpecCollection |
687 | 532 |
#collection: |
528 | 533 |
#( |
534 |
#(#FramedBoxSpec |
|
687 | 535 |
#name: 'framedBox1' |
536 |
#layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -34 1.0) |
|
537 |
#label: 'Classes for code' |
|
538 |
#labelPosition: #topLeft |
|
528 | 539 |
) |
540 |
#(#LabelSpec |
|
687 | 541 |
#name: 'classLabel' |
542 |
#layout: #(#AlignmentOrigin 73 0.11 38 0 1 0.5) |
|
543 |
#label: 'Class:' |
|
544 |
#adjust: #right |
|
545 |
#resizeForLabel: true |
|
528 | 546 |
) |
547 |
#(#InputFieldSpec |
|
687 | 548 |
#name: 'classNameInputField' |
549 |
#layout: #(#LayoutFrame 77 0.11 27 0 -16 1.0 49 0) |
|
550 |
#tabable: true |
|
551 |
#model: #classNameChannel |
|
528 | 552 |
) |
553 |
#(#LabelSpec |
|
687 | 554 |
#name: 'superClassLabel' |
555 |
#layout: #(#AlignmentOrigin 73 0.11 65 0 1 0.5) |
|
556 |
#label: 'Superclass:' |
|
557 |
#adjust: #right |
|
558 |
#resizeForLabel: true |
|
528 | 559 |
) |
560 |
#(#InputFieldSpec |
|
687 | 561 |
#name: 'superclassNameInputField' |
562 |
#layout: #(#LayoutFrame 76 0.11 55 0 -16 1.0 77 0) |
|
563 |
#tabable: true |
|
564 |
#model: #superclassNameChannel |
|
528 | 565 |
) |
566 |
#(#UISubSpecification |
|
687 | 567 |
#name: 'SubSpecification' |
568 |
#layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1.0) |
|
569 |
#majorKey: #ToolApplicationModel |
|
570 |
#minorKey: #windowSpecForCommitWithoutChannels |
|
528 | 571 |
) |
572 |
) |
|
573 |
) |
|
574 |
) |
|
575 |
! |
|
576 |
||
370 | 577 |
formatEditSpec |
332 | 578 |
"this window spec was automatically generated by the ST/X UIPainter" |
579 |
||
580 |
"do not manually edit this - the painter/builder may not be able to |
|
581 |
handle the specification if its corrupted." |
|
582 |
||
583 |
" |
|
370 | 584 |
UIPainter new openOnClass:DataSetBuilder andSelector:#formatEditSpec |
585 |
DataSetBuilder new openInterface:#formatEditSpec |
|
586 |
" |
|
587 |
||
588 |
<resource: #canvas> |
|
589 |
||
590 |
^ |
|
591 |
||
592 |
#(#FullSpec |
|
687 | 593 |
#window: |
370 | 594 |
#(#WindowSpec |
687 | 595 |
#name: 'DataSet Details' |
596 |
#layout: #(#LayoutFrame 415 0 266 0 802 0 557 0) |
|
597 |
#label: 'DataSet Details' |
|
598 |
#min: #(#Point 10 10) |
|
599 |
#max: #(#Point 1280 1024) |
|
600 |
#bounds: #(#Rectangle 415 266 803 558) |
|
601 |
#usePreferredExtent: false |
|
370 | 602 |
) |
687 | 603 |
#component: |
370 | 604 |
#(#SpecCollection |
687 | 605 |
#collection: |
370 | 606 |
#( |
408 | 607 |
#(#FramedBoxSpec |
687 | 608 |
#name: 'framedBox1' |
609 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 114 0) |
|
610 |
#component: |
|
408 | 611 |
#(#SpecCollection |
687 | 612 |
#collection: |
408 | 613 |
#( |
614 |
#(#LabelSpec |
|
687 | 615 |
#name: 'typeLabel' |
616 |
#layout: #(#AlignmentOrigin 107 0 29 0 1 0.5) |
|
617 |
#label: 'Input Type:' |
|
618 |
#resizeForLabel: true |
|
408 | 619 |
) |
470 | 620 |
#(#ComboListSpec |
687 | 621 |
#name: 'typeCombo' |
622 |
#layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0) |
|
623 |
#activeHelpKey: #formatInputType |
|
624 |
#tabable: true |
|
625 |
#model: #type |
|
626 |
#comboList: |
|
470 | 627 |
#(#string |
628 |
#password #number |
|
629 |
#numberOrNil #symbolOrNil |
|
630 |
) |
|
687 | 631 |
#useIndex: false |
470 | 632 |
) |
408 | 633 |
#(#LabelSpec |
687 | 634 |
#name: 'sizeLabel' |
635 |
#layout: #(#AlignmentOrigin 107 0 55 0 1 0.5) |
|
636 |
#label: 'Max Size:' |
|
637 |
#resizeForLabel: true |
|
408 | 638 |
) |
639 |
#(#InputFieldSpec |
|
687 | 640 |
#name: 'sizeField' |
641 |
#layout: #(#LayoutFrame 110 0 44 0 15 1.0 66 0) |
|
642 |
#activeHelpKey: #formatMaxSize |
|
643 |
#tabable: true |
|
644 |
#model: #size |
|
645 |
#type: #numberOrNil |
|
408 | 646 |
) |
439 | 647 |
#(#LabelSpec |
687 | 648 |
#name: 'formatLabel' |
649 |
#layout: #(#AlignmentOrigin 107 0 80 0 1 0.5) |
|
650 |
#label: 'Text Format:' |
|
651 |
#resizeForLabel: true |
|
439 | 652 |
) |
470 | 653 |
#(#InputFieldSpec |
687 | 654 |
#name: 'formatField' |
655 |
#layout: #(#LayoutFrame 110 0 69 0 15 1.0 91 0) |
|
656 |
#activeHelpKey: #formatTextFormat |
|
657 |
#tabable: true |
|
658 |
#model: #formatString |
|
470 | 659 |
) |
408 | 660 |
) |
661 |
) |
|
687 | 662 |
#label: 'Input Format' |
663 |
#labelPosition: #topLeft |
|
370 | 664 |
) |
665 |
) |
|
666 |
) |
|
667 |
) |
|
668 |
! |
|
669 |
||
408 | 670 |
frameEditSpec |
391 | 671 |
"this window spec was automatically generated by the ST/X UIPainter" |
672 |
||
673 |
"do not manually edit this - the painter/builder may not be able to |
|
674 |
handle the specification if its corrupted." |
|
675 |
||
676 |
" |
|
408 | 677 |
UIPainter new openOnClass:DataSetBuilder andSelector:#frameEditSpec |
678 |
DataSetBuilder new openInterface:#frameEditSpec |
|
391 | 679 |
" |
680 |
||
681 |
<resource: #canvas> |
|
682 |
||
683 |
^ |
|
684 |
||
685 |
#(#FullSpec |
|
687 | 686 |
#window: |
391 | 687 |
#(#WindowSpec |
687 | 688 |
#name: 'DataSet Dimension' |
689 |
#layout: #(#LayoutFrame 354 0 262 0 644 0 475 0) |
|
690 |
#label: 'DataSet Dimension' |
|
691 |
#min: #(#Point 10 10) |
|
692 |
#max: #(#Point 1280 1024) |
|
693 |
#bounds: #(#Rectangle 354 262 645 476) |
|
694 |
#usePreferredExtent: false |
|
391 | 695 |
) |
687 | 696 |
#component: |
391 | 697 |
#(#SpecCollection |
687 | 698 |
#collection: |
391 | 699 |
#( |
700 |
#(#FramedBoxSpec |
|
687 | 701 |
#name: 'separatorBox' |
702 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 86 0) |
|
703 |
#component: |
|
391 | 704 |
#(#SpecCollection |
687 | 705 |
#collection: |
391 | 706 |
#( |
408 | 707 |
#(#CheckBoxSpec |
687 | 708 |
#name: 'showRowSeparator' |
709 |
#layout: #(#LayoutFrame 18 0 19 0 194 0 42 0) |
|
710 |
#activeHelpKey: #frameShowRowSeparator |
|
711 |
#tabable: true |
|
712 |
#model: #showRowSeparator |
|
713 |
#label: 'Show Row-Separator' |
|
408 | 714 |
) |
715 |
#(#CheckBoxSpec |
|
687 | 716 |
#name: 'showColSeparator' |
717 |
#layout: #(#LayoutFrame 18 0 45 0 194 0 68 0) |
|
718 |
#activeHelpKey: #frameShowColumnSeparator |
|
719 |
#tabable: true |
|
720 |
#model: #showColSeparator |
|
721 |
#label: 'Show Column-Separator' |
|
408 | 722 |
) |
723 |
) |
|
724 |
) |
|
687 | 725 |
#label: 'Separators' |
726 |
#labelPosition: #topLeft |
|
408 | 727 |
) |
728 |
#(#FramedBoxSpec |
|
687 | 729 |
#name: 'framedBox1' |
730 |
#layout: #(#LayoutFrame 0 0.0 86 0 0 1.0 198 0) |
|
731 |
#component: |
|
408 | 732 |
#(#SpecCollection |
687 | 733 |
#collection: |
408 | 734 |
#( |
391 | 735 |
#(#LabelSpec |
687 | 736 |
#name: 'widthLabel' |
737 |
#layout: #(#AlignmentOrigin 107 0.0 28 0 1 0.5) |
|
738 |
#label: 'Column Width:' |
|
739 |
#adjust: #right |
|
740 |
#resizeForLabel: true |
|
391 | 741 |
) |
470 | 742 |
#(#InputFieldSpec |
687 | 743 |
#name: 'widthField' |
744 |
#layout: #(#LayoutFrame 110 0 17 0 15 1.0 39 0) |
|
745 |
#activeHelpKey: #frameColumnWidth |
|
746 |
#tabable: true |
|
747 |
#model: #width |
|
748 |
#type: #numberOrNil |
|
470 | 749 |
) |
391 | 750 |
#(#LabelSpec |
687 | 751 |
#name: 'minWidthLabel' |
752 |
#layout: #(#AlignmentOrigin 107 0.0 53 0 1 0.5) |
|
753 |
#label: 'Min Width:' |
|
754 |
#adjust: #right |
|
755 |
#resizeForLabel: true |
|
391 | 756 |
) |
408 | 757 |
#(#InputFieldSpec |
687 | 758 |
#name: 'minWidthField' |
759 |
#layout: #(#LayoutFrame 110 0 42 0 15 1.0 64 0) |
|
760 |
#activeHelpKey: #frameMinWidth |
|
761 |
#tabable: true |
|
762 |
#model: #minWidth |
|
763 |
#type: #numberOrNil |
|
408 | 764 |
) |
765 |
#(#LabelSpec |
|
687 | 766 |
#name: 'heightLabel' |
767 |
#layout: #(#AlignmentOrigin 107 0.0 84 0 1 0.5) |
|
768 |
#label: 'Row Height:' |
|
769 |
#adjust: #right |
|
770 |
#resizeForLabel: true |
|
408 | 771 |
) |
772 |
#(#InputFieldSpec |
|
687 | 773 |
#name: 'heightField' |
774 |
#layout: #(#LayoutFrame 110 0 73 0 15 1.0 95 0) |
|
775 |
#activeHelpKey: #frameRowHeight |
|
776 |
#tabable: true |
|
777 |
#model: #height |
|
778 |
#type: #numberOrNil |
|
391 | 779 |
) |
780 |
) |
|
781 |
) |
|
687 | 782 |
#label: 'Dimensions:' |
783 |
#labelPosition: #topLeft |
|
391 | 784 |
) |
785 |
) |
|
786 |
) |
|
787 |
) |
|
788 |
! |
|
789 |
||
408 | 790 |
selectionEditSpec |
370 | 791 |
"this window spec was automatically generated by the ST/X UIPainter" |
792 |
||
793 |
"do not manually edit this - the painter/builder may not be able to |
|
794 |
handle the specification if its corrupted." |
|
795 |
||
796 |
" |
|
408 | 797 |
UIPainter new openOnClass:DataSetBuilder andSelector:#selectionEditSpec |
798 |
DataSetBuilder new openInterface:#selectionEditSpec |
|
332 | 799 |
" |
800 |
||
801 |
<resource: #canvas> |
|
802 |
||
803 |
^ |
|
804 |
||
805 |
#(#FullSpec |
|
687 | 806 |
#window: |
332 | 807 |
#(#WindowSpec |
687 | 808 |
#name: 'DataSet Basic' |
809 |
#layout: #(#LayoutFrame 411 0 287 0 699 0 542 0) |
|
810 |
#label: 'DataSet Basic' |
|
811 |
#min: #(#Point 10 10) |
|
812 |
#max: #(#Point 1280 1024) |
|
813 |
#bounds: #(#Rectangle 411 287 700 543) |
|
814 |
#usePreferredExtent: false |
|
408 | 815 |
) |
687 | 816 |
#component: |
408 | 817 |
#(#SpecCollection |
687 | 818 |
#collection: |
408 | 819 |
#( |
820 |
#(#FramedBoxSpec |
|
687 | 821 |
#name: 'framedBox1' |
822 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 85 0) |
|
823 |
#component: |
|
408 | 824 |
#(#SpecCollection |
687 | 825 |
#collection: |
408 | 826 |
#( |
827 |
#(#LabelSpec |
|
687 | 828 |
#name: 'ActionLabel' |
829 |
#layout: #(#AlignmentOrigin 107 0 28 0 1 0.5) |
|
830 |
#label: 'Selector:' |
|
831 |
#adjust: #left |
|
832 |
#resizeForLabel: true |
|
408 | 833 |
) |
834 |
#(#InputFieldSpec |
|
687 | 835 |
#name: 'ActionSelector' |
836 |
#layout: #(#LayoutFrame 110 0 17 0 15 1.0 39 0) |
|
837 |
#activeHelpKey: #selectionLabelClickSelector |
|
838 |
#tabable: true |
|
839 |
#model: #labelActionSelector |
|
840 |
#type: #symbolOrNil |
|
408 | 841 |
) |
427 | 842 |
#(#LabelSpec |
687 | 843 |
#name: 'ArgumentLabel' |
844 |
#layout: #(#AlignmentOrigin 107 0 53 0 1 0.5) |
|
845 |
#label: 'Argument:' |
|
846 |
#adjust: #left |
|
847 |
#resizeForLabel: true |
|
427 | 848 |
) |
849 |
#(#InputFieldSpec |
|
687 | 850 |
#name: 'ArgumentValue' |
851 |
#layout: #(#LayoutFrame 110 0 42 0 15 1.0 64 0) |
|
852 |
#activeHelpKey: #selectionLabelSelectorArgument |
|
853 |
#tabable: true |
|
854 |
#model: #labelActionArgument |
|
855 |
#type: #string |
|
427 | 856 |
) |
408 | 857 |
) |
858 |
) |
|
687 | 859 |
#label: 'Label Select Action:' |
860 |
#labelPosition: #topLeft |
|
408 | 861 |
) |
862 |
#(#FramedBoxSpec |
|
687 | 863 |
#name: 'framedBox2' |
864 |
#layout: #(#LayoutFrame 0 0.0 85 0 0 1.0 166 0) |
|
865 |
#component: |
|
470 | 866 |
#(#SpecCollection |
687 | 867 |
#collection: |
470 | 868 |
#( |
869 |
#(#CheckBoxSpec |
|
687 | 870 |
#name: 'canSelect' |
871 |
#layout: #(#Point 107 17) |
|
872 |
#activeHelpKey: #selectionIsSelectable |
|
873 |
#tabable: true |
|
874 |
#model: #canSelect |
|
875 |
#label: 'Is Selectable' |
|
470 | 876 |
) |
877 |
#(#LabelSpec |
|
687 | 878 |
#name: 'selectorLabel' |
879 |
#layout: #(#AlignmentOrigin 107 0 53 0 1 0.5) |
|
880 |
#label: 'Selector:' |
|
881 |
#adjust: #right |
|
882 |
#resizeForLabel: true |
|
470 | 883 |
) |
884 |
#(#InputFieldSpec |
|
687 | 885 |
#name: 'selectSelector' |
886 |
#layout: #(#LayoutFrame 110 0 42 0 15 1.0 64 0) |
|
887 |
#activeHelpKey: #selectionCellClickSelector |
|
888 |
#tabable: true |
|
889 |
#model: #selectSelector |
|
890 |
#type: #symbolOrNil |
|
470 | 891 |
) |
892 |
) |
|
893 |
) |
|
687 | 894 |
#label: 'Cell Selection:' |
895 |
#labelPosition: #topLeft |
|
470 | 896 |
) |
897 |
#(#FramedBoxSpec |
|
687 | 898 |
#name: 'framedBox3' |
899 |
#layout: #(#LayoutFrame 0 0.0 166 0 0 1.0 220 0) |
|
900 |
#component: |
|
408 | 901 |
#(#SpecCollection |
687 | 902 |
#collection: |
408 | 903 |
#( |
904 |
#(#LabelSpec |
|
687 | 905 |
#name: 'doubleLabel' |
906 |
#layout: #(#AlignmentOrigin 107 0 27 0 1 0.5) |
|
907 |
#label: 'Selector:' |
|
908 |
#adjust: #right |
|
909 |
#resizeForLabel: true |
|
408 | 910 |
) |
911 |
#(#InputFieldSpec |
|
687 | 912 |
#name: 'doubleClicked' |
913 |
#layout: #(#LayoutFrame 110 0 16 0 15 1.0 38 0) |
|
914 |
#activeHelpKey: #selectionCellDoubleClickSelector |
|
915 |
#tabable: true |
|
916 |
#model: #doubleClickedSelector |
|
917 |
#type: #symbolOrNil |
|
408 | 918 |
) |
919 |
) |
|
920 |
) |
|
687 | 921 |
#label: 'Cell Double Click:' |
922 |
#labelPosition: #topLeft |
|
408 | 923 |
) |
924 |
) |
|
925 |
) |
|
926 |
) |
|
927 |
! |
|
928 |
||
528 | 929 |
slices |
930 |
^#( |
|
931 |
(Basics basicsEditSpec) |
|
932 |
(Values valuesEditSpec) |
|
933 |
(Format formatEditSpec) |
|
934 |
(Selection selectionEditSpec) |
|
935 |
(Frame frameEditSpec) |
|
936 |
(Colors colorsEditSpec) |
|
937 |
) |
|
938 |
! |
|
939 |
||
408 | 940 |
valuesEditSpec |
941 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
942 |
||
943 |
"do not manually edit this - the painter/builder may not be able to |
|
944 |
handle the specification if its corrupted." |
|
945 |
||
946 |
" |
|
947 |
UIPainter new openOnClass:DataSetBuilder andSelector:#valuesEditSpec |
|
948 |
DataSetBuilder new openInterface:#valuesEditSpec |
|
949 |
" |
|
950 |
||
951 |
<resource: #canvas> |
|
952 |
||
953 |
^ |
|
954 |
||
955 |
#(#FullSpec |
|
687 | 956 |
#window: |
408 | 957 |
#(#WindowSpec |
687 | 958 |
#name: 'DataSet Basic' |
959 |
#layout: #(#LayoutFrame 385 0 286 0 680 0 591 0) |
|
960 |
#label: 'DataSet Basic' |
|
961 |
#min: #(#Point 10 10) |
|
962 |
#max: #(#Point 1280 1024) |
|
963 |
#bounds: #(#Rectangle 385 286 681 592) |
|
964 |
#usePreferredExtent: false |
|
332 | 965 |
) |
687 | 966 |
#component: |
332 | 967 |
#(#SpecCollection |
687 | 968 |
#collection: |
332 | 969 |
#( |
370 | 970 |
#(#FramedBoxSpec |
687 | 971 |
#name: 'valuesBox' |
972 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 110 0) |
|
973 |
#component: |
|
370 | 974 |
#(#SpecCollection |
687 | 975 |
#collection: |
370 | 976 |
#( |
977 |
#(#LabelSpec |
|
687 | 978 |
#name: 'readLabel' |
979 |
#layout: #(#AlignmentOrigin 107 0 29 0 1 0.5) |
|
980 |
#label: 'Read:' |
|
981 |
#adjust: #right |
|
982 |
#resizeForLabel: true |
|
370 | 983 |
) |
984 |
#(#InputFieldSpec |
|
687 | 985 |
#name: 'readSelector' |
986 |
#layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0) |
|
987 |
#activeHelpKey: #valuesReadSelector |
|
988 |
#tabable: true |
|
989 |
#model: #readSelector |
|
990 |
#type: #symbolOrNil |
|
370 | 991 |
) |
470 | 992 |
#(#LabelSpec |
687 | 993 |
#name: 'writeLabel' |
994 |
#layout: #(#AlignmentOrigin 107 0 54 0 1 0.5) |
|
995 |
#label: 'Write:' |
|
996 |
#adjust: #right |
|
997 |
#resizeForLabel: true |
|
470 | 998 |
) |
379 | 999 |
#(#InputFieldSpec |
687 | 1000 |
#name: 'writeSelector' |
1001 |
#layout: #(#LayoutFrame 110 0 43 0 15 1.0 65 0) |
|
1002 |
#activeHelpKey: #valuesWriteSelector |
|
1003 |
#tabable: true |
|
1004 |
#model: #writeSelector |
|
1005 |
#type: #symbolOrNil |
|
379 | 1006 |
) |
370 | 1007 |
#(#LabelSpec |
687 | 1008 |
#name: 'printLabel' |
1009 |
#layout: #(#AlignmentOrigin 107 0 79 0 1 0.5) |
|
1010 |
#label: 'Print:' |
|
1011 |
#adjust: #right |
|
1012 |
#resizeForLabel: true |
|
370 | 1013 |
) |
1014 |
#(#InputFieldSpec |
|
687 | 1015 |
#name: 'printSelector' |
1016 |
#layout: #(#LayoutFrame 110 0 68 0 15 1.0 90 0) |
|
1017 |
#activeHelpKey: #valuesPrintSelector |
|
1018 |
#tabable: true |
|
1019 |
#model: #printSelector |
|
1020 |
#type: #symbolOrNil |
|
370 | 1021 |
) |
1022 |
) |
|
1023 |
) |
|
687 | 1024 |
#label: 'Value Selectors:' |
1025 |
#labelPosition: #topLeft |
|
332 | 1026 |
) |
370 | 1027 |
#(#FramedBoxSpec |
687 | 1028 |
#name: 'menusBox' |
1029 |
#layout: #(#LayoutFrame 0 0.0 110 0 0 1.0 167 0) |
|
1030 |
#component: |
|
370 | 1031 |
#(#SpecCollection |
687 | 1032 |
#collection: |
370 | 1033 |
#( |
1034 |
#(#LabelSpec |
|
687 | 1035 |
#name: 'menuLabel' |
1036 |
#layout: #(#AlignmentOrigin 107 0 29 0 1 0.5) |
|
1037 |
#label: 'Selector:' |
|
1038 |
#adjust: #right |
|
1039 |
#resizeForLabel: true |
|
370 | 1040 |
) |
1041 |
#(#InputFieldSpec |
|
687 | 1042 |
#name: 'menuSelector' |
1043 |
#layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0) |
|
1044 |
#activeHelpKey: #valuesMenuSelector |
|
1045 |
#tabable: true |
|
1046 |
#model: #menu |
|
1047 |
#type: #symbolOrNil |
|
370 | 1048 |
) |
597 | 1049 |
) |
1050 |
) |
|
687 | 1051 |
#label: 'Menu:' |
1052 |
#labelPosition: #topLeft |
|
597 | 1053 |
) |
1054 |
#(#FramedBoxSpec |
|
687 | 1055 |
#name: 'framedBox1' |
1056 |
#layout: #(#LayoutFrame 1 0.0 167 0 1 1.0 225 0) |
|
1057 |
#component: |
|
597 | 1058 |
#(#SpecCollection |
687 | 1059 |
#collection: |
597 | 1060 |
#( |
370 | 1061 |
#(#LabelSpec |
687 | 1062 |
#name: 'label2' |
1063 |
#layout: #(#AlignmentOrigin 107 0 29 0 1 0.5) |
|
1064 |
#activeHelpKey: #valuesChoiceSelector |
|
1065 |
#label: 'Selector:' |
|
1066 |
#adjust: #right |
|
1067 |
#resizeForLabel: true |
|
370 | 1068 |
) |
1069 |
#(#InputFieldSpec |
|
687 | 1070 |
#name: 'inputField2' |
1071 |
#layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0) |
|
1072 |
#activeHelpKey: #valuesChoiceSelector |
|
1073 |
#tabable: true |
|
1074 |
#model: #choices |
|
1075 |
#type: #symbolOrNil |
|
370 | 1076 |
) |
1077 |
) |
|
1078 |
) |
|
687 | 1079 |
#label: 'List Choice:' |
1080 |
#labelPosition: #topLeft |
|
391 | 1081 |
) |
332 | 1082 |
) |
1083 |
) |
|
1084 |
) |
|
1085 |
! |
|
1086 |
||
1087 |
windowSpec |
|
817 | 1088 |
"This resource specification was automatically generated |
1089 |
by the UIPainter of ST/X." |
|
332 | 1090 |
|
817 | 1091 |
"Do not manually edit this!! If it is corrupted, |
1092 |
the UIPainter may not be able to read the specification." |
|
332 | 1093 |
|
1094 |
" |
|
1095 |
UIPainter new openOnClass:DataSetBuilder andSelector:#windowSpec |
|
1096 |
DataSetBuilder new openInterface:#windowSpec |
|
817 | 1097 |
DataSetBuilder open |
332 | 1098 |
" |
1099 |
||
1100 |
<resource: #canvas> |
|
1101 |
||
1102 |
^ |
|
1103 |
||
1104 |
#(#FullSpec |
|
687 | 1105 |
#window: |
332 | 1106 |
#(#WindowSpec |
687 | 1107 |
#name: 'Data Set Builder' |
818 | 1108 |
#layout: #(#LayoutFrame 487 0 189 0 1031 0 690 0) |
687 | 1109 |
#label: 'Data Set Builder' |
1110 |
#min: #(#Point 10 10) |
|
1111 |
#max: #(#Point 1152 900) |
|
818 | 1112 |
#bounds: #(#Rectangle 487 189 1032 691) |
687 | 1113 |
#menu: #menu |
1114 |
#usePreferredExtent: false |
|
332 | 1115 |
) |
687 | 1116 |
#component: |
332 | 1117 |
#(#SpecCollection |
687 | 1118 |
#collection: |
332 | 1119 |
#( |
818 | 1120 |
#(#ViewSpec |
1121 |
#name: 'Box1' |
|
1122 |
#layout: #(#LayoutFrame 0 0.0 100 0.0 0 1.0 0 1.0) |
|
687 | 1123 |
#component: |
332 | 1124 |
#(#SpecCollection |
687 | 1125 |
#collection: |
332 | 1126 |
#( |
818 | 1127 |
#(#MenuPanelSpec |
1128 |
#name: 'menuToolbarView' |
|
1129 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 32 0) |
|
1130 |
#menu: #menuToolbar |
|
1131 |
) |
|
1132 |
#(#VariableHorizontalPanelSpec |
|
1133 |
#name: 'VariablePanel' |
|
1134 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
687 | 1135 |
#component: |
332 | 1136 |
#(#SpecCollection |
687 | 1137 |
#collection: |
332 | 1138 |
#( |
818 | 1139 |
#(#ViewSpec |
1140 |
#name: 'labelsView' |
|
1141 |
#component: |
|
1142 |
#(#SpecCollection |
|
1143 |
#collection: |
|
1144 |
#( |
|
1145 |
#(#SequenceViewSpec |
|
1146 |
#name: 'labelAndColumns' |
|
1147 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
1148 |
#model: #selectedColumnModel |
|
1149 |
#menu: #menuEdit |
|
1150 |
#hasHorizontalScrollBar: true |
|
1151 |
#hasVerticalScrollBar: true |
|
1152 |
#miniScrollerHorizontal: true |
|
1153 |
#useIndex: true |
|
1154 |
#sequenceList: #seqList |
|
1155 |
) |
|
1156 |
) |
|
1157 |
) |
|
1158 |
) |
|
1159 |
#(#ViewSpec |
|
1160 |
#name: 'specView' |
|
1161 |
#component: |
|
1162 |
#(#SpecCollection |
|
1163 |
#collection: |
|
1164 |
#( |
|
1165 |
#(#TabViewSpec |
|
1166 |
#name: 'tabView' |
|
1167 |
#layout: #(#LayoutFrame 1 0.0 0 0 0 1.0 35 0) |
|
1168 |
#model: #tabModel |
|
1169 |
#menu: #tabList |
|
1170 |
#useIndex: true |
|
1171 |
) |
|
1172 |
#(#SubCanvasSpec |
|
1173 |
#name: 'specCanvas' |
|
1174 |
#layout: #(#LayoutFrame 1 0.0 35 0.0 0 1.0 -30 1.0) |
|
1175 |
#specHolder: #specChannel |
|
1176 |
) |
|
1177 |
#(#UISubSpecification |
|
1178 |
#name: 'SubSpecification' |
|
1179 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
|
1180 |
#majorKey: #ToolApplicationModel |
|
1181 |
#minorKey: #windowSpecForCommit |
|
1182 |
) |
|
1183 |
) |
|
1184 |
) |
|
1185 |
#level: -1 |
|
332 | 1186 |
) |
1187 |
) |
|
1188 |
) |
|
818 | 1189 |
#handles: #(#Any 0.346072 1.0) |
332 | 1190 |
) |
818 | 1191 |
#(#UISubSpecification |
1192 |
#name: 'infoBarSubSpec' |
|
1193 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
1194 |
#majorKey: #ToolApplicationModel |
|
1195 |
#minorKey: #windowSpecForInfoBar |
|
332 | 1196 |
) |
1197 |
) |
|
1198 |
) |
|
1199 |
) |
|
818 | 1200 |
#(#FramedBoxSpec |
1201 |
#name: 'ColumnFrame' |
|
1202 |
#layout: #(#LayoutFrame 0 0.0 5 0.0 0 1.0 100 0) |
|
1203 |
#component: |
|
1204 |
#(#SpecCollection |
|
1205 |
#collection: |
|
1206 |
#( |
|
1207 |
#(#DataSetSpec |
|
1208 |
#name: 'columnView' |
|
1209 |
#layout: #(#LayoutFrame 14 0.0 18 0.0 14 1.0 14 1.0) |
|
1210 |
#hasHorizontalScrollBar: true |
|
1211 |
#hasVerticalScrollBar: false |
|
1212 |
#miniScrollerHorizontal: true |
|
1213 |
#rowClassName: 'CodingExamples_GUI::GUIDemoDataSetView::Row' |
|
1214 |
#useIndex: false |
|
1215 |
#has3Dsepartors: true |
|
1216 |
) |
|
1217 |
) |
|
1218 |
) |
|
1219 |
#label: 'Table Columns' |
|
1220 |
#labelPosition: #topLeft |
|
408 | 1221 |
) |
332 | 1222 |
) |
1223 |
) |
|
1224 |
) |
|
1225 |
! ! |
|
1226 |
||
1227 |
!DataSetBuilder class methodsFor:'menu specs'! |
|
1228 |
||
408 | 1229 |
menu |
818 | 1230 |
"This resource specification was automatically generated |
1231 |
by the MenuEditor of ST/X." |
|
332 | 1232 |
|
818 | 1233 |
"Do not manually edit this!! If it is corrupted, |
1234 |
the MenuEditor may not be able to read the specification." |
|
332 | 1235 |
|
1236 |
" |
|
408 | 1237 |
MenuEditor new openOnClass:DataSetBuilder andSelector:#menu |
1238 |
(Menu new fromLiteralArrayEncoding:(DataSetBuilder menu)) startUp |
|
332 | 1239 |
" |
1240 |
||
1241 |
<resource: #menu> |
|
1242 |
||
1243 |
^ |
|
1244 |
||
1245 |
#(#Menu |
|
1246 |
||
1247 |
#( |
|
1248 |
#(#MenuItem |
|
818 | 1249 |
#label: 'About' |
1250 |
#accessCharacterPosition: 1 |
|
1251 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
1252 |
#submenuChannel: #menuAbout |
|
408 | 1253 |
) |
1254 |
#(#MenuItem |
|
818 | 1255 |
#label: 'File' |
1256 |
#activeHelpKey: #file |
|
1257 |
#submenu: |
|
332 | 1258 |
#(#Menu |
1259 |
||
1260 |
#( |
|
1261 |
#(#MenuItem |
|
818 | 1262 |
#label: 'New' |
1263 |
#value: #doNew |
|
1264 |
#activeHelpKey: #fileNew |
|
1265 |
) |
|
1266 |
#(#MenuItem |
|
1267 |
#label: '-' |
|
408 | 1268 |
) |
1269 |
#(#MenuItem |
|
818 | 1270 |
#label: 'Load...' |
1271 |
#translateLabel: true |
|
1272 |
#value: #doLoad |
|
1273 |
#activeHelpKey: #fileLoad |
|
408 | 1274 |
) |
1275 |
#(#MenuItem |
|
818 | 1276 |
#label: '-' |
1277 |
) |
|
1278 |
#(#MenuItem |
|
1279 |
#label: 'Save' |
|
1280 |
#value: #doSave |
|
1281 |
#activeHelpKey: #fileSave |
|
408 | 1282 |
) |
1283 |
#(#MenuItem |
|
818 | 1284 |
#label: 'Save As...' |
1285 |
#value: #doSaveAs |
|
1286 |
#activeHelpKey: #fileSaveAs |
|
1287 |
) |
|
1288 |
#(#MenuItem |
|
1289 |
#label: '-' |
|
1290 |
) |
|
1291 |
#(#MenuItem |
|
1292 |
#label: 'Pick Columns...' |
|
1293 |
#value: #doPickColumns |
|
408 | 1294 |
) |
1295 |
#(#MenuItem |
|
818 | 1296 |
#label: '-' |
1297 |
) |
|
1298 |
#(#MenuItem |
|
1299 |
#label: 'Browse Class' |
|
1300 |
#value: #doBrowseClass |
|
1301 |
#activeHelpKey: #fileBrowseClass |
|
408 | 1302 |
) |
1303 |
#(#MenuItem |
|
818 | 1304 |
#label: '-' |
1305 |
) |
|
1306 |
#(#MenuItem |
|
1307 |
#label: 'Exit' |
|
1308 |
#translateLabel: true |
|
1309 |
#value: #closeRequest |
|
1310 |
#activeHelpKey: #fileExit |
|
332 | 1311 |
) |
1312 |
) nil |
|
1313 |
nil |
|
1314 |
) |
|
1315 |
) |
|
1316 |
#(#MenuItem |
|
818 | 1317 |
#label: 'Edit' |
1318 |
#activeHelpKey: #edit |
|
1319 |
#submenuChannel: #menuEdit |
|
332 | 1320 |
) |
521 | 1321 |
#(#MenuItem |
818 | 1322 |
#label: 'Add' |
1323 |
#submenu: |
|
521 | 1324 |
#(#Menu |
1325 |
||
1326 |
#( |
|
1327 |
#(#MenuItem |
|
818 | 1328 |
#label: 'Column' |
1329 |
#value: #doCreateColumn |
|
1330 |
#activeHelpKey: #addColumn |
|
1331 |
#enabled: #columnIsNotEditing |
|
1332 |
#labelImage: #(#ResourceRetriever nil #newColumnIcon) |
|
521 | 1333 |
) |
1334 |
) nil |
|
1335 |
nil |
|
1336 |
) |
|
1337 |
) |
|
1338 |
#(#MenuItem |
|
818 | 1339 |
#label: 'Generate' |
1340 |
#activeHelpKey: #file |
|
1341 |
#submenu: |
|
1342 |
#(#Menu |
|
1343 |
||
1344 |
#( |
|
1345 |
#(#MenuItem |
|
1346 |
#label: 'Define Row Class...' |
|
1347 |
#value: #doDefineRowClass |
|
1348 |
#activeHelpKey: #fileDefineClass |
|
1349 |
) |
|
1350 |
#(#MenuItem |
|
1351 |
#label: 'Browse Row Class' |
|
1352 |
#value: #doBrowseRowClass |
|
1353 |
) |
|
1354 |
#(#MenuItem |
|
1355 |
#label: '-' |
|
1356 |
) |
|
1357 |
#(#MenuItem |
|
1358 |
#label: 'Generate Code' |
|
1359 |
#value: #doGenerateCode |
|
1360 |
) |
|
1361 |
) nil |
|
1362 |
nil |
|
1363 |
) |
|
1364 |
) |
|
1365 |
#(#MenuItem |
|
1366 |
#label: 'History' |
|
1367 |
#activeHelpKey: #history |
|
1368 |
#submenuChannel: #menuHistory |
|
1369 |
) |
|
1370 |
#(#MenuItem |
|
1371 |
#label: 'Help' |
|
1372 |
#startGroup: #right |
|
1373 |
#submenu: |
|
1374 |
#(#Menu |
|
1375 |
||
1376 |
#( |
|
1377 |
#(#MenuItem |
|
1378 |
#label: 'Documentation' |
|
1379 |
#value: #openHTMLDocument: |
|
1380 |
#activeHelpKey: #helpTutorial |
|
1381 |
#argument: 'tools/uipainter/DataSetBuilder.html' |
|
1382 |
) |
|
1383 |
#(#MenuItem |
|
1384 |
#label: '-' |
|
1385 |
) |
|
1386 |
#(#MenuItem |
|
1387 |
#label: 'Help Tool' |
|
1388 |
#value: #openHTMLDocument: |
|
1389 |
#activeHelpKey: #helpHelpTool |
|
1390 |
#argument: 'tools/uipainter/HelpTool.html' |
|
1391 |
) |
|
1392 |
#(#MenuItem |
|
1393 |
#label: '-' |
|
1394 |
) |
|
1395 |
#(#MenuItem |
|
1396 |
#label: 'Show Help Texts' |
|
1397 |
#activeHelpKey: #helpShowHelp |
|
1398 |
#indication: #showHelp: |
|
1399 |
) |
|
1400 |
) nil |
|
1401 |
nil |
|
1402 |
) |
|
521 | 1403 |
) |
332 | 1404 |
) nil |
1405 |
nil |
|
1406 |
) |
|
1407 |
! |
|
1408 |
||
408 | 1409 |
menuEdit |
332 | 1410 |
"this window spec was automatically generated by the ST/X MenuEditor" |
1411 |
||
1412 |
"do not manually edit this - the builder may not be able to |
|
1413 |
handle the specification if its corrupted." |
|
1414 |
||
1415 |
" |
|
408 | 1416 |
MenuEditor new openOnClass:DataSetBuilder andSelector:#menuEdit |
1417 |
(Menu new fromLiteralArrayEncoding:(DataSetBuilder menuEdit)) startUp |
|
1418 |
" |
|
1419 |
||
1420 |
<resource: #menu> |
|
1421 |
||
1422 |
^ |
|
1423 |
||
1424 |
#(#Menu |
|
1425 |
||
1426 |
#( |
|
1427 |
#(#MenuItem |
|
1428 |
#'label:' 'Cut' |
|
1429 |
#'value:' #doCutColumn |
|
550 | 1430 |
#'activeHelpKey:' #editCut |
408 | 1431 |
#'enabled:' #isColumnSelected |
1432 |
) |
|
1433 |
#(#MenuItem |
|
1434 |
#'label:' 'Copy' |
|
1435 |
#'value:' #doCopyColumn |
|
550 | 1436 |
#'activeHelpKey:' #editCopy |
408 | 1437 |
#'enabled:' #isColumnSelected |
1438 |
) |
|
1439 |
#(#MenuItem |
|
1440 |
#'label:' 'Paste' |
|
1441 |
#'value:' #doPasteColumn |
|
550 | 1442 |
#'activeHelpKey:' #editPaste |
408 | 1443 |
#'enabled:' #valueOfHavingClipboard |
1444 |
) |
|
1445 |
#(#MenuItem |
|
1446 |
#'label:' '-' |
|
1447 |
) |
|
1448 |
#(#MenuItem |
|
521 | 1449 |
#'label:' 'Move Up' |
408 | 1450 |
#'value:' #'doMoveColumn:' |
550 | 1451 |
#'activeHelpKey:' #editMoveUp |
408 | 1452 |
#'enabled:' #isColumnSelected |
1453 |
#'argument:' #up |
|
521 | 1454 |
#'labelImage:' #(#ResourceRetriever #DataSetBuilder #upIcon 'Move Up') |
408 | 1455 |
) |
1456 |
#(#MenuItem |
|
521 | 1457 |
#'label:' 'Move Down' |
408 | 1458 |
#'value:' #'doMoveColumn:' |
550 | 1459 |
#'activeHelpKey:' #editMoveDown |
408 | 1460 |
#'enabled:' #isColumnSelected |
1461 |
#'argument:' #down |
|
521 | 1462 |
#'labelImage:' #(#ResourceRetriever #DataSetBuilder #downIcon 'Move Down') |
408 | 1463 |
) |
1464 |
) nil |
|
1465 |
nil |
|
1466 |
) |
|
1467 |
! |
|
1468 |
||
1469 |
menuToolbar |
|
1470 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1471 |
||
1472 |
"do not manually edit this - the builder may not be able to |
|
1473 |
handle the specification if its corrupted." |
|
1474 |
||
1475 |
" |
|
1476 |
MenuEditor new openOnClass:DataSetBuilder andSelector:#menuToolbar |
|
1477 |
(Menu new fromLiteralArrayEncoding:(DataSetBuilder menuToolbar)) startUp |
|
332 | 1478 |
" |
1479 |
||
1480 |
<resource: #menu> |
|
1481 |
||
1482 |
^ |
|
1483 |
||
1484 |
#(#Menu |
|
1485 |
||
1486 |
#( |
|
1487 |
#(#MenuItem |
|
550 | 1488 |
#'label:' 'Add Column' |
408 | 1489 |
#'isButton:' true |
332 | 1490 |
#'value:' #doCreateColumn |
550 | 1491 |
#'activeHelpKey:' #addColumn |
419 | 1492 |
#'enabled:' #columnIsNotEditing |
408 | 1493 |
#'labelImage:' #(#ResourceRetriever nil #newColumnIcon) |
332 | 1494 |
) |
1495 |
#(#MenuItem |
|
1496 |
#'label:' '' |
|
1497 |
) |
|
1498 |
#(#MenuItem |
|
550 | 1499 |
#'label:' 'Move Up' |
408 | 1500 |
#'isButton:' true |
332 | 1501 |
#'value:' #'doMoveColumn:' |
550 | 1502 |
#'activeHelpKey:' #editMoveUp |
408 | 1503 |
#'enabled:' #isColumnSelected |
332 | 1504 |
#'argument:' #up |
408 | 1505 |
#'labelImage:' #(#ResourceRetriever nil #upIcon) |
332 | 1506 |
) |
1507 |
#(#MenuItem |
|
550 | 1508 |
#'label:' 'Move Down' |
408 | 1509 |
#'isButton:' true |
332 | 1510 |
#'value:' #'doMoveColumn:' |
550 | 1511 |
#'activeHelpKey:' #editMoveDown |
408 | 1512 |
#'enabled:' #isColumnSelected |
332 | 1513 |
#'argument:' #down |
408 | 1514 |
#'labelImage:' #(#ResourceRetriever nil #downIcon) |
332 | 1515 |
) |
1516 |
) nil |
|
1517 |
nil |
|
1518 |
) |
|
1519 |
! ! |
|
1520 |
||
408 | 1521 |
!DataSetBuilder class methodsFor:'resources'! |
1522 |
||
1523 |
newColumnIcon |
|
489 | 1524 |
"Generated by the Image Editor" |
1525 |
" |
|
1526 |
ImageEditor openOnClass:self andSelector:#newColumnIcon |
|
1527 |
" |
|
408 | 1528 |
|
1529 |
<resource: #image> |
|
489 | 1530 |
|
1531 |
^Icon |
|
1532 |
constantNamed:#'DataSetBuilder newColumnIcon' |
|
1533 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UT@@@@UPUTUUUXUPUTZ**,UPUTZB",UPUTX*H,UYUTX*H,UPUTZB",UPQTZ**,UPUTX*H,UPUTX*H,UPUTX*H,UPUTXB@,UPUTZ**,UPUTZ**,UPUTX"H,UYUTXB@,UPUTX"@,UPUTX"H,UPUTZ**,UPUTZ**,UPUT/??<UPUT@@@@UP'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:66.9978)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A??@A??@A??@A??@A??@A??@A??@A??@A??CA??@A??@A??@A??@A??CA??AA??@A??CA??@A??CA??@A??@A??A'); yourself); yourself]! ! |
|
408 | 1534 |
|
332 | 1535 |
!DataSetBuilder methodsFor:'accessing'! |
1536 |
||
1537 |
columns |
|
419 | 1538 |
"returns list of columns" |
1539 |
||
818 | 1540 |
^ columns |
332 | 1541 |
! |
1542 |
||
818 | 1543 |
columns:aListOfColumns |
419 | 1544 |
"setup columns from a column view" |
1545 |
||
332 | 1546 |
|list| |
1547 |
||
1548 |
columns := OrderedCollection new. |
|
1549 |
list := self seqList. |
|
1550 |
hasChanged := false. |
|
1551 |
||
1552 |
list removeAll. |
|
1553 |
||
818 | 1554 |
aListOfColumns size ~~ 0 ifTrue:[ |
1555 |
aListOfColumns do:[:aColumn||column| |
|
1556 |
(column := aColumn) isSequenceable ifTrue:[ |
|
1557 |
column := DataSetColumnSpec new fromLiteralArrayEncoding:aColumn |
|
1558 |
] ifFalse:[ |
|
1559 |
column := aColumn copy |
|
1560 |
]. |
|
1561 |
columns add:column. |
|
1562 |
list add:(self labelFromColumn:column). |
|
332 | 1563 |
] |
818 | 1564 |
]. |
1565 |
self updateColumnView. |
|
1566 |
||
333 | 1567 |
! |
1568 |
||
1569 |
rowClassName |
|
419 | 1570 |
|
818 | 1571 |
^(Smalltalk resolveName:rowClass inClass:self class) notNil ifTrue:[rowClass] ifFalse:[nil] |
333 | 1572 |
! |
1573 |
||
1574 |
rowClassName:aClassName |
|
419 | 1575 |
|
333 | 1576 |
|cls| |
1577 |
||
818 | 1578 |
rowSuperClass := nil. |
333 | 1579 |
|
818 | 1580 |
(rowClass := aClassName) notNil ifTrue:[ |
1581 |
(cls := self resolveRowClassNamed) notNil |
|
1582 |
ifTrue: [rowSuperClass := cls superclass name asString] |
|
1583 |
ifFalse:[rowSuperClass := 'Object'] |
|
333 | 1584 |
] |
1585 |
||
332 | 1586 |
! ! |
1587 |
||
419 | 1588 |
!DataSetBuilder methodsFor:'aspects'! |
332 | 1589 |
|
419 | 1590 |
aspectFor:aKey |
1591 |
"returns aspect for a key or nil" |
|
332 | 1592 |
|
419 | 1593 |
^aspects at:aKey ifAbsent:[super aspectFor:aKey] |
332 | 1594 |
|
1595 |
||
1596 |
! |
|
1597 |
||
419 | 1598 |
columnIsNotEditing |
1599 |
"returns a boolean value holder which is set to true if column is not editing" |
|
332 | 1600 |
|
419 | 1601 |
^builder valueAspectFor:#columnIsNotEditing initialValue: true |
332 | 1602 |
|
1603 |
||
1604 |
||
1605 |
! |
|
1606 |
||
419 | 1607 |
editorTypeList |
1608 |
"generate list of supported editor types" |
|
332 | 1609 |
|
1610 |
|list| |
|
1611 |
||
419 | 1612 |
(list := builder bindingAt:#editorTypeList) isNil |
1613 |
ifTrue: |
|
1614 |
[ |
|
332 | 1615 |
list := OrderedCollection new. |
419 | 1616 |
DataSetColumnSpec slices do: |
1617 |
[:aSlice||type| |
|
332 | 1618 |
type := aSlice at:1. |
419 | 1619 |
(list includes:type) ifFalse:[list add:type] |
332 | 1620 |
]. |
419 | 1621 |
builder aspectAt:#editorTypeList put:list |
332 | 1622 |
]. |
419 | 1623 |
^list |
332 | 1624 |
! |
1625 |
||
408 | 1626 |
isColumnSelected |
332 | 1627 |
"returns a boolean value holder which is set to true if something is modified |
419 | 1628 |
and not accepted" |
1629 |
||
1630 |
^builder valueAspectFor:#isColumnSelected initialValue: false |
|
332 | 1631 |
|
1632 |
||
1633 |
||
1634 |
! |
|
1635 |
||
429 | 1636 |
modifiedChannel |
1637 |
"returns a boolean value holder which is set to true if something is modified |
|
1638 |
and not accepted" |
|
1639 |
||
1640 |
^builder booleanValueAspectFor:#modifiedChannel |
|
1641 |
||
1642 |
||
1643 |
||
1644 |
! |
|
1645 |
||
332 | 1646 |
rendererTypeList |
419 | 1647 |
"generate list of supported renderer types" |
1648 |
||
332 | 1649 |
|list| |
1650 |
||
419 | 1651 |
(list := builder bindingAt:#rendererTypeList) isNil |
1652 |
ifTrue: |
|
1653 |
[ |
|
332 | 1654 |
list := OrderedCollection new. |
419 | 1655 |
DataSetColumnSpec slices do: |
1656 |
[:aSlice||type| |
|
332 | 1657 |
type := aSlice at:2. |
419 | 1658 |
(list includes:type) ifFalse:[list add:type] |
332 | 1659 |
]. |
419 | 1660 |
builder aspectAt:#rendererTypeList put:list |
332 | 1661 |
]. |
419 | 1662 |
^list |
332 | 1663 |
! |
1664 |
||
1665 |
selectedColumnModel |
|
419 | 1666 |
"returns a value holder which keeps selected column" |
332 | 1667 |
|
1668 |
|holder| |
|
1669 |
||
1670 |
(holder := builder bindingAt:#selectedColumnModel) isNil ifTrue:[ |
|
1671 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColumnIndex. |
|
1672 |
builder aspectAt:#selectedColumnModel put:holder. |
|
1673 |
]. |
|
1674 |
^ holder |
|
1675 |
! |
|
1676 |
||
1677 |
seqList |
|
1678 |
||
1679 |
|list| |
|
1680 |
||
1681 |
(list := builder bindingAt:#seqList) isNil ifTrue:[ |
|
1682 |
builder aspectAt:#seqList put:(list := List new). |
|
1683 |
]. |
|
1684 |
^ list |
|
1685 |
! |
|
1686 |
||
1687 |
specChannel |
|
1688 |
||
1689 |
|holder| |
|
1690 |
||
1691 |
(holder := builder bindingAt:#specChannel) isNil ifTrue:[ |
|
1692 |
builder aspectAt:#specChannel put:(holder := ValueHolder new). |
|
1693 |
]. |
|
1694 |
^ holder |
|
1695 |
! |
|
1696 |
||
391 | 1697 |
style |
419 | 1698 |
|
1699 |
^self aspectFor:#labelFont |
|
391 | 1700 |
! |
1701 |
||
332 | 1702 |
tabList |
1703 |
||
419 | 1704 |
^self class slices collect:[:aSlice|aSlice first] |
332 | 1705 |
|
1706 |
! |
|
1707 |
||
1708 |
tabModel |
|
419 | 1709 |
"returns a value holder which keeps the index of the current selected tab or 0" |
1710 |
||
332 | 1711 |
|holder| |
1712 |
||
1713 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1714 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelectionIndex. |
|
1715 |
builder aspectAt:#tabModel put:holder. |
|
1716 |
]. |
|
1717 |
^ holder |
|
1718 |
! ! |
|
1719 |
||
818 | 1720 |
!DataSetBuilder methodsFor:'building'! |
1721 |
||
1722 |
buildFromClass:aClass andSelector:aSelector |
|
1723 |
|cls list| |
|
1724 |
||
1725 |
list := nil. |
|
1726 |
||
1727 |
(aClass notNil or:[self isStandAlone or:[self window shown]]) ifTrue:[ |
|
1728 |
||
1729 |
(aClass notNil and:[aSelector notNil]) ifTrue:[ |
|
1730 |
cls := self resolveName:aClass. |
|
1731 |
||
1732 |
(cls respondsTo:aSelector) ifTrue:[ |
|
1733 |
list := cls perform:aSelector |
|
1734 |
] |
|
1735 |
] |
|
1736 |
] ifFalse:[ |
|
1737 |
list := columns |
|
1738 |
]. |
|
1739 |
self columns:list |
|
1740 |
! |
|
1741 |
||
1742 |
buildFromResourceSpec:aResourceSpec |
|
1743 |
||
1744 |
self columns:aResourceSpec |
|
1745 |
! ! |
|
1746 |
||
332 | 1747 |
!DataSetBuilder methodsFor:'change & update'! |
1748 |
||
1749 |
update:something with:aParameter from:someObject |
|
419 | 1750 |
"one of my aspects has changed; update modified channel" |
413 | 1751 |
|
600 | 1752 |
self valueOfEnablingCommitButtons value: true. |
1753 |
self columnIsNotEditing value: false |
|
1754 |
||
332 | 1755 |
! ! |
1756 |
||
1757 |
!DataSetBuilder methodsFor:'code generation'! |
|
1758 |
||
1759 |
compile:aCode forClass:aClass inCategory:aCategory |
|
419 | 1760 |
"compile method for class in a category" |
1761 |
||
332 | 1762 |
ByteCodeCompiler compile:aCode withCRs forClass:aClass inCategory:aCategory |
1763 |
! |
|
1764 |
||
380 | 1765 |
generateBackgroundSelectorIn:aClass |
419 | 1766 |
"generate code for #backgroundSelector" |
1767 |
||
380 | 1768 |
|sel catg code bCode| |
1769 |
||
391 | 1770 |
catg := 'accessing look' asSymbol. |
380 | 1771 |
code := '\' |
1772 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1773 |
, '\' |
|
1774 |
, ' "specific background color for a cell"\' |
|
1775 |
, '\' |
|
1776 |
. |
|
1777 |
||
419 | 1778 |
columns do: |
1779 |
[:aColumn| |
|
1780 |
((sel := aColumn backgroundSelector) notNil and:[(aClass implements:sel) not]) |
|
1781 |
ifTrue: |
|
1782 |
[ |
|
1783 |
bCode := sel asString, code, ' ^nil'. |
|
380 | 1784 |
self compile:bCode forClass:aClass inCategory:catg |
1785 |
] |
|
1786 |
] |
|
1787 |
||
1788 |
||
1789 |
! |
|
1790 |
||
332 | 1791 |
generateChoicesIn:aClass |
419 | 1792 |
"generate code for #choices" |
1793 |
||
332 | 1794 |
|sel catg code| |
1795 |
||
391 | 1796 |
catg := 'accessing menu' asSymbol. |
332 | 1797 |
code := '\' |
1798 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1799 |
, '\' |
|
1800 |
, ' "get choices for visual editor; (a list of labels)\' |
|
1801 |
, '\' |
|
419 | 1802 |
, ' ^nil' |
332 | 1803 |
. |
1804 |
||
419 | 1805 |
columns do: |
1806 |
[:aColumn| |
|
1807 |
(aColumn canSelect |
|
1808 |
and:[aColumn rendererType ~~ #rowSelector |
|
1809 |
and:[(sel := aColumn choices) notNil |
|
1810 |
and:[(aClass implements:sel) not]]]) |
|
1811 |
ifTrue: |
|
1812 |
[ |
|
332 | 1813 |
self compile:(sel asString, code) forClass:aClass inCategory:catg |
1814 |
] |
|
1815 |
] |
|
1816 |
! |
|
1817 |
||
391 | 1818 |
generateDoubleClickSelectorIn:aClass |
419 | 1819 |
"generate code for #foregroundSelector" |
1820 |
||
391 | 1821 |
|sel catg code bCode| |
1822 |
||
1823 |
catg := 'accessing action' asSymbol. |
|
1824 |
code := '\' |
|
1825 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1826 |
, '\' |
|
1827 |
, ' "specific selector to be called on double click"\' |
|
1828 |
, '\' |
|
1829 |
. |
|
1830 |
||
419 | 1831 |
columns do: |
1832 |
[:aColumn| |
|
1833 |
((sel := aColumn doubleClickedSelector) notNil |
|
1834 |
and:[(aClass implements:sel) not]) |
|
1835 |
ifTrue: |
|
1836 |
[ |
|
391 | 1837 |
bCode := sel asString, code. |
1838 |
self compile:bCode forClass:aClass inCategory:catg |
|
1839 |
] |
|
1840 |
] |
|
1841 |
||
1842 |
||
1843 |
! |
|
1844 |
||
380 | 1845 |
generateForegroundSelectorIn:aClass |
1846 |
"generate code for #foregroundSelector |
|
1847 |
" |
|
1848 |
|sel catg code bCode| |
|
1849 |
||
391 | 1850 |
catg := 'accessing look' asSymbol. |
380 | 1851 |
code := '\' |
1852 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1853 |
, '\' |
|
1854 |
, ' "specific foreground color for a cell"\' |
|
1855 |
, '\' |
|
1856 |
. |
|
1857 |
||
419 | 1858 |
columns do: |
1859 |
[:aColumn| |
|
1860 |
((sel := aColumn foregroundSelector) notNil |
|
1861 |
and:[(aClass implements:sel) not]) |
|
1862 |
ifTrue: |
|
1863 |
[ |
|
1864 |
bCode := sel asString, code, ' ^nil'. |
|
380 | 1865 |
self compile:bCode forClass:aClass inCategory:catg |
1866 |
] |
|
1867 |
] |
|
1868 |
||
1869 |
||
1870 |
! |
|
1871 |
||
332 | 1872 |
generateMenuIn:aClass |
419 | 1873 |
"generate code for #menu" |
1874 |
||
332 | 1875 |
|sel catg code| |
1876 |
||
391 | 1877 |
catg := 'accessing menu' asSymbol. |
332 | 1878 |
code := '\' |
1879 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1880 |
, '\' |
|
1881 |
, ' "get middleButton menu for selected cell in column"\' |
|
1882 |
, '\' |
|
419 | 1883 |
, ' ^nil' |
332 | 1884 |
. |
1885 |
||
419 | 1886 |
columns do: |
1887 |
[:aColumn| |
|
1888 |
(aColumn canSelect |
|
1889 |
and:[(sel := aColumn menu) notNil |
|
1890 |
and:[(aClass implements:sel) not]]) |
|
1891 |
ifTrue: |
|
1892 |
[ |
|
332 | 1893 |
self compile:(sel asString, code) forClass:aClass inCategory:catg |
1894 |
] |
|
1895 |
] |
|
1896 |
! |
|
1897 |
||
1898 |
generatePrintSelectorIn:aClass |
|
419 | 1899 |
"generate code for #printSelector" |
1900 |
||
332 | 1901 |
|sel catg code| |
1902 |
||
391 | 1903 |
catg := 'accessing' asSymbol. |
332 | 1904 |
code := 'aGC\' |
1905 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1906 |
, '\' |
|
1907 |
, ' "get drawable image or text on a gc"\' |
|
1908 |
, '\' |
|
419 | 1909 |
, ' ^nil' |
332 | 1910 |
. |
1911 |
||
419 | 1912 |
columns do: |
1913 |
[:aColumn| |
|
1914 |
(aColumn rendererType ~~ #rowSelector |
|
1915 |
and:[(sel := aColumn printSelector) notNil |
|
1916 |
and:[(aClass implements:sel) not]]) |
|
1917 |
ifTrue: |
|
1918 |
[ |
|
332 | 1919 |
self compile:(sel asString, code) forClass:aClass inCategory:catg |
1920 |
] |
|
1921 |
] |
|
1922 |
! |
|
1923 |
||
1924 |
generateReadSelectorIn:aClass |
|
419 | 1925 |
"generate code for #readSelector" |
1926 |
||
332 | 1927 |
|sel catg code bCode| |
1928 |
||
391 | 1929 |
catg := 'accessing' asSymbol. |
332 | 1930 |
code := '\' |
1931 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1932 |
, '\' |
|
1933 |
, ' "get value"\' |
|
1934 |
, '\' |
|
1935 |
. |
|
1936 |
||
419 | 1937 |
columns do: |
1938 |
[:aColumn| |
|
1939 |
(aColumn rendererType ~~ #rowSelector |
|
1940 |
and:[(sel := aColumn readSelector) notNil |
|
1941 |
and:[(aClass implements:sel) not]]) |
|
1942 |
ifTrue: |
|
1943 |
[ |
|
1944 |
(aColumn printSelector isNil or:[aColumn canSelect]) |
|
1945 |
ifTrue: |
|
1946 |
[ |
|
1947 |
sel numArgs == 0 |
|
1948 |
ifTrue: [bCode := sel asString, code] |
|
1949 |
ifFalse:[bCode := sel asString, 'anIndex\', code]. |
|
1950 |
aColumn rendererType == #CheckToggle |
|
1951 |
ifFalse:[bCode := bCode, ' ^nil'] |
|
1952 |
ifTrue: [bCode := bCode, ' ^true']. |
|
332 | 1953 |
self compile:bCode forClass:aClass inCategory:catg |
1954 |
] |
|
1955 |
] |
|
1956 |
] |
|
1957 |
! |
|
1958 |
||
377 | 1959 |
generateSelectSelectorIn:aClass |
1960 |
"generate code for #selectSelector |
|
1961 |
" |
|
1962 |
|sel catg code bCode| |
|
1963 |
||
391 | 1964 |
catg := 'accessing selection' asSymbol. |
377 | 1965 |
code := '\' |
1966 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1967 |
, '\' |
|
1968 |
, ' "can select cell in column"\' |
|
1969 |
, '\' |
|
1970 |
. |
|
1971 |
||
419 | 1972 |
columns do: |
1973 |
[:aColumn| |
|
1974 |
(aColumn rendererType ~~ #rowSelector |
|
377 | 1975 |
and:[(sel := aColumn selectSelector) notNil |
419 | 1976 |
and:[(aClass implements:sel) not]]) |
1977 |
ifTrue: |
|
1978 |
[ |
|
1979 |
aColumn canSelect |
|
1980 |
ifTrue: |
|
1981 |
[ |
|
1982 |
bCode := sel asString, code, ' ^true'. |
|
377 | 1983 |
self compile:bCode forClass:aClass inCategory:catg |
1984 |
] |
|
1985 |
] |
|
1986 |
] |
|
1987 |
! |
|
1988 |
||
332 | 1989 |
generateWriteSelectorIn:aClass |
419 | 1990 |
"generate code for #writeSelector" |
1991 |
||
379 | 1992 |
|sel catg code bCode sz| |
332 | 1993 |
|
391 | 1994 |
catg := 'accessing' asSymbol. |
332 | 1995 |
code := 'aValue\' |
1996 |
, ' "automatically generated by DataSetBuilder ..."\' |
|
1997 |
, '\' |
|
1998 |
, ' "set value"\' |
|
1999 |
. |
|
2000 |
||
419 | 2001 |
columns do: |
2002 |
[:aColumn| |
|
2003 |
((sel := aColumn writeSelector) notNil |
|
2004 |
and:[aColumn canSelect |
|
2005 |
and:[(aClass implements:sel) not]]) |
|
2006 |
ifTrue: |
|
2007 |
[ |
|
2008 |
sel numArgs == 1 |
|
2009 |
ifTrue: |
|
2010 |
[ |
|
379 | 2011 |
bCode := sel asString |
419 | 2012 |
] |
2013 |
ifFalse: |
|
2014 |
[ |
|
379 | 2015 |
sz := sel indexOf:$:. |
2016 |
bCode := sel copyTo:sz. |
|
419 | 2017 |
bCode := bCode, 'anIndex ', (sel copyFrom:sz + 1) |
379 | 2018 |
]. |
2019 |
self compile:(bCode, code) forClass:aClass inCategory:catg |
|
332 | 2020 |
] |
2021 |
] |
|
2022 |
! ! |
|
2023 |
||
2024 |
!DataSetBuilder methodsFor:'initialization'! |
|
2025 |
||
2026 |
initialize |
|
419 | 2027 |
"setup aspects used by column description specifications" |
2028 |
||
332 | 2029 |
|holder| |
2030 |
||
2031 |
super initialize. |
|
2032 |
selectedColumnIndex := 0. |
|
2033 |
tabSelectionIndex := 0. |
|
2034 |
columns := OrderedCollection new. |
|
2035 |
hasChanged := false. |
|
2036 |
||
2037 |
#( |
|
2038 |
label |
|
2039 |
canSelect |
|
2040 |
choices |
|
2041 |
editorType |
|
2042 |
formatString |
|
370 | 2043 |
labelIsImage |
332 | 2044 |
size |
2045 |
type |
|
2046 |
width |
|
2047 |
minWidth |
|
2048 |
height |
|
2049 |
menu |
|
380 | 2050 |
foregroundSelector |
2051 |
backgroundSelector |
|
391 | 2052 |
doubleClickedSelector |
377 | 2053 |
selectSelector |
332 | 2054 |
printSelector |
2055 |
readSelector |
|
379 | 2056 |
writeSelector |
332 | 2057 |
rendererType |
2058 |
showColSeparator |
|
2059 |
showRowSeparator |
|
357 | 2060 |
backgroundColor |
2061 |
foregroundColor |
|
391 | 2062 |
labelForegroundColor |
2063 |
labelBackgroundColor |
|
2064 |
labelFont |
|
2065 |
labelActionSelector |
|
2066 |
labelActionArgument |
|
2067 |
labelAlignment |
|
817 | 2068 |
columnAlignment |
332 | 2069 |
) do:[:aKey| |
2070 |
aspects at:aKey put:(holder := ValueHolder new). |
|
419 | 2071 |
holder addDependent:self |
2072 |
] |
|
332 | 2073 |
|
2074 |
! ! |
|
2075 |
||
2076 |
!DataSetBuilder methodsFor:'private'! |
|
2077 |
||
408 | 2078 |
checkMenuItemModified |
2079 |
"check column modification" |
|
2080 |
||
421 | 2081 |
self valueOfEnablingCommitButtons value |
408 | 2082 |
ifTrue: |
2083 |
[ |
|
2084 |
((YesNoBox title:'Column was modified!!\Save it?\' withCRs) |
|
2085 |
noText:'No'; |
|
2086 |
yesText:'Yes'; |
|
2087 |
showAtPointer; |
|
421 | 2088 |
accepted) ifFalse: [self valueOfEnablingCommitButtons value: false. ^true]. |
408 | 2089 |
self accept |
2090 |
]. |
|
2091 |
^true |
|
2092 |
||
2093 |
! |
|
2094 |
||
818 | 2095 |
labelFromColumn:aColumn |
2096 |
^ aColumn rendererType == #rowSelector ifFalse:[aColumn label] |
|
2097 |
ifTrue:['Row Selector']. |
|
2098 |
! |
|
2099 |
||
2100 |
resolveRowClassNamed |
|
419 | 2101 |
"returns current class or nil" |
2102 |
||
818 | 2103 |
^Smalltalk resolveName:rowClass inClass:self class. |
332 | 2104 |
|
2105 |
! |
|
2106 |
||
2107 |
updateColumnView |
|
419 | 2108 |
"update column view from column descriptions" |
2109 |
columnView notNil ifTrue:[columnView columnDescriptors:columns] |
|
2110 |
! |
|
2111 |
||
2112 |
updateInputFields |
|
2113 |
"reload item value into input fields" |
|
2114 |
||
2115 |
|column| |
|
2116 |
||
2117 |
(column := self selectedColumn) isNil |
|
2118 |
ifTrue: |
|
2119 |
[ |
|
2120 |
self tabModel value:0. |
|
2121 |
] |
|
2122 |
ifFalse: |
|
2123 |
[ |
|
600 | 2124 |
aspects keysAndValuesDo:[:aKey :aModel|aModel value:(column perform:aKey) withoutNotifying: self]. |
419 | 2125 |
tabSelectionIndex == 0 ifTrue:[self tabModel value:1] |
2126 |
] |
|
332 | 2127 |
! ! |
2128 |
||
2129 |
!DataSetBuilder methodsFor:'queries'! |
|
2130 |
||
2131 |
hasChanged |
|
419 | 2132 |
"returns true if changes are done to the original column description" |
332 | 2133 |
|
419 | 2134 |
^hasChanged |
332 | 2135 |
! ! |
2136 |
||
2137 |
!DataSetBuilder methodsFor:'selection'! |
|
2138 |
||
2139 |
selectedColumn |
|
419 | 2140 |
"returns selected column or nil" |
2141 |
||
2142 |
^selectedColumnIndex == 0 |
|
2143 |
ifFalse:[columns at:selectedColumnIndex] |
|
2144 |
ifTrue: [nil] |
|
332 | 2145 |
! |
2146 |
||
2147 |
selectedColumnIndex |
|
419 | 2148 |
"returns selected column index or 0" |
2149 |
||
2150 |
^selectedColumnIndex |
|
332 | 2151 |
! |
2152 |
||
2153 |
selectedColumnIndex:something |
|
419 | 2154 |
"change selected column and update specifications" |
2155 |
||
2156 |
something == selectedColumnIndex |
|
2157 |
ifFalse: |
|
2158 |
[ |
|
332 | 2159 |
selectedColumnIndex := something ? 0. |
408 | 2160 |
self isColumnSelected value: true |
419 | 2161 |
] |
332 | 2162 |
|
2163 |
! |
|
2164 |
||
2165 |
tabSelectionIndex |
|
419 | 2166 |
"returns selected tab index or 0" |
2167 |
||
2168 |
^tabSelectionIndex |
|
332 | 2169 |
! |
2170 |
||
2171 |
tabSelectionIndex:something |
|
419 | 2172 |
"change selected tab and set corresponding specification" |
2173 |
||
332 | 2174 |
|specSelector| |
2175 |
||
419 | 2176 |
something == tabSelectionIndex ifTrue:[^self]. |
2177 |
self selectedColumn isNil |
|
2178 |
ifTrue: |
|
2179 |
[ |
|
2180 |
tabSelectionIndex == 0 ifTrue:[^self]. |
|
332 | 2181 |
tabSelectionIndex := 0 |
419 | 2182 |
] |
2183 |
ifFalse: |
|
2184 |
[ |
|
2185 |
(tabSelectionIndex := something) ~~ 0 |
|
2186 |
ifTrue: [specSelector := (self class slices at:tabSelectionIndex) last] |
|
332 | 2187 |
]. |
2188 |
self specChannel value:specSelector |
|
2189 |
||
2190 |
||
2191 |
! ! |
|
2192 |
||
408 | 2193 |
!DataSetBuilder methodsFor:'startup / release'! |
2194 |
||
409 | 2195 |
closeRequest |
419 | 2196 |
"close request" |
2197 |
||
409 | 2198 |
self checkMenuItemModified ifTrue: [super closeRequest] |
2199 |
! |
|
2200 |
||
408 | 2201 |
postBuildWith:builder |
2202 |
||
818 | 2203 |
columnView := self builder componentAt:#columnView. |
2204 |
columnView labelView enabled:false. |
|
2205 |
||
408 | 2206 |
super postBuildWith:builder. |
2207 |
||
818 | 2208 |
(builder componentAt: #labelAndColumns) |
413 | 2209 |
selectConditionBlock: [:i|self checkMenuItemModified]; |
419 | 2210 |
action: [:i|self cancel]; |
818 | 2211 |
selection: 1. |
408 | 2212 |
|
2213 |
||
2214 |
! ! |
|
2215 |
||
419 | 2216 |
!DataSetBuilder methodsFor:'user actions'! |
2217 |
||
2218 |
accept |
|
2219 |
"accept changes made" |
|
2220 |
||
2221 |
|column type| |
|
2222 |
||
421 | 2223 |
self valueOfEnablingCommitButtons value == false ifTrue: [^self]. |
556 | 2224 |
hasChanged := true. |
419 | 2225 |
|
2226 |
(column := self selectedColumn) isNil ifTrue: [^self cancel]. |
|
2227 |
||
2228 |
type := (aspects at:#rendererType) value. |
|
2229 |
||
818 | 2230 |
type == #rowSelector ifTrue:[ |
419 | 2231 |
#(label width minWidth editorType choices readSelector writeSelector printSelector |
818 | 2232 |
formatString type size height canSelect selectSelector |
2233 |
) do:[:aKey| |
|
2234 |
(aspects at:aKey) value:nil |
|
2235 |
] |
|
419 | 2236 |
]. |
2237 |
aspects keysAndValuesDo:[:aKey :aModel| column perform:(aKey , ':') asSymbol with: aModel value]. |
|
818 | 2238 |
self seqList at:selectedColumnIndex put:(self labelFromColumn:column). |
419 | 2239 |
self updateColumnView. |
2240 |
self cancel |
|
2241 |
! |
|
2242 |
||
2243 |
cancel |
|
2244 |
"remove all changes and reload selected column values" |
|
2245 |
||
2246 |
self updateInputFields. |
|
421 | 2247 |
self valueOfEnablingCommitButtons value:false. |
419 | 2248 |
self columnIsNotEditing value: true. |
2249 |
! |
|
2250 |
||
818 | 2251 |
doBrowseRowClass |
419 | 2252 |
"browse class of columns spec" |
2253 |
||
2254 |
|cls| |
|
2255 |
||
818 | 2256 |
(cls := self resolveRowClassNamed) notNil |
419 | 2257 |
ifTrue: [SystemBrowser openInClass:cls] |
2258 |
ifFalse:[self information:'No class defined!!'] |
|
2259 |
||
2260 |
||
2261 |
||
2262 |
! |
|
2263 |
||
2264 |
doCopyColumn |
|
2265 |
"copy selected column to the clipboard" |
|
2266 |
||
2267 |
|idx| |
|
2268 |
||
2269 |
(idx := selectedColumnIndex) ~~ 0 |
|
2270 |
ifTrue: |
|
2271 |
[ |
|
2272 |
self clipboard: (columns at: idx) deepCopy |
|
2273 |
] |
|
2274 |
! |
|
2275 |
||
2276 |
doCreateColumn |
|
2277 |
"create a new column after selected column or at left (nothing selected)" |
|
2278 |
||
2279 |
|label list| |
|
2280 |
||
2281 |
list := self seqList. |
|
554 | 2282 |
label := 'Column ', (list size + 1) printString. |
419 | 2283 |
columns add:(DataSetColumnSpec label:label selector:nil) afterIndex:selectedColumnIndex. |
2284 |
self seqList add:label afterIndex:selectedColumnIndex. |
|
2285 |
hasChanged := true. |
|
421 | 2286 |
self valueOfEnablingCommitButtons value ifFalse:[self selectedColumnModel value:selectedColumnIndex + 1]. |
818 | 2287 |
self cancel. |
2288 |
self updateColumnView |
|
419 | 2289 |
|
2290 |
! |
|
2291 |
||
2292 |
doCutColumn |
|
2293 |
"remove selected column and put it to the clipboard" |
|
2294 |
||
2295 |
|idx| |
|
2296 |
||
2297 |
((idx := selectedColumnIndex) ~~ 0 and: [self checkMenuItemModified]) |
|
2298 |
ifTrue: |
|
2299 |
[ |
|
2300 |
self selectedColumnModel value:0. |
|
2301 |
self clipboard: (columns at: idx). |
|
2302 |
columns removeIndex:idx. |
|
2303 |
self seqList removeIndex:idx. |
|
555 | 2304 |
columns size > 0 ifTrue: [self selectedColumnModel value: ((idx - 1) max: 1)]. |
556 | 2305 |
self updateColumnView. |
555 | 2306 |
self updateInputFields. |
419 | 2307 |
columns isEmpty ifTrue: [self isColumnSelected value: false]. |
555 | 2308 |
self cancel. |
556 | 2309 |
hasChanged := true. |
419 | 2310 |
] |
2311 |
! |
|
2312 |
||
818 | 2313 |
doDefineRowClass |
419 | 2314 |
"launch a dialog to define class and superclass" |
2315 |
||
2316 |
|aspects cls oldClass oldSuper| |
|
2317 |
||
2318 |
aspects := IdentityDictionary new. |
|
818 | 2319 |
oldClass := rowClass. |
2320 |
oldSuper := rowSuperClass. |
|
419 | 2321 |
|
2322 |
[true] |
|
2323 |
whileTrue: |
|
2324 |
[ |
|
818 | 2325 |
rowClass notNil |
419 | 2326 |
ifTrue: |
2327 |
[ |
|
818 | 2328 |
(cls := self resolveRowClassNamed) notNil |
419 | 2329 |
ifTrue: |
2330 |
[ |
|
818 | 2331 |
rowSuperClass := cls superclass name asString |
419 | 2332 |
]. |
818 | 2333 |
aspects at:#classNameChannel put:rowClass asValue |
419 | 2334 |
] |
2335 |
ifFalse: |
|
2336 |
[ |
|
2337 |
aspects at:#classNameChannel put:'DSVRow' asValue |
|
2338 |
]. |
|
2339 |
||
818 | 2340 |
rowSuperClass notNil |
2341 |
ifTrue: [aspects at:#superclassNameChannel put:rowSuperClass asValue] |
|
419 | 2342 |
ifFalse:[aspects at:#superclassNameChannel put:'Object' asValue]. |
2343 |
||
2344 |
(self openDialogInterface:#defineClassNameSpec withBindings:aspects) |
|
2345 |
ifFalse: |
|
2346 |
[ |
|
818 | 2347 |
rowClass := oldClass. |
2348 |
rowSuperClass := oldSuper. |
|
419 | 2349 |
^self |
2350 |
]. |
|
818 | 2351 |
rowClass := ((aspects at:#classNameChannel) value) withoutSeparators. |
2352 |
rowSuperClass := ((aspects at:#superclassNameChannel) value) withoutSeparators. |
|
419 | 2353 |
|
818 | 2354 |
rowClass size == 0 |
419 | 2355 |
ifTrue: |
2356 |
[ |
|
818 | 2357 |
rowClass := nil. |
419 | 2358 |
self information:'no valid className' |
2359 |
] |
|
2360 |
ifFalse: |
|
2361 |
[ |
|
818 | 2362 |
cls := self resolveRowClassNamed. |
419 | 2363 |
|
2364 |
cls notNil ifTrue:[cls := cls superclass name asString]. |
|
2365 |
||
818 | 2366 |
rowSuperClass size == 0 |
419 | 2367 |
ifTrue: |
2368 |
[ |
|
2369 |
cls notNil ifTrue:[ |
|
818 | 2370 |
rowSuperClass := cls |
419 | 2371 |
] ifFalse:[ |
818 | 2372 |
rowSuperClass := 'Object' |
419 | 2373 |
]. |
2374 |
self information: 'set superclassName' |
|
2375 |
] |
|
2376 |
ifFalse: |
|
2377 |
[ |
|
818 | 2378 |
(cls isNil or:[rowSuperClass = cls]) ifTrue:[hasChanged := true. ^self]. |
2379 |
self information:('A global named ' , rowClass , ' exists,\' , |
|
2380 |
'but is not a subclass of ' , rowSuperClass, '.\\' , |
|
419 | 2381 |
'Check and try again if that is not what you want.') withCRs. |
2382 |
||
818 | 2383 |
rowSuperClass := cls |
419 | 2384 |
] |
2385 |
] |
|
2386 |
] |
|
2387 |
! |
|
2388 |
||
2389 |
doGenerateCode |
|
2390 |
"generate code for column values" |
|
2391 |
||
2392 |
|cls superclass| |
|
2393 |
||
818 | 2394 |
rowClass isNil ifTrue:[^self information:'No class defined!!']. |
2395 |
cls := self resolveRowClassNamed. |
|
419 | 2396 |
|
2397 |
cls isNil |
|
2398 |
ifTrue: |
|
2399 |
[ |
|
818 | 2400 |
superclass := Smalltalk resolveName:rowSuperClass inClass:self class. |
419 | 2401 |
|
2402 |
superclass isNil ifTrue:[^self information:'No superclass defined!!']. |
|
818 | 2403 |
(self confirm:'create ' , rowClass , ' ?') ifFalse:[^self]. |
2404 |
cls := superclass subclass:rowClass asSymbol |
|
419 | 2405 |
instanceVariableNames:'' |
2406 |
classVariableNames:'' |
|
2407 |
poolDictionaries:'' |
|
2408 |
category:'Applications'. |
|
2409 |
]. |
|
2410 |
||
2411 |
self generateChoicesIn:cls. |
|
2412 |
self generateMenuIn:cls. |
|
2413 |
self generatePrintSelectorIn:cls. |
|
2414 |
self generateReadSelectorIn:cls. |
|
2415 |
self generateBackgroundSelectorIn:cls. |
|
2416 |
self generateForegroundSelectorIn:cls. |
|
2417 |
self generateSelectSelectorIn:cls. |
|
2418 |
self generateWriteSelectorIn:cls. |
|
2419 |
self generateDoubleClickSelectorIn:cls. |
|
2420 |
! |
|
2421 |
||
2422 |
doMoveColumn:upOrDown |
|
2423 |
"move selected column up or down" |
|
2424 |
||
2425 |
|idx list label col size| |
|
2426 |
||
2427 |
(idx := selectedColumnIndex) == 0 ifTrue:[^self]. |
|
2428 |
list := self seqList. |
|
2429 |
size := list size. |
|
2430 |
||
2431 |
size == 1 ifTrue:[^self]. |
|
2432 |
hasChanged := true. |
|
2433 |
selectedColumnIndex := 0. |
|
2434 |
label := list at:idx. |
|
2435 |
col := columns at:idx. |
|
2436 |
list removeIndex:idx. |
|
2437 |
columns removeIndex:idx. |
|
2438 |
||
2439 |
upOrDown == #up |
|
2440 |
ifTrue: |
|
2441 |
[ |
|
2442 |
idx == 1 ifTrue:[idx := size] |
|
2443 |
ifFalse:[idx := idx - 1] |
|
2444 |
] |
|
2445 |
ifFalse: |
|
2446 |
[ |
|
2447 |
idx == size ifTrue:[idx := 1] |
|
2448 |
ifFalse:[idx := idx + 1] |
|
2449 |
]. |
|
2450 |
columns add:col beforeIndex:idx. |
|
2451 |
list add:label beforeIndex:idx. |
|
2452 |
self selectedColumnModel value:idx. |
|
2453 |
self updateColumnView. |
|
2454 |
! |
|
2455 |
||
2456 |
doPasteColumn |
|
2457 |
"paste clipboard copy column after selected column or at left (nothing selected)" |
|
2458 |
||
818 | 2459 |
|col lbl| |
419 | 2460 |
|
601 | 2461 |
self checkMenuItemModified ifFalse: [^nil]. |
818 | 2462 |
col := self class clipboard deepCopy. |
2463 |
lbl := self labelFromColumn:col. |
|
2464 |
||
2465 |
columns add:col afterIndex:selectedColumnIndex. |
|
2466 |
self seqList add:lbl afterIndex:selectedColumnIndex. |
|
419 | 2467 |
hasChanged := true. |
2468 |
||
818 | 2469 |
self valueOfEnablingCommitButtons value ifFalse:[ |
2470 |
self selectedColumnModel value:selectedColumnIndex + 1 |
|
2471 |
]. |
|
419 | 2472 |
self updateColumnView. |
556 | 2473 |
self updateInputFields. |
818 | 2474 |
! |
2475 |
||
2476 |
doPickColumns |
|
2477 |
||
2478 |
|view cls| |
|
2479 |
||
2480 |
view := Screen current viewFromUser. |
|
2481 |
cls := view class. |
|
2482 |
||
2483 |
(cls == DSVColumnView or:[cls == DataSetView or:[cls == DSVLabelView]]) ifTrue:[ |
|
2484 |
self columns:(view columnView columnDescriptors) |
|
2485 |
] |
|
2486 |
! |
|
2487 |
||
2488 |
doSave |
|
2489 |
|cls dst spc idx category mthd excla code resourceType| |
|
2490 |
||
2491 |
(columns size ~~ 0 and:[super doSave]) ifFalse:[ |
|
2492 |
^ nil |
|
2493 |
]. |
|
2494 |
cls := self resolveName:specClass. |
|
2495 |
dst := columns collect:[:aCol| aCol literalArrayEncoding ]. |
|
2496 |
spc := WriteStream on:String new. |
|
2497 |
UISpecification prettyPrintSpecArray:dst asArray on:spc indent:4. |
|
2498 |
spc := spc contents. |
|
2499 |
idx := (spc indexOfNonSeparatorStartingAt:1) - 2. |
|
2500 |
||
2501 |
spc at:idx put:$^. |
|
2502 |
||
2503 |
"/ if that method already exists, do not overwrite the category |
|
2504 |
||
2505 |
resourceType := self class resourceType. |
|
2506 |
category := resourceType, ' specs'. |
|
2507 |
||
2508 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
|
2509 |
category := mthd category. |
|
2510 |
]. |
|
2511 |
||
2512 |
excla := Character excla asString. |
|
2513 |
||
2514 |
code := excla |
|
2515 |
, (cls name , ' class methodsFor:' , category storeString) |
|
2516 |
, excla , '\\' |
|
2517 |
||
2518 |
, specSelector , '\' |
|
2519 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
|
2520 |
, '\\ "\' |
|
2521 |
, (' DataSetBuilder new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\') |
|
2522 |
, ' "\'. |
|
2523 |
||
2524 |
code := code |
|
2525 |
, '\' |
|
2526 |
, ' <resource: #', resourceType, '>\\' |
|
2527 |
, spc |
|
2528 |
, '\' |
|
2529 |
, (excla , ' ' , excla) |
|
2530 |
, '\\'. |
|
2531 |
||
2532 |
code := code withCRs. |
|
2533 |
(ReadStream on:code) fileIn. |
|
2534 |
||
2535 |
"/ self isStandAlone ifTrue: [self helpTool installHelpSpecsOnClass:self specClass]. |
|
2536 |
||
2537 |
self updateHistory. |
|
2538 |
self updateInfoLabel. |
|
2539 |
||
2540 |
hasSaved := true. |
|
2541 |
modified := false. |
|
2542 |
||
419 | 2543 |
! ! |
2544 |
||
332 | 2545 |
!DataSetBuilder class methodsFor:'documentation'! |
2546 |
||
2547 |
version |
|
2548 |
^ '$Header$' |
|
2549 |
! ! |