author | Claus Gittinger <cg@exept.de> |
Sat, 04 Oct 2008 10:42:31 +0200 | |
changeset 11198 | 090a44ec1648 |
parent 10823 | a2efd924729a |
child 11615 | e88c6cc8718c |
permissions | -rw-r--r-- |
4549 | 1 |
" |
2 |
COPYRIGHT (c) 1999 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 |
" |
|
6206 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
8816
a63ed6d60299
UserNotification is not an exception.
Claus Gittinger <cg@exept.de>
parents:
8703
diff
changeset
|
14 |
GenericException subclass:#UserNotification |
4549 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
11198 | 18 |
category:'Kernel-Exceptions-Notifications' |
4549 | 19 |
! |
20 |
||
21 |
!UserNotification class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1999 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 |
||
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
7038 | 40 |
UserNotification is the superclass of all user notification |
4549 | 41 |
exceptions in the system. It produces an info box with the message |
11198 | 42 |
on the screen. |
43 |
If no display is available, the message is written to the Transcript (headless operation). |
|
4549 | 44 |
|
45 |
[author:] |
|
46 |
Stefan Vogel |
|
47 |
||
48 |
[see also:] |
|
49 |
Signal |
|
50 |
" |
|
51 |
! |
|
52 |
||
53 |
examples |
|
54 |
" |
|
55 |
[exBegin] |
|
56 |
UserNotification raiseRequest |
|
57 |
[exEnd] |
|
4554 | 58 |
|
59 |
[exBegin] |
|
10814 | 60 |
UserNotification raiseErrorString:'huh ?' |
61 |
[exEnd] |
|
62 |
||
63 |
[exBegin] |
|
4554 | 64 |
UserNotification raiseRequestWith:nil errorString:'what ?' |
65 |
[exEnd] |
|
66 |
||
67 |
[exBegin] |
|
68 |
UserNotification raiseRequestWith:nil errorString:' what ?' |
|
69 |
[exEnd] |
|
4549 | 70 |
" |
71 |
! ! |
|
72 |
||
73 |
!UserNotification class methodsFor:'initialization'! |
|
74 |
||
75 |
initialize |
|
76 |
||
77 |
NotifierString := 'User Notification:'. |
|
78 |
||
79 |
" |
|
80 |
self initialize |
|
81 |
" |
|
82 |
||
83 |
"Created: / 23.7.1999 / 15:31:44 / stefan" |
|
84 |
! ! |
|
85 |
||
10823 | 86 |
!UserNotification class methodsFor:'notification'! |
87 |
||
88 |
notify:aString |
|
89 |
self raiseErrorString:aString |
|
90 |
! ! |
|
91 |
||
8703 | 92 |
!UserNotification class methodsFor:'testing'! |
7557 | 93 |
|
94 |
isQuerySignal |
|
95 |
^ true |
|
96 |
! ! |
|
97 |
||
4549 | 98 |
!UserNotification methodsFor:'default actions'! |
99 |
||
100 |
defaultAction |
|
5295 | 101 |
"Default action for notifications: open a info box with description" |
4549 | 102 |
|
103 |
|text| |
|
104 |
||
5295 | 105 |
text := self description. |
4549 | 106 |
|
10516 | 107 |
self hasDialog ifTrue:[ |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
108 |
Dialog information:text. |
4549 | 109 |
] ifFalse:[ |
110 |
" |
|
111 |
on systems without GUI, simply show |
|
112 |
the message on the Transcript. |
|
113 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
114 |
Transcript show:'notification: '; showCR:text. |
4549 | 115 |
]. |
116 |
self proceed. |
|
117 |
||
118 |
||
119 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
120 |
UserNotification raiseRequestErrorString:' abc' |
4549 | 121 |
" |
122 |
||
123 |
"Modified: / 3.8.1999 / 14:06:55 / stefan" |
|
124 |
! ! |
|
125 |
||
10516 | 126 |
!UserNotification methodsFor:'helpers'! |
127 |
||
128 |
hasDialog |
|
129 |
"answer true, if we can use a Dialog window" |
|
130 |
||
131 |
(Smalltalk isInitialized |
|
132 |
and:[Dialog notNil |
|
133 |
and:[Screen notNil |
|
134 |
and:[Screen current notNil |
|
135 |
and:[Screen current isOpen |
|
136 |
]]]]) ifTrue:[ |
|
137 |
Dialog autoload. "in case its autoloaded" |
|
138 |
^ true. |
|
139 |
]. |
|
140 |
^ false |
|
141 |
! ! |
|
142 |
||
4549 | 143 |
!UserNotification class methodsFor:'documentation'! |
144 |
||
145 |
version |
|
11198 | 146 |
^ '$Header: /cvs/stx/stx/libbasic/UserNotification.st,v 1.13 2008-10-04 08:42:31 cg Exp $' |
4549 | 147 |
! ! |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
148 |
|
4549 | 149 |
UserNotification initialize! |