author | Stefan Vogel <sv@exept.de> |
Mon, 16 Apr 2007 15:42:00 +0200 | |
changeset 10516 | c68c7db81428 |
parent 8816 | a63ed6d60299 |
child 10814 | 31ca937978d7 |
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:'' |
|
18 |
category:'Kernel-Exceptions' |
|
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 |
7038 | 42 |
on the screen. If no display is available, the message is written |
43 |
to the Transcript. |
|
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] |
|
60 |
UserNotification raiseRequestWith:nil errorString:'what ?' |
|
61 |
[exEnd] |
|
62 |
||
63 |
[exBegin] |
|
64 |
UserNotification raiseRequestWith:nil errorString:' what ?' |
|
65 |
[exEnd] |
|
4549 | 66 |
" |
67 |
||
68 |
! ! |
|
69 |
||
70 |
!UserNotification class methodsFor:'initialization'! |
|
71 |
||
72 |
initialize |
|
73 |
||
74 |
NotifierString := 'User Notification:'. |
|
75 |
||
76 |
" |
|
77 |
self initialize |
|
78 |
" |
|
79 |
||
80 |
"Created: / 23.7.1999 / 15:31:44 / stefan" |
|
81 |
! ! |
|
82 |
||
8703 | 83 |
!UserNotification class methodsFor:'testing'! |
7557 | 84 |
|
85 |
isQuerySignal |
|
86 |
^ true |
|
87 |
! ! |
|
88 |
||
4549 | 89 |
!UserNotification methodsFor:'default actions'! |
90 |
||
91 |
defaultAction |
|
5295 | 92 |
"Default action for notifications: open a info box with description" |
4549 | 93 |
|
94 |
|text| |
|
95 |
||
5295 | 96 |
text := self description. |
4549 | 97 |
|
10516 | 98 |
self hasDialog ifTrue:[ |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
99 |
Dialog information:text. |
4549 | 100 |
] ifFalse:[ |
101 |
" |
|
102 |
on systems without GUI, simply show |
|
103 |
the message on the Transcript. |
|
104 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
105 |
Transcript show:'notification: '; showCR:text. |
4549 | 106 |
]. |
107 |
self proceed. |
|
108 |
||
109 |
||
110 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
111 |
UserNotification raiseRequestErrorString:' abc' |
4549 | 112 |
" |
113 |
||
114 |
"Modified: / 3.8.1999 / 14:06:55 / stefan" |
|
115 |
! ! |
|
116 |
||
10516 | 117 |
!UserNotification methodsFor:'helpers'! |
118 |
||
119 |
hasDialog |
|
120 |
"answer true, if we can use a Dialog window" |
|
121 |
||
122 |
(Smalltalk isInitialized |
|
123 |
and:[Dialog notNil |
|
124 |
and:[Screen notNil |
|
125 |
and:[Screen current notNil |
|
126 |
and:[Screen current isOpen |
|
127 |
]]]]) ifTrue:[ |
|
128 |
Dialog autoload. "in case its autoloaded" |
|
129 |
^ true. |
|
130 |
]. |
|
131 |
^ false |
|
132 |
! ! |
|
133 |
||
4549 | 134 |
!UserNotification class methodsFor:'documentation'! |
135 |
||
136 |
version |
|
10516 | 137 |
^ '$Header: /cvs/stx/stx/libbasic/UserNotification.st,v 1.10 2007-04-16 13:42:00 stefan Exp $' |
4549 | 138 |
! ! |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
139 |
|
4549 | 140 |
UserNotification initialize! |