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