author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 15 Jun 2009 20:55:05 +0100 | |
branch | jv |
changeset 17711 | 39faaaf888b4 |
parent 11204 | c6c94c53df21 |
child 17761 | b0e5971141bc |
permissions | -rw-r--r-- |
8728 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
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 |
" |
|
8385 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
8386 | 14 |
Notification subclass:#YesToAllConfirmation |
8385 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
11199 | 18 |
category:'Kernel-Exceptions-Notifications' |
8385 | 19 |
! |
20 |
||
8728 | 21 |
!YesToAllConfirmation class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
8385 | 36 |
|
11204
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
37 |
!YesToAllConfirmation class methodsFor:'queries'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
38 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
39 |
notify |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
40 |
"raise a notification; usually will be remembered in a handler for the next |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
41 |
query to return true" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
42 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
43 |
^ self raiseRequestWith:#yesToAll. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
44 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
45 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
46 |
!YesToAllConfirmation class methodsFor:'utilities'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
47 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
48 |
handleConfirmationIn:aBlock |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
49 |
"evaluate aBlock; |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
50 |
if inside that block, a query for YesToAll is raised, remember it and |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
51 |
answer it as required." |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
52 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
53 |
|alreadyAnswered| |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
54 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
55 |
alreadyAnswered := false. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
56 |
self handle:[:ex | |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
57 |
ex parameter == #yesToAll ifTrue:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
58 |
alreadyAnswered := true. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
59 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
60 |
ex proceedWith:alreadyAnswered |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
61 |
] do:aBlock. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
62 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
63 |
" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
64 |
YesToAllConfirmation |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
65 |
handleConfirmationIn:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
66 |
1 to:5 do:[:i | |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
67 |
|confirmed| |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
68 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
69 |
YesToAllConfirmation query ifFalse:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
70 |
confirmed := OptionBox |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
71 |
request:(i printString) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
72 |
label:('Ask again and again') |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
73 |
image:(YesNoBox iconBitmap) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
74 |
buttonLabels:#('Cancel' 'No' 'Yes' 'Yes to All') |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
75 |
values:#(nil false true #yesToAll) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
76 |
default:false |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
77 |
onCancel:false. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
78 |
confirmed == #yesToAll ifTrue:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
79 |
YesToAllConfirmation notify |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
80 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
81 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
82 |
Transcript showCR:i. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
83 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
84 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
85 |
" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
86 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
87 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
88 |
!YesToAllConfirmation methodsFor:'defaults'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
89 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
90 |
defaultResumeValue |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
91 |
^ false |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
92 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
93 |
|
8385 | 94 |
!YesToAllConfirmation class methodsFor:'documentation'! |
95 |
||
96 |
version |
|
17711 | 97 |
^ '$Id: YesToAllConfirmation.st 10447 2009-06-14 13:09:55Z vranyj1 $' |
8385 | 98 |
! ! |