author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 05 Feb 2012 02:51:58 +0100 | |
changeset 977 | 927c21edb951 |
parent 826 | 6de72a06e3aa |
child 1003 | f44ca95322e6 |
permissions | -rw-r--r-- |
747 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany |
|
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
422 | 26 |
"{ Package: 'stx:libsvn' }" |
61 | 27 |
|
28 |
"{ NameSpace: SVN }" |
|
29 |
||
30 |
SimpleDialog subclass:#Dialog |
|
747 | 31 |
instanceVariableNames:'onCancelBlock onAcceptBlock modelHolder titleHolder |
32 |
subtitleHolder infoHolder progressIndicator worker exception' |
|
33 |
classVariableNames:'CatchExceptions' |
|
61 | 34 |
poolDictionaries:'' |
35 |
category:'SVN-UI-Dialogs' |
|
36 |
! |
|
37 |
||
747 | 38 |
!Dialog class methodsFor:'documentation'! |
39 |
||
40 |
copyright |
|
41 |
" |
|
42 |
Copyright (c) 2007-2010 Jan Vrany |
|
43 |
Copyright (c) 2009-2010 eXept Software AG |
|
44 |
||
45 |
Permission is hereby granted, free of charge, to any person |
|
46 |
obtaining a copy of this software and associated documentation |
|
47 |
files (the 'Software'), to deal in the Software without |
|
48 |
restriction, including without limitation the rights to use, |
|
49 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
50 |
copies of the Software, and to permit persons to whom the |
|
51 |
Software is furnished to do so, subject to the following |
|
52 |
conditions: |
|
53 |
||
54 |
The above copyright notice and this permission notice shall be |
|
55 |
included in all copies or substantial portions of the Software. |
|
56 |
||
57 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
58 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
59 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
60 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
61 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
62 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
63 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
64 |
OTHER DEALINGS IN THE SOFTWARE. |
|
65 |
||
66 |
" |
|
67 |
! ! |
|
61 | 68 |
|
69 |
!Dialog class methodsFor:'instance creation'! |
|
70 |
||
71 |
on: model |
|
72 |
||
73 |
^self new |
|
74 |
model: model; |
|
75 |
yourself |
|
76 |
||
77 |
"Created: / 14-04-2008 / 11:09:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
78 |
! ! |
|
79 |
||
747 | 80 |
!Dialog class methodsFor:'accessing'! |
81 |
||
82 |
catchExceptions |
|
83 |
||
84 |
^CatchExceptions isNil or:[CatchExceptions] |
|
85 |
||
86 |
"Created: / 09-12-2009 / 16:22:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
87 |
! |
|
88 |
||
89 |
catchExceptions: aBoolean |
|
90 |
||
91 |
CatchExceptions := aBoolean |
|
92 |
||
93 |
"Created: / 09-12-2009 / 16:22:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
94 |
! ! |
|
95 |
||
61 | 96 |
!Dialog class methodsFor:'image specs'! |
97 |
||
98 |
dialogIcon |
|
99 |
^ IconLibrary svn_wizban |
|
100 |
||
101 |
"Created: / 13-04-2008 / 11:06:56 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
747 | 102 |
! |
103 |
||
104 |
downArrow |
|
105 |
"This resource specification was automatically generated |
|
106 |
by the ImageEditor of ST/X." |
|
107 |
||
108 |
"Do not manually edit this!! If it is corrupted, |
|
109 |
the ImageEditor may not be able to read the specification." |
|
110 |
||
111 |
" |
|
112 |
self downArrow inspect |
|
113 |
ImageEditor openOnClass:self andSelector:#downArrow |
|
114 |
Icon flushCachedIcons |
|
115 |
" |
|
116 |
||
117 |
<resource: #image> |
|
118 |
||
119 |
^Icon |
|
120 |
constantNamed:'SVN::Dialog class downArrow' |
|
121 |
ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@C?@O<@_ @<@A @@@@@@@@@@@@@@b') ; yourself); yourself] |
|
122 |
! |
|
123 |
||
124 |
errorIcon |
|
125 |
^ ToolbarIconLibrary error32x32Icon |
|
126 |
||
127 |
"Created: / 09-12-2009 / 16:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
61 | 128 |
! ! |
129 |
||
130 |
!Dialog class methodsFor:'interface opening'! |
|
131 |
||
132 |
openOn: model |
|
133 |
||
134 |
||
135 |
^(self on: model) open |
|
136 |
||
137 |
"Created: / 14-04-2008 / 11:09:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
138 |
"Modified: / 19-04-2008 / 13:17:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
139 |
! ! |
|
140 |
||
141 |
!Dialog class methodsFor:'interface specs'! |
|
142 |
||
143 |
buttonsSpec |
|
144 |
"This resource specification was automatically generated |
|
145 |
by the UIPainter of ST/X." |
|
146 |
||
147 |
"Do not manually edit this!! If it is corrupted, |
|
148 |
the UIPainter may not be able to read the specification." |
|
149 |
||
150 |
" |
|
151 |
UIPainter new openOnClass:SVN::Dialog andSelector:#buttonsSpec |
|
152 |
SVN::Dialog new openInterface:#buttonsSpec |
|
153 |
" |
|
154 |
||
155 |
<resource: #canvas> |
|
156 |
||
157 |
^ |
|
158 |
#(FullSpec |
|
159 |
name: buttonsSpec |
|
160 |
window: |
|
161 |
(WindowSpec |
|
162 |
label: 'Buttons' |
|
163 |
name: 'Buttons' |
|
164 |
min: (Point 10 10) |
|
165 |
bounds: (Rectangle 0 0 400 30) |
|
166 |
) |
|
167 |
component: |
|
168 |
(SpecCollection |
|
169 |
collection: ( |
|
170 |
(HorizontalPanelViewSpec |
|
171 |
name: 'ButtonPanel' |
|
172 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
173 |
horizontalLayout: rightSpace |
|
174 |
verticalLayout: center |
|
175 |
horizontalSpace: 3 |
|
176 |
verticalSpace: 3 |
|
177 |
component: |
|
178 |
(SpecCollection |
|
179 |
collection: ( |
|
180 |
(ActionButtonSpec |
|
181 |
label: 'OK' |
|
182 |
name: 'AcceptButton' |
|
183 |
translateLabel: true |
|
184 |
labelChannel: acceptButtonTitleAspect |
|
185 |
model: doAccept |
|
747 | 186 |
enableChannel: acceptEnabledHolder |
61 | 187 |
extent: (Point 125 22) |
188 |
) |
|
189 |
(ActionButtonSpec |
|
190 |
label: 'Cancel' |
|
191 |
name: 'CancelButton' |
|
192 |
translateLabel: true |
|
193 |
model: doCancel |
|
194 |
extent: (Point 125 22) |
|
195 |
) |
|
196 |
) |
|
197 |
||
198 |
) |
|
199 |
) |
|
200 |
) |
|
201 |
||
202 |
) |
|
203 |
) |
|
204 |
! |
|
205 |
||
206 |
contentSpec |
|
207 |
"This resource specification was automatically generated |
|
208 |
by the UIPainter of ST/X." |
|
209 |
||
210 |
"Do not manually edit this!! If it is corrupted, |
|
211 |
the UIPainter may not be able to read the specification." |
|
212 |
||
213 |
" |
|
214 |
UIPainter new openOnClass:SVN::Dialog andSelector:#contentSpec |
|
215 |
SVN::Dialog new openInterface:#contentSpec |
|
216 |
" |
|
217 |
||
218 |
<resource: #canvas> |
|
219 |
||
220 |
^ |
|
221 |
#(FullSpec |
|
222 |
name: contentSpec |
|
223 |
window: |
|
224 |
(WindowSpec |
|
225 |
label: 'Dialog' |
|
226 |
name: 'Dialog' |
|
227 |
min: (Point 10 10) |
|
228 |
bounds: (Rectangle 0 0 300 300) |
|
229 |
) |
|
230 |
component: |
|
231 |
(SpecCollection |
|
232 |
collection: ( |
|
233 |
(LabelSpec |
|
234 |
label: 'You should override #contentSpec' |
|
235 |
name: 'Message' |
|
236 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
237 |
translateLabel: true |
|
238 |
) |
|
239 |
) |
|
240 |
||
241 |
) |
|
242 |
) |
|
243 |
! |
|
244 |
||
747 | 245 |
errorSpec |
246 |
"This resource specification was automatically generated |
|
247 |
by the UIPainter of ST/X." |
|
248 |
||
249 |
"Do not manually edit this!! If it is corrupted, |
|
250 |
the UIPainter may not be able to read the specification." |
|
251 |
||
252 |
" |
|
253 |
UIPainter new openOnClass:SVN::Dialog andSelector:#errorSpec |
|
254 |
SVN::Dialog new openInterface:#errorSpec |
|
255 |
" |
|
256 |
||
257 |
<resource: #canvas> |
|
258 |
||
259 |
^ |
|
260 |
#(FullSpec |
|
261 |
name: errorSpec |
|
262 |
window: |
|
263 |
(WindowSpec |
|
264 |
label: 'Error' |
|
265 |
name: 'Error' |
|
266 |
min: (Point 10 10) |
|
267 |
bounds: (Rectangle 0 0 300 300) |
|
268 |
) |
|
269 |
component: |
|
270 |
(SpecCollection |
|
271 |
collection: ( |
|
272 |
(LabelSpec |
|
273 |
label: 'errorIcon' |
|
274 |
name: 'ErrorIcon' |
|
275 |
layout: (LayoutFrame 0 0 0 0 35 0 35 0) |
|
276 |
hasCharacterOrientedLabel: false |
|
277 |
translateLabel: true |
|
278 |
) |
|
279 |
(LabelSpec |
|
280 |
name: 'ErrorMessage' |
|
281 |
layout: (LayoutFrame 35 0 0 0 0 1 0 1) |
|
282 |
translateLabel: true |
|
283 |
labelChannel: infoHolder |
|
284 |
) |
|
285 |
) |
|
286 |
||
287 |
) |
|
288 |
) |
|
289 |
! |
|
290 |
||
61 | 291 |
messageSpec |
292 |
"This resource specification was automatically generated |
|
293 |
by the UIPainter of ST/X." |
|
294 |
||
295 |
"Do not manually edit this!! If it is corrupted, |
|
296 |
the UIPainter may not be able to read the specification." |
|
297 |
||
298 |
" |
|
299 |
UIPainter new openOnClass:SVN::Dialog andSelector:#messageSpec |
|
300 |
SVN::Dialog new openInterface:#messageSpec |
|
301 |
" |
|
302 |
||
303 |
<resource: #canvas> |
|
304 |
||
305 |
^ |
|
306 |
#(FullSpec |
|
307 |
name: messageSpec |
|
308 |
window: |
|
309 |
(WindowSpec |
|
310 |
label: 'Message' |
|
311 |
name: 'Message' |
|
312 |
min: (Point 10 10) |
|
313 |
bounds: (Rectangle 0 0 300 300) |
|
314 |
) |
|
315 |
component: |
|
316 |
(SpecCollection |
|
317 |
collection: ( |
|
318 |
(HTMLViewSpec |
|
319 |
name: 'HTMLBrowser' |
|
320 |
layout: (LayoutFrame 20 0 20 0 -20 1 -20 1) |
|
321 |
level: 0 |
|
322 |
hasHorizontalScrollBar: true |
|
323 |
hasVerticalScrollBar: true |
|
324 |
htmlText: infoHolder |
|
325 |
) |
|
326 |
) |
|
327 |
||
328 |
) |
|
329 |
) |
|
330 |
! |
|
331 |
||
332 |
progressSpec |
|
333 |
"This resource specification was automatically generated |
|
334 |
by the UIPainter of ST/X." |
|
335 |
||
336 |
"Do not manually edit this!! If it is corrupted, |
|
337 |
the UIPainter may not be able to read the specification." |
|
338 |
||
339 |
" |
|
340 |
UIPainter new openOnClass:SVN::Dialog andSelector:#progressSpec |
|
341 |
SVN::Dialog new openInterface:#progressSpec |
|
342 |
" |
|
343 |
||
344 |
<resource: #canvas> |
|
345 |
||
346 |
^ |
|
347 |
#(FullSpec |
|
348 |
name: progressSpec |
|
349 |
window: |
|
350 |
(WindowSpec |
|
351 |
label: 'Progress' |
|
352 |
name: 'Progress' |
|
353 |
min: (Point 10 10) |
|
354 |
bounds: (Rectangle 0 0 300 300) |
|
355 |
) |
|
356 |
component: |
|
357 |
(SpecCollection |
|
358 |
collection: ( |
|
359 |
(VerticalPanelViewSpec |
|
360 |
name: 'InfoPanel' |
|
361 |
layout: (LayoutFrame 20 0 20 0 -20 1 -20 1) |
|
362 |
horizontalLayout: fit |
|
363 |
verticalLayout: center |
|
364 |
horizontalSpace: 3 |
|
365 |
verticalSpace: 3 |
|
366 |
component: |
|
367 |
(SpecCollection |
|
368 |
collection: ( |
|
369 |
(LabelSpec |
|
370 |
label: 'Working' |
|
371 |
name: 'InfoHolder' |
|
372 |
translateLabel: true |
|
373 |
labelChannel: infoHolder |
|
374 |
adjust: left |
|
375 |
useDefaultExtent: true |
|
376 |
) |
|
377 |
(ProgressIndicatorSpec |
|
378 |
name: 'ProgressIndicator' |
|
379 |
model: progressHolder |
|
380 |
isActivityIndicator: true |
|
381 |
postBuildCallback: postBuildProgressIndicator: |
|
382 |
useDefaultExtent: true |
|
383 |
) |
|
384 |
) |
|
385 |
||
386 |
) |
|
387 |
) |
|
388 |
) |
|
389 |
||
390 |
) |
|
391 |
) |
|
392 |
! |
|
393 |
||
394 |
windowSpec |
|
395 |
"This resource specification was automatically generated |
|
396 |
by the UIPainter of ST/X." |
|
397 |
||
398 |
"Do not manually edit this!! If it is corrupted, |
|
399 |
the UIPainter may not be able to read the specification." |
|
400 |
||
401 |
" |
|
402 |
UIPainter new openOnClass:SVN::Dialog andSelector:#windowSpec |
|
403 |
SVN::Dialog new openInterface:#windowSpec |
|
404 |
SVN::Dialog open |
|
405 |
" |
|
406 |
||
407 |
<resource: #canvas> |
|
408 |
||
409 |
^ |
|
410 |
#(FullSpec |
|
411 |
name: windowSpec |
|
412 |
window: |
|
413 |
(WindowSpec |
|
414 |
label: 'SubVersion: Commit ' |
|
415 |
name: 'SubVersion: Commit ' |
|
416 |
labelChannel: titleHolder |
|
417 |
min: (Point 10 10) |
|
418 |
bounds: (Rectangle 0 0 648 451) |
|
419 |
) |
|
420 |
component: |
|
421 |
(SpecCollection |
|
422 |
collection: ( |
|
423 |
(ViewSpec |
|
424 |
name: 'TitleBox' |
|
425 |
layout: (LayoutFrame 0 0 0 0 0 1 66 0) |
|
426 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
427 |
component: |
|
428 |
(SpecCollection |
|
429 |
collection: ( |
|
430 |
(LabelSpec |
|
431 |
label: 'SVN Dialog' |
|
432 |
name: 'DialogTitle' |
|
433 |
layout: (LayoutFrame 10 0 0 0 -75 1 40 0) |
|
434 |
style: (FontDescription helvetica medium roman 18 #'iso10646-1') |
|
435 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
436 |
translateLabel: true |
|
437 |
labelChannel: titleHolder |
|
438 |
adjust: left |
|
439 |
) |
|
440 |
(LabelSpec |
|
441 |
label: 'SVN Dialog Subtitle' |
|
442 |
name: 'DialogSubtitle' |
|
443 |
layout: (LayoutFrame 30 0 40 0 -75 1 66 0) |
|
444 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
445 |
translateLabel: true |
|
446 |
labelChannel: subtitleHolder |
|
447 |
resizeForLabel: false |
|
448 |
adjust: left |
|
449 |
) |
|
450 |
(LabelSpec |
|
451 |
label: 'Icon' |
|
452 |
name: 'DialogIcon' |
|
453 |
layout: (LayoutFrame -75 1 0 0 0 1 66 0) |
|
454 |
hasCharacterOrientedLabel: false |
|
455 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
456 |
translateLabel: true |
|
457 |
labelChannel: dialogIconAspect |
|
458 |
) |
|
459 |
) |
|
460 |
||
461 |
) |
|
462 |
) |
|
463 |
(SubCanvasSpec |
|
464 |
name: 'Content' |
|
465 |
layout: (LayoutFrame 5 0 70 0 -5 1 -50 1) |
|
466 |
hasHorizontalScrollBar: false |
|
467 |
hasVerticalScrollBar: false |
|
468 |
specHolder: contentSpecHolder |
|
469 |
createNewBuilder: false |
|
470 |
) |
|
471 |
(DividerSpec |
|
472 |
name: 'Separator' |
|
473 |
layout: (LayoutFrame 5 0 -50 1 -5 1 -30 1) |
|
474 |
) |
|
475 |
(UISubSpecification |
|
476 |
name: 'Buttons' |
|
747 | 477 |
layout: (LayoutFrame 130 0 -30 1 0 1 0 1) |
61 | 478 |
minorKey: buttonsSpec |
479 |
) |
|
747 | 480 |
(LinkButtonSpec |
481 |
label: 'Help' |
|
482 |
name: 'Help' |
|
483 |
layout: (LayoutFrame 30 0 -30 1 130 0 0 1) |
|
484 |
style: (FontDescription helvetica medium roman 12) |
|
977 | 485 |
initiallyInvisible: true |
486 |
foregroundColor: (Color 0.0 0.0 86.9993133440147) |
|
747 | 487 |
translateLabel: true |
488 |
model: doHelp |
|
489 |
) |
|
490 |
(MenuPanelSpec |
|
491 |
name: 'More' |
|
492 |
layout: (LayoutFrame 0 0 -30 1 30 0 0 1) |
|
493 |
level: 0 |
|
494 |
model: doInspect |
|
495 |
menu: actionsMenu |
|
496 |
) |
|
61 | 497 |
) |
498 |
||
499 |
) |
|
500 |
) |
|
501 |
! ! |
|
502 |
||
747 | 503 |
!Dialog class methodsFor:'menu specs'! |
504 |
||
505 |
actionsMenu |
|
506 |
"This resource specification was automatically generated |
|
507 |
by the MenuEditor of ST/X." |
|
508 |
||
509 |
"Do not manually edit this!! If it is corrupted, |
|
510 |
the MenuEditor may not be able to read the specification." |
|
511 |
||
512 |
" |
|
513 |
MenuEditor new openOnClass:SVN::Dialog andSelector:#actionsMenu |
|
514 |
(Menu new fromLiteralArrayEncoding:(SVN::Dialog actionsMenu)) startUp |
|
515 |
" |
|
516 |
||
517 |
<resource: #menu> |
|
518 |
||
519 |
^ |
|
520 |
#(Menu |
|
521 |
( |
|
522 |
(MenuItem |
|
523 |
label: 'ActionsMenu' |
|
524 |
translateLabel: true |
|
525 |
submenu: |
|
526 |
(Menu |
|
527 |
( |
|
528 |
(MenuItem |
|
529 |
label: 'Catch exceptions' |
|
530 |
translateLabel: true |
|
531 |
indication: catchExceptionsAspect |
|
532 |
) |
|
533 |
(MenuItem |
|
534 |
label: 'Inspect model' |
|
535 |
itemValue: doInspect |
|
536 |
translateLabel: true |
|
537 |
) |
|
538 |
(MenuItem |
|
539 |
label: 'Inspect dialog' |
|
540 |
itemValue: doInspectDialog |
|
541 |
translateLabel: true |
|
542 |
) |
|
543 |
) |
|
544 |
nil |
|
545 |
nil |
|
546 |
) |
|
547 |
labelImage: (ResourceRetriever #'SVN::Dialog' downArrow) |
|
548 |
) |
|
549 |
) |
|
550 |
nil |
|
551 |
nil |
|
552 |
) |
|
553 |
! ! |
|
554 |
||
555 |
!Dialog class methodsFor:'others'! |
|
556 |
||
557 |
version_CVS |
|
826
6de72a06e3aa
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
747
diff
changeset
|
558 |
^ '$Header$' |
747 | 559 |
! ! |
560 |
||
61 | 561 |
!Dialog methodsFor:'accessing'! |
562 |
||
747 | 563 |
acceptButtonLabel |
564 |
^ 'OK' |
|
61 | 565 |
|
566 |
"Created: / 13-04-2008 / 11:06:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
567 |
! |
|
568 |
||
747 | 569 |
acceptEnabled |
570 |
^ self acceptEnabledHolder value |
|
61 | 571 |
|
572 |
"Created: / 16-08-2009 / 17:18:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
573 |
! |
|
574 |
||
747 | 575 |
acceptEnabled:aBoolean |
576 |
self acceptEnabledHolder value:aBoolean |
|
61 | 577 |
|
578 |
"Created: / 03-10-2008 / 14:29:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
579 |
! |
|
580 |
||
581 |
contentSpec |
|
582 |
||
583 |
^self contentSpecHolder value |
|
584 |
||
585 |
"Created: / 21-10-2008 / 12:39:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
586 |
! |
|
587 |
||
588 |
contentSpec: aSymbol |
|
589 |
||
590 |
self contentSpecHolder value: aSymbol |
|
591 |
||
592 |
"Created: / 21-10-2008 / 12:38:56 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
593 |
! |
|
594 |
||
595 |
info: aString |
|
596 |
||
597 |
^self infoHolder value: aString |
|
598 |
||
599 |
"Created: / 09-04-2009 / 08:00:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
600 |
! |
|
601 |
||
602 |
model |
|
603 |
^self modelHolder value |
|
604 |
||
605 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
606 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
607 |
! |
|
608 |
||
609 |
model:aModel |
|
610 |
self modelHolder subjectChannel:aModel |
|
611 |
"aModel isValueModel |
|
612 |
ifTrue:[self modelHolder subjectChannel:aModel] |
|
613 |
ifFalse:[self modelHolder subject:aModel]." |
|
614 |
||
615 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
616 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
617 |
! |
|
618 |
||
619 |
modelHolder |
|
620 |
^ modelHolder |
|
621 |
ifNil:[ |
|
622 |
modelHolder := (AspectAdaptor subjectChannel:self defaultModel) |
|
623 |
forAspect:#value |
|
624 |
] |
|
625 |
||
626 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
627 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
628 |
"Modified: / 03-10-2008 / 14:57:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
629 |
! |
|
630 |
||
631 |
subtitle |
|
632 |
"return the value in 'dialogSubtitleHolder'" |
|
633 |
||
634 |
^ self subtitleHolder value |
|
635 |
||
636 |
"Created: / 22-10-2008 / 12:40:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
637 |
"Modified: / 09-04-2009 / 07:53:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
638 |
! |
|
639 |
||
640 |
subtitle:newValue |
|
641 |
"set the value in 'dialogSubtitleHolder'" |
|
642 |
||
643 |
self subtitleHolder value:' ' , newValue |
|
644 |
||
645 |
"Created: / 22-10-2008 / 12:40:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
646 |
"Modified: / 09-04-2009 / 07:53:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
647 |
! |
|
648 |
||
649 |
title |
|
650 |
||
651 |
^self dialogTitleAspect value |
|
652 |
||
653 |
"Created: / 22-10-2008 / 12:40:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
654 |
! |
|
655 |
||
656 |
title: aString |
|
657 |
||
658 |
^self titleHolder value: aString |
|
659 |
||
660 |
"Created: / 22-10-2008 / 12:40:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
661 |
"Modified: / 09-04-2009 / 14:12:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
662 |
! ! |
|
663 |
||
664 |
!Dialog methodsFor:'accessing - defaults'! |
|
665 |
||
666 |
defaultContentSpec |
|
667 |
||
668 |
^#contentSpec |
|
669 |
||
670 |
"Created: / 21-10-2008 / 12:35:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
671 |
! |
|
672 |
||
673 |
defaultModel |
|
674 |
^ nil |
|
675 |
||
676 |
"Created: / 03-10-2008 / 14:57:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
677 |
! |
|
678 |
||
679 |
defaultSubtitle |
|
680 |
||
681 |
^'' |
|
682 |
||
683 |
"Created: / 03-10-2008 / 13:54:08 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
684 |
! |
|
685 |
||
686 |
defaultTitle |
|
687 |
^ self subclassResponsibility |
|
688 |
||
689 |
"Created: / 03-10-2008 / 13:58:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
690 |
! ! |
|
691 |
||
692 |
!Dialog methodsFor:'actions'! |
|
693 |
||
694 |
doAccept |
|
747 | 695 |
self acceptEnabled ifTrue:[ |
696 |
super doAccept |
|
697 |
] |
|
61 | 698 |
|
699 |
"Created: / 16-08-2009 / 17:18:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
700 |
! |
|
701 |
||
702 |
doCancel |
|
703 |
||
747 | 704 |
"Terminate a worker process, if any" |
61 | 705 |
worker ifNotNil:[worker terminate]. |
747 | 706 |
"And close" |
61 | 707 |
super doCancel |
708 |
||
709 |
"Created: / 28-10-2008 / 14:47:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
747 | 710 |
! |
711 |
||
712 |
doHelp |
|
713 |
<resource: #uiCallback> |
|
714 |
||
715 |
Transcript showCR:self class name, ': action for doHelp ...'. |
|
716 |
! |
|
717 |
||
718 |
doInspect |
|
719 |
||
720 |
self model inspect |
|
721 |
! |
|
722 |
||
723 |
doInspectDialog |
|
724 |
||
725 |
self inspect |
|
726 |
||
727 |
"Created: / 10-03-2010 / 15:30:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
61 | 728 |
! ! |
729 |
||
730 |
!Dialog methodsFor:'aspects'! |
|
731 |
||
732 |
acceptButtonTitleAspect |
|
747 | 733 |
^ self acceptButtonLabel |
61 | 734 |
|
735 |
"Modified: / 31-03-2008 / 18:53:56 / janfrog" |
|
736 |
"Created: / 13-04-2008 / 11:08:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
737 |
! |
|
738 |
||
747 | 739 |
acceptEnabledHolder |
61 | 740 |
|holder| |
741 |
||
747 | 742 |
(holder := builder bindingAt:#acceptEnabledHolder) isNil ifTrue:[ |
61 | 743 |
holder := false asValue. |
747 | 744 |
builder aspectAt:#acceptEnabledHolder put:holder. |
61 | 745 |
]. |
747 | 746 |
^ holder. |
61 | 747 |
|
748 |
"Created: / 14-04-2008 / 11:17:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
749 |
"Modified: / 14-04-2008 / 12:56:08 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
750 |
! |
|
751 |
||
747 | 752 |
catchExceptionsAspect |
753 |
||
754 |
^(AspectAdaptor forAspect:#catchExceptions) |
|
755 |
subject: self class |
|
756 |
||
757 |
"Created: / 09-12-2009 / 16:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
758 |
! |
|
759 |
||
61 | 760 |
contentSpecHolder |
761 |
<resource: #uiAspect> |
|
762 |
||
763 |
|holder| |
|
764 |
||
765 |
(holder := builder bindingAt:#contentSpecHolder) isNil ifTrue:[ |
|
766 |
holder := self defaultContentSpec asValue. |
|
767 |
holder onChangeSend:#contentSpecChanged to: self. |
|
768 |
builder aspectAt:#contentSpecHolder put:holder. |
|
769 |
]. |
|
770 |
^ holder. |
|
771 |
||
772 |
"Created: / 21-10-2008 / 12:34:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
773 |
"Modified: / 22-10-2008 / 11:22:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
774 |
! |
|
775 |
||
776 |
dialogIconAspect |
|
777 |
^ self class dialogIcon |
|
778 |
||
779 |
"Created: / 13-04-2008 / 11:05:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
780 |
! |
|
781 |
||
782 |
infoHolder |
|
783 |
"return/create the 'infoHolder' value holder (automatically generated)" |
|
784 |
||
785 |
infoHolder isNil ifTrue:[ |
|
786 |
infoHolder := ValueHolder new. |
|
787 |
]. |
|
788 |
^ infoHolder |
|
789 |
! |
|
790 |
||
791 |
progressHolder |
|
792 |
<resource: #uiAspect> |
|
793 |
||
794 |
|holder| |
|
795 |
||
796 |
(holder := builder bindingAt:#progressHolder) isNil ifTrue:[ |
|
797 |
holder := nil asValue. |
|
798 |
builder aspectAt:#progressHolder put:holder. |
|
799 |
]. |
|
800 |
^ holder. |
|
801 |
||
802 |
"Created: / 21-10-2008 / 12:24:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
803 |
! |
|
804 |
||
805 |
subtitleHolder |
|
806 |
"return/create the valueHolder 'dialogSubtitleHolder'" |
|
807 |
||
808 |
subtitleHolder isNil ifTrue:[ |
|
809 |
subtitleHolder := self defaultSubtitle asValue |
|
810 |
]. |
|
811 |
^ subtitleHolder |
|
812 |
||
813 |
"Created: / 03-10-2008 / 13:53:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
814 |
"Modified: / 09-04-2009 / 07:53:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
815 |
! |
|
816 |
||
817 |
titleHolder |
|
818 |
titleHolder isNil ifTrue:[ |
|
819 |
titleHolder := self defaultTitle asValue. |
|
820 |
]. |
|
821 |
^titleHolder |
|
822 |
||
823 |
"Modified: / 31-03-2008 / 18:53:56 / janfrog" |
|
824 |
"Created: / 13-04-2008 / 11:05:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
825 |
"Modified: / 09-04-2009 / 07:52:33 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
826 |
! ! |
|
827 |
||
828 |
!Dialog methodsFor:'change & update'! |
|
829 |
||
830 |
contentSpecChanged |
|
831 |
||
832 |
self contentSpecChanged: self contentSpec |
|
833 |
||
834 |
"Created: / 22-10-2008 / 11:22:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
835 |
"Modified: / 06-11-2008 / 18:31:33 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
836 |
! |
|
837 |
||
838 |
contentSpecChanged: specSymbol |
|
839 |
||
840 |
"nothing to do here" |
|
841 |
||
842 |
"Created: / 06-11-2008 / 18:31:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
843 |
! ! |
|
844 |
||
747 | 845 |
!Dialog methodsFor:'events'! |
846 |
||
847 |
closeAccept |
|
848 |
||
849 |
[onAcceptBlock ifNotNil:[onAcceptBlock value: self]] |
|
850 |
ensure:[super closeAccept] |
|
851 |
! |
|
852 |
||
853 |
closeCancel |
|
854 |
||
855 |
[onCancelBlock ifNotNil:[onCancelBlock value: self]] |
|
856 |
ensure:[super closeCancel] |
|
857 |
! |
|
858 |
||
859 |
closeWindow |
|
860 |
||
861 |
worker |
|
862 |
ifNotNil:[worker addExitAction:[self closeWindow]] |
|
863 |
ifNil:[super closeWindow] |
|
864 |
||
865 |
"Created: / 01-11-2009 / 16:33:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
866 |
! ! |
|
867 |
||
61 | 868 |
!Dialog methodsFor:'hooks'! |
869 |
||
747 | 870 |
onAccept: aBlock |
871 |
||
872 |
onAcceptBlock := aBlock |
|
873 |
! |
|
874 |
||
875 |
onCancel: aBlock |
|
876 |
||
877 |
onCancelBlock := aBlock |
|
878 |
! |
|
879 |
||
61 | 880 |
postBuildProgressIndicator:aView |
881 |
<resource: #uiCallback> |
|
882 |
||
883 |
progressIndicator := aView |
|
884 |
||
885 |
"Modified: / 28-10-2008 / 12:50:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
886 |
! ! |
|
887 |
||
888 |
!Dialog methodsFor:'initialization'! |
|
889 |
||
890 |
initialize |
|
891 |
||
892 |
super initialize. |
|
893 |
self createBuilder |
|
894 |
||
895 |
"Created: / 22-10-2008 / 12:37:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
896 |
! ! |
|
897 |
||
747 | 898 |
!Dialog methodsFor:'private'! |
899 |
||
900 |
handleError: ex |
|
61 | 901 |
|
747 | 902 |
self class catchExceptions ifFalse:[ex pass]. |
903 |
self showError: ex description. |
|
904 |
||
905 |
"Created: / 09-12-2009 / 16:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
906 |
! |
|
907 |
||
908 |
handleNotification:ex |
|
61 | 909 |
|
747 | 910 |
self info:ex messageText. |
911 |
ex parameter isNumber |
|
912 |
ifTrue: |
|
913 |
[progressIndicator showBusyIndication:false. |
|
914 |
self progressHolder value:ex parameter] |
|
915 |
ifFalse: |
|
916 |
[progressIndicator showBusyIndication:true]. |
|
917 |
ex proceed. |
|
61 | 918 |
|
747 | 919 |
"Modified: / 09-12-2009 / 16:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920 |
! |
|
921 |
||
922 |
handleUserConfirmation: ex |
|
61 | 923 |
|
747 | 924 |
^ex proceedWith: ex defaultAction |
925 |
||
926 |
"Created: / 09-12-2009 / 16:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
927 |
! |
|
61 | 928 |
|
929 |
showContent |
|
930 |
||
931 |
self |
|
932 |
contentSpec: #contentSpec. |
|
933 |
||
934 |
"Created: / 09-04-2009 / 08:14:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
935 |
! |
|
936 |
||
747 | 937 |
showError: aString |
938 |
||
939 |
self |
|
940 |
info: aString; |
|
941 |
contentSpec: #errorSpec |
|
942 |
||
943 |
"Created: / 09-12-2009 / 16:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
944 |
! |
|
945 |
||
61 | 946 |
showMessage: aString |
947 |
||
948 |
self |
|
949 |
info: aString; |
|
950 |
contentSpec: #messageSpec. |
|
951 |
||
952 |
"Created: / 09-04-2009 / 08:14:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
953 |
! |
|
954 |
||
747 | 955 |
showProgressWhile:aBlock |
956 |
|prevSpec| |
|
61 | 957 |
|
958 |
prevSpec := self contentSpec. |
|
747 | 959 |
self contentSpec:#progressSpec. |
960 |
worker := |
|
961 |
[[ aBlock on: UserConfirmation do: [:ex|self handleUserConfirmation: ex] ] |
|
962 |
on: (ActivityNotification , ProgressNotification) |
|
963 |
do: [:ex|self handleNotification: ex] |
|
964 |
on: Error |
|
965 |
do: [:ex|self handleError: ex]. |
|
966 |
worker := nil] newProcess. |
|
61 | 967 |
worker |
747 | 968 |
addExitAction:[ |
969 |
self contentSpec == #progressSpec ifTrue:[ |
|
970 |
self contentSpec:prevSpec |
|
971 |
]. |
|
972 |
worker := nil |
|
973 |
]; |
|
61 | 974 |
resume. |
975 |
||
976 |
"Created: / 21-10-2008 / 12:07:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
977 |
"Modified: / 09-04-2009 / 08:28:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
747 | 978 |
"Modified: / 09-12-2009 / 16:42:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
61 | 979 |
! ! |
980 |
||
981 |
!Dialog class methodsFor:'documentation'! |
|
982 |
||
983 |
version |
|
826
6de72a06e3aa
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
747
diff
changeset
|
984 |
^ '$Header$' |
214 | 985 |
! |
986 |
||
987 |
version_SVN |
|
826
6de72a06e3aa
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
747
diff
changeset
|
988 |
^ '§Id: SVN__Dialog.st 363 2011-08-08 13:49:48Z vranyj1 §' |
61 | 989 |
! ! |