author | Claus Gittinger <cg@exept.de> |
Mon, 02 Sep 2013 17:16:07 +0200 | |
changeset 13460 | e1de341db945 |
parent 10741 | e4645cbb0958 |
child 12123 | 4bde08cebd48 |
child 13800 | a06ec1e6e43a |
permissions | -rw-r--r-- |
10741
e4645cbb0958
Fix package def libbasic3->libtool
Stefan Vogel <sv@exept.de>
parents:
10193
diff
changeset
|
1 |
"{ Package: 'stx:libtool' }" |
10193 | 2 |
|
3 |
"{ NameSpace: Tools }" |
|
4 |
||
5 |
SimpleDialog subclass:#ChangeSetSelectionDialog |
|
6 |
instanceVariableNames:'specHolder specLabelList specLabelIndexHolder |
|
7 |
specEditorSpecHolder' |
|
8 |
classVariableNames:'' |
|
9 |
poolDictionaries:'' |
|
10 |
category:'Interface-Dialogs' |
|
11 |
! |
|
12 |
||
13 |
||
14 |
!ChangeSetSelectionDialog class methodsFor:'instance creation'! |
|
15 |
||
16 |
requestChangeSet: title |
|
17 |
||
18 |
| dialog | |
|
19 |
dialog := self new. |
|
20 |
^(dialog open) |
|
21 |
ifTrue:[dialog specHolder value changeSet] |
|
22 |
ifFalse:[nil]. |
|
23 |
||
24 |
"Created: / 06-07-2011 / 10:52:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
25 |
! ! |
|
26 |
||
27 |
!ChangeSetSelectionDialog class methodsFor:'interface specs'! |
|
28 |
||
29 |
windowSpec |
|
30 |
"This resource specification was automatically generated |
|
31 |
by the UIPainter of ST/X." |
|
32 |
||
33 |
"Do not manually edit this!! If it is corrupted, |
|
34 |
the UIPainter may not be able to read the specification." |
|
35 |
||
36 |
" |
|
37 |
UIPainter new openOnClass:Tools::ChangeSetSelectionDialog andSelector:#windowSpec |
|
38 |
Tools::ChangeSetSelectionDialog new openInterface:#windowSpec |
|
39 |
Tools::ChangeSetSelectionDialog open |
|
40 |
" |
|
41 |
||
42 |
<resource: #canvas> |
|
43 |
||
44 |
^ |
|
45 |
#(FullSpec |
|
46 |
name: windowSpec |
|
47 |
window: |
|
48 |
(WindowSpec |
|
49 |
label: 'Select Changeset' |
|
50 |
name: 'Select Changeset' |
|
51 |
min: (Point 10 10) |
|
52 |
bounds: (Rectangle 0 0 631 436) |
|
53 |
) |
|
54 |
component: |
|
55 |
(SpecCollection |
|
56 |
collection: ( |
|
57 |
(UISubSpecification |
|
58 |
name: 'Content' |
|
59 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
60 |
minorKey: windowSpecForEmbedding |
|
61 |
) |
|
62 |
(HorizontalPanelViewSpec |
|
63 |
name: 'ButtonPanel' |
|
64 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
65 |
horizontalLayout: fitSpace |
|
66 |
verticalLayout: center |
|
67 |
horizontalSpace: 3 |
|
68 |
verticalSpace: 2 |
|
69 |
reverseOrderIfOKAtLeft: true |
|
70 |
component: |
|
71 |
(SpecCollection |
|
72 |
collection: ( |
|
73 |
(ActionButtonSpec |
|
74 |
label: 'Cancel' |
|
75 |
name: 'Button2' |
|
76 |
translateLabel: true |
|
77 |
model: doCancel |
|
78 |
extent: (Point 311 22) |
|
79 |
) |
|
80 |
(ActionButtonSpec |
|
81 |
label: 'OK' |
|
82 |
name: 'Button1' |
|
83 |
translateLabel: true |
|
84 |
model: doAccept |
|
85 |
enableChannel: doAcceptEnabledHolder |
|
86 |
extent: (Point 311 22) |
|
87 |
) |
|
88 |
) |
|
89 |
||
90 |
) |
|
91 |
) |
|
92 |
) |
|
93 |
||
94 |
) |
|
95 |
) |
|
96 |
! |
|
97 |
||
98 |
windowSpecForEmbedding |
|
99 |
"This resource specification was automatically generated |
|
100 |
by the UIPainter of ST/X." |
|
101 |
||
102 |
"Do not manually edit this!! If it is corrupted, |
|
103 |
the UIPainter may not be able to read the specification." |
|
104 |
||
105 |
" |
|
106 |
UIPainter new openOnClass:Tools::ChangeSetSelectionDialog andSelector:#windowSpecForEmbedding |
|
107 |
Tools::ChangeSetSelectionDialog new openInterface:#windowSpecForEmbedding |
|
108 |
" |
|
109 |
||
110 |
<resource: #canvas> |
|
111 |
||
112 |
^ |
|
113 |
#(FullSpec |
|
114 |
name: windowSpecForEmbedding |
|
115 |
window: |
|
116 |
(WindowSpec |
|
117 |
label: 'Select Changeset (embedding)' |
|
118 |
name: 'Select Changeset (embedding)' |
|
119 |
min: (Point 10 10) |
|
120 |
bounds: (Rectangle 0 0 406 337) |
|
121 |
) |
|
122 |
component: |
|
123 |
(SpecCollection |
|
124 |
collection: ( |
|
125 |
(LabelSpec |
|
126 |
label: 'Source:' |
|
127 |
name: 'SpecTypeLabel' |
|
128 |
layout: (LayoutFrame 3 0 3 0 100 0 25 0) |
|
129 |
translateLabel: true |
|
130 |
adjust: left |
|
131 |
) |
|
132 |
(PopUpListSpec |
|
133 |
label: 'Select...' |
|
134 |
name: 'SpecType' |
|
135 |
layout: (LayoutFrame 103 0 3 0 -3 1 25 0) |
|
136 |
tabable: true |
|
137 |
model: specLabelIndexHolder |
|
138 |
menu: specLabelList |
|
139 |
useIndex: true |
|
140 |
) |
|
141 |
(SubCanvasSpec |
|
142 |
name: 'SubCanvas1' |
|
143 |
layout: (LayoutFrame 3 0 30 0 -3 1 0 1) |
|
144 |
hasHorizontalScrollBar: false |
|
145 |
hasVerticalScrollBar: false |
|
146 |
specHolder: specEditorSpecHolder |
|
147 |
createNewBuilder: false |
|
148 |
) |
|
149 |
) |
|
150 |
||
151 |
) |
|
152 |
) |
|
153 |
! ! |
|
154 |
||
155 |
!ChangeSetSelectionDialog class methodsFor:'interface specs - editors'! |
|
156 |
||
157 |
editorSpecForDirectory |
|
158 |
"This resource specification was automatically generated |
|
159 |
by the UIPainter of ST/X." |
|
160 |
||
161 |
"Do not manually edit this!! If it is corrupted, |
|
162 |
the UIPainter may not be able to read the specification." |
|
163 |
||
164 |
" |
|
165 |
UIPainter new openOnClass:Tools::ChangeSetSelectionDialog andSelector:#editorSpecForDirectory |
|
166 |
Tools::ChangeSetSelectionDialog new openInterface:#editorSpecForDirectory |
|
167 |
" |
|
168 |
||
169 |
<resource: #canvas> |
|
170 |
||
171 |
^ |
|
172 |
#(FullSpec |
|
173 |
name: editorSpecForDirectory |
|
174 |
window: |
|
175 |
(WindowSpec |
|
176 |
label: 'Directory Spec Editor' |
|
177 |
name: 'Directory Spec Editor' |
|
178 |
min: (Point 10 10) |
|
179 |
bounds: (Rectangle 0 0 441 310) |
|
180 |
) |
|
181 |
component: |
|
182 |
(SpecCollection |
|
183 |
collection: ( |
|
184 |
(FilenameInputFieldSpec |
|
185 |
name: 'Directory' |
|
186 |
layout: (LayoutFrame 103 0 0 0 0 1 22 0) |
|
187 |
model: directoryAspect |
|
188 |
acceptOnPointerLeave: true |
|
189 |
viewClassName: FilenameWidgetWithHistory |
|
190 |
) |
|
191 |
(LabelSpec |
|
192 |
label: 'Directory:' |
|
193 |
name: 'Label1' |
|
194 |
layout: (LayoutFrame 0 0 3 0 100 0 22 0) |
|
195 |
translateLabel: true |
|
196 |
adjust: left |
|
197 |
) |
|
198 |
) |
|
199 |
||
200 |
) |
|
201 |
) |
|
202 |
! |
|
203 |
||
204 |
editorSpecForPackage |
|
205 |
"This resource specification was automatically generated |
|
206 |
by the UIPainter of ST/X." |
|
207 |
||
208 |
"Do not manually edit this!! If it is corrupted, |
|
209 |
the UIPainter may not be able to read the specification." |
|
210 |
||
211 |
" |
|
212 |
UIPainter new openOnClass:Tools::ChangeSetSelectionDialog andSelector:#editorSpecForPackage |
|
213 |
Tools::ChangeSetSelectionDialog new openInterface:#editorSpecForPackage |
|
214 |
" |
|
215 |
||
216 |
<resource: #canvas> |
|
217 |
||
218 |
^ |
|
219 |
#(FullSpec |
|
220 |
name: 'editorSpecForPackage' |
|
221 |
window: |
|
222 |
(WindowSpec |
|
223 |
label: 'Package Spec Editor' |
|
224 |
name: 'Package Spec Editor' |
|
225 |
min: (Point 10 10) |
|
226 |
bounds: (Rectangle 0 0 441 310) |
|
227 |
) |
|
228 |
component: |
|
229 |
(SpecCollection |
|
230 |
collection: ( |
|
231 |
(LabelSpec |
|
232 |
label: 'Package:' |
|
233 |
name: 'Label1' |
|
234 |
layout: (LayoutFrame 0 0 3 0 100 0 22 0) |
|
235 |
translateLabel: true |
|
236 |
adjust: left |
|
237 |
) |
|
238 |
(InputFieldSpec |
|
239 |
name: 'EntryField1' |
|
240 |
layout: (LayoutFrame 103 0 0 0 -25 1 25 0) |
|
241 |
model: packageAspect |
|
242 |
acceptOnReturn: true |
|
243 |
acceptOnTab: true |
|
244 |
acceptOnPointerLeave: true |
|
245 |
entryCompletionBlock: packageCompletionBlock |
|
246 |
) |
|
247 |
(ActionButtonSpec |
|
248 |
label: '...' |
|
249 |
name: 'Button1' |
|
250 |
layout: (LayoutFrame -25 1 0 0 0 1 25 0) |
|
251 |
translateLabel: true |
|
252 |
model: selectPackage |
|
253 |
) |
|
254 |
) |
|
255 |
||
256 |
) |
|
257 |
) |
|
258 |
! ! |
|
259 |
||
260 |
!ChangeSetSelectionDialog class methodsFor:'plugIn spec'! |
|
261 |
||
262 |
aspectSelectors |
|
263 |
"This resource specification was automatically generated |
|
264 |
by the UIPainter of ST/X." |
|
265 |
||
266 |
"Do not manually edit this. If it is corrupted, |
|
267 |
the UIPainter may not be able to read the specification." |
|
268 |
||
269 |
"Return a description of exported aspects; |
|
270 |
these can be connected to aspects of an embedding application |
|
271 |
(if this app is embedded in a subCanvas)." |
|
272 |
||
273 |
^ #( |
|
274 |
#specHolder |
|
275 |
). |
|
276 |
||
277 |
"Modified: / 06-07-2011 / 10:57:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
278 |
! ! |
|
279 |
||
280 |
!ChangeSetSelectionDialog methodsFor:'actions'! |
|
281 |
||
282 |
selectPackage |
|
283 |
<resource: #uiCallback> |
|
284 |
||
285 |
self packageAspect value: |
|
286 |
(Dialog requestProject:'Select package' |
|
287 |
initialAnswer:nil |
|
288 |
suggestions:#()) |
|
289 |
||
290 |
"Modified: / 06-07-2011 / 10:43:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
291 |
! ! |
|
292 |
||
293 |
!ChangeSetSelectionDialog methodsFor:'aspects'! |
|
294 |
||
295 |
doAcceptEnabledHolder |
|
296 |
||
297 |
<resource: #uiAspect> |
|
298 |
||
299 |
|holder| |
|
300 |
||
301 |
(holder := builder bindingAt:#doAcceptEnabledHolder) isNil ifTrue:[ |
|
302 |
holder := (AspectAdaptor forAspect:#notNil) |
|
303 |
subjectChannel: self specHolder. |
|
304 |
builder aspectAt:#doAcceptEnabledHolder put:holder. |
|
305 |
]. |
|
306 |
^ holder. |
|
307 |
||
308 |
"Created: / 06-07-2011 / 10:48:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
309 |
! |
|
310 |
||
311 |
specEditorSpecHolder |
|
312 |
"return/create the 'specEditorSpecHolder' value holder (automatically generated)" |
|
313 |
||
314 |
specEditorSpecHolder isNil ifTrue:[ |
|
315 |
specEditorSpecHolder := ValueHolder new. |
|
316 |
]. |
|
317 |
^ specEditorSpecHolder |
|
318 |
! |
|
319 |
||
320 |
specHolder |
|
321 |
"return/create the 'specHolder' value holder (automatically generated)" |
|
322 |
||
323 |
specHolder isNil ifTrue:[ |
|
324 |
specHolder := ValueHolder new. |
|
325 |
specHolder addDependent:self. |
|
326 |
]. |
|
327 |
^ specHolder |
|
328 |
! |
|
329 |
||
330 |
specHolder:something |
|
331 |
"set the 'specHolder' value holder (automatically generated)" |
|
332 |
||
333 |
|oldValue newValue| |
|
334 |
||
335 |
specHolder notNil ifTrue:[ |
|
336 |
oldValue := specHolder value. |
|
337 |
specHolder removeDependent:self. |
|
338 |
]. |
|
339 |
specHolder := something. |
|
340 |
specHolder notNil ifTrue:[ |
|
341 |
specHolder addDependent:self. |
|
342 |
]. |
|
343 |
newValue := specHolder value. |
|
344 |
oldValue ~~ newValue ifTrue:[ |
|
345 |
self update:#value with:newValue from:specHolder. |
|
346 |
]. |
|
347 |
! |
|
348 |
||
349 |
specLabelIndexHolder |
|
350 |
"return/create the 'specLabelIndexHolder' value holder (automatically generated)" |
|
351 |
||
352 |
specLabelIndexHolder isNil ifTrue:[ |
|
353 |
specLabelIndexHolder := ValueHolder new. |
|
354 |
specLabelIndexHolder addDependent:self. |
|
355 |
]. |
|
356 |
^ specLabelIndexHolder |
|
357 |
! |
|
358 |
||
359 |
specLabelIndexHolder:something |
|
360 |
"set the 'specLabelIndexHolder' value holder (automatically generated)" |
|
361 |
||
362 |
|oldValue newValue| |
|
363 |
||
364 |
specLabelIndexHolder notNil ifTrue:[ |
|
365 |
oldValue := specLabelIndexHolder value. |
|
366 |
specLabelIndexHolder removeDependent:self. |
|
367 |
]. |
|
368 |
specLabelIndexHolder := something. |
|
369 |
specLabelIndexHolder notNil ifTrue:[ |
|
370 |
specLabelIndexHolder addDependent:self. |
|
371 |
]. |
|
372 |
newValue := specLabelIndexHolder value. |
|
373 |
oldValue ~~ newValue ifTrue:[ |
|
374 |
self update:#value with:newValue from:specLabelIndexHolder. |
|
375 |
]. |
|
376 |
! |
|
377 |
||
378 |
specLabelList |
|
379 |
<resource: #uiAspect> |
|
380 |
||
381 |
"automatically generated by UIPainter ..." |
|
382 |
||
383 |
"*** the code below creates a default model when invoked." |
|
384 |
"*** (which may not be the one you wanted)" |
|
385 |
"*** Please change as required and accept it in the browser." |
|
386 |
"*** (and replace this comment by something more useful ;-)" |
|
387 |
||
388 |
specLabelList isNil ifTrue:[ |
|
389 |
specLabelList := List withAll: |
|
390 |
(ChangeSetSpec specClasses collect:[:cls|cls label]) |
|
391 |
||
392 |
]. |
|
393 |
^ specLabelList. |
|
394 |
||
395 |
"Modified: / 05-07-2011 / 23:35:19 / jv" |
|
396 |
"Created: / 06-07-2011 / 09:49:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
397 |
! ! |
|
398 |
||
399 |
!ChangeSetSelectionDialog methodsFor:'aspects - spec'! |
|
400 |
||
401 |
directoryAspect |
|
402 |
<resource: #uiAspect> |
|
403 |
||
404 |
|holder| |
|
405 |
||
406 |
(holder := builder bindingAt:#directoryAspect) isNil ifTrue:[ |
|
407 |
holder := (AspectAdaptor forAspect:#directory) |
|
408 |
subjectChannel: self specHolder. |
|
409 |
builder aspectAt:#directoryAspect put:holder. |
|
410 |
]. |
|
411 |
^ holder. |
|
412 |
||
413 |
"Modified: / 06-07-2011 / 10:28:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
414 |
! |
|
415 |
||
416 |
packageAspect |
|
417 |
<resource: #uiAspect> |
|
418 |
||
419 |
|holder| |
|
420 |
||
421 |
(holder := builder bindingAt:#packageAspect) isNil ifTrue:[ |
|
422 |
holder := (AspectAdaptor forAspect:#package) |
|
423 |
subjectChannel: self specHolder. |
|
424 |
builder aspectAt:#packageAspect put:holder. |
|
425 |
]. |
|
426 |
^ holder. |
|
427 |
||
428 |
"Created: / 06-07-2011 / 10:28:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
429 |
! |
|
430 |
||
431 |
packageCompletionBlock |
|
432 |
||
433 |
^DoWhatIMeanSupport packageNameEntryCompletionBlock |
|
434 |
||
435 |
"Created: / 06-07-2011 / 10:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
436 |
! ! |
|
437 |
||
438 |
!ChangeSetSelectionDialog methodsFor:'change & update'! |
|
439 |
||
440 |
update:something with:aParameter from:changedObject |
|
441 |
changedObject == specLabelIndexHolder |
|
442 |
ifTrue: |
|
443 |
[ self updateSpec. |
|
444 |
^ self. ]. |
|
445 |
changedObject == specHolder |
|
446 |
ifTrue: |
|
447 |
[ self updateSpecEditor. |
|
448 |
^ self. ]. |
|
449 |
super |
|
450 |
update:something |
|
451 |
with:aParameter |
|
452 |
from:changedObject |
|
453 |
||
454 |
"Modified: / 05-07-2011 / 23:53:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
455 |
! |
|
456 |
||
457 |
updateSpec |
|
458 |
|changeSetSpecClass changeSetSpec| |
|
459 |
||
460 |
changeSetSpecClass := ChangeSetSpec specClasses |
|
461 |
at:specLabelIndexHolder value. |
|
462 |
changeSetSpec := changeSetSpecClass new. |
|
463 |
self specHolder value:changeSetSpec. |
|
464 |
||
465 |
"Created: / 05-07-2011 / 23:51:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
466 |
! |
|
467 |
||
468 |
updateSpecEditor |
|
469 |
||
470 |
| spec | |
|
471 |
spec := self specHolder value. |
|
472 |
spec ifNil:[ |
|
473 |
self specEditorSpecHolder value: nil |
|
474 |
] ifNotNil:[ |
|
475 |
self specEditorSpecHolder value: spec editorSpecSelector |
|
476 |
] |
|
477 |
||
478 |
"Created: / 05-07-2011 / 23:53:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
479 |
! ! |
|
480 |
||
481 |
!ChangeSetSelectionDialog class methodsFor:'documentation'! |
|
482 |
||
483 |
version_CVS |
|
10741
e4645cbb0958
Fix package def libbasic3->libtool
Stefan Vogel <sv@exept.de>
parents:
10193
diff
changeset
|
484 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeSetSelectionDialog.st,v 1.2 2011-10-02 19:52:17 stefan Exp $' |
10193 | 485 |
! ! |