author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 24 Oct 2009 16:48:19 +0100 | |
branch | jv |
changeset 17732 | a1892eeca6c0 |
parent 17711 | 39faaaf888b4 |
child 17734 | 406b1590afe8 |
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 |
||
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
14 |
Notification 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 |
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
41 |
signals in the system. It produces an info box with the message on the screen. |
11198 | 42 |
If no display is available, the message is written to the Transcript (headless operation). |
4549 | 43 |
|
44 |
[author:] |
|
45 |
Stefan Vogel |
|
46 |
||
47 |
[see also:] |
|
48 |
Signal |
|
49 |
" |
|
50 |
! |
|
51 |
||
52 |
examples |
|
53 |
" |
|
54 |
[exBegin] |
|
55 |
UserNotification raiseRequest |
|
56 |
[exEnd] |
|
4554 | 57 |
|
58 |
[exBegin] |
|
10814 | 59 |
UserNotification raiseErrorString:'huh ?' |
60 |
[exEnd] |
|
61 |
||
62 |
[exBegin] |
|
4554 | 63 |
UserNotification raiseRequestWith:nil errorString:'what ?' |
64 |
[exEnd] |
|
65 |
||
66 |
[exBegin] |
|
67 |
UserNotification raiseRequestWith:nil errorString:' what ?' |
|
68 |
[exEnd] |
|
4549 | 69 |
" |
70 |
! ! |
|
71 |
||
72 |
!UserNotification class methodsFor:'initialization'! |
|
73 |
||
74 |
initialize |
|
75 |
||
76 |
NotifierString := 'User Notification:'. |
|
77 |
||
78 |
" |
|
79 |
self initialize |
|
80 |
" |
|
81 |
||
82 |
"Created: / 23.7.1999 / 15:31:44 / stefan" |
|
83 |
! ! |
|
84 |
||
10823 | 85 |
!UserNotification class methodsFor:'notification'! |
86 |
||
87 |
notify:aString |
|
88 |
self raiseErrorString:aString |
|
89 |
! ! |
|
90 |
||
8703 | 91 |
!UserNotification class methodsFor:'testing'! |
7557 | 92 |
|
93 |
isQuerySignal |
|
94 |
^ true |
|
95 |
! ! |
|
96 |
||
4549 | 97 |
!UserNotification methodsFor:'default actions'! |
98 |
||
99 |
defaultAction |
|
5295 | 100 |
"Default action for notifications: open a info box with description" |
4549 | 101 |
|
102 |
|text| |
|
103 |
||
5295 | 104 |
text := self description. |
4549 | 105 |
|
10516 | 106 |
self hasDialog ifTrue:[ |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
107 |
Dialog information:text. |
4549 | 108 |
] ifFalse:[ |
109 |
" |
|
110 |
on systems without GUI, simply show |
|
111 |
the message on the Transcript. |
|
112 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
113 |
Transcript show:'notification: '; showCR:text. |
4549 | 114 |
]. |
115 |
self proceed. |
|
116 |
||
117 |
||
118 |
" |
|
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
119 |
UserNotification raiseRequestErrorString:' abc' |
4549 | 120 |
" |
121 |
||
122 |
"Modified: / 3.8.1999 / 14:06:55 / stefan" |
|
123 |
! ! |
|
124 |
||
10516 | 125 |
!UserNotification methodsFor:'helpers'! |
126 |
||
127 |
hasDialog |
|
128 |
"answer true, if we can use a Dialog window" |
|
129 |
||
130 |
(Smalltalk isInitialized |
|
131 |
and:[Dialog notNil |
|
132 |
and:[Screen notNil |
|
133 |
and:[Screen current notNil |
|
11615
e88c6cc8718c
care for dead display (non dispatching)
Claus Gittinger <cg@exept.de>
parents:
11198
diff
changeset
|
134 |
and:[Screen current isOpenAndDispatching |
10516 | 135 |
]]]]) ifTrue:[ |
136 |
Dialog autoload. "in case its autoloaded" |
|
137 |
^ true. |
|
138 |
]. |
|
139 |
^ false |
|
140 |
! ! |
|
141 |
||
4549 | 142 |
!UserNotification class methodsFor:'documentation'! |
143 |
||
144 |
version |
|
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
145 |
^ '$Id: UserNotification.st 10473 2009-10-24 15:48:19Z vranyj1 $' |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
146 |
! |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
147 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
148 |
version_CVS |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
149 |
^ '§Header: /cvs/stx/stx/libbasic/UserNotification.st,v 1.15 2009/10/14 17:34:46 cg Exp §' |
4549 | 150 |
! ! |
7032
3c0246b4e602
Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents:
6206
diff
changeset
|
151 |
|
4549 | 152 |
UserNotification initialize! |
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
153 |