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