5715
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
3538
|
3 |
"
|
|
4 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
5 |
All Rights Reserved
|
|
6 |
|
|
7 |
This software is furnished under a license and may be used
|
|
8 |
only in accordance with the terms of that license and with the
|
|
9 |
inclusion of the above copyright notice. This software may not
|
|
10 |
be provided or otherwise made available to, or used by, any
|
|
11 |
other person. No title to or ownership of the software is
|
|
12 |
hereby transferred.
|
|
13 |
"
|
|
14 |
"{ Package: 'stx:libwidg2' }"
|
|
15 |
|
5304
|
16 |
"{ NameSpace: Smalltalk }"
|
|
17 |
|
3538
|
18 |
ActivityNotification subclass:#ProgressNotification
|
5318
|
19 |
instanceVariableNames:'statusInfo'
|
3538
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Kernel-Exceptions-Notifications'
|
|
23 |
!
|
|
24 |
|
|
25 |
!ProgressNotification class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
30 |
All Rights Reserved
|
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
5318
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
5543
|
43 |
This should be used in long-going activities to tell the caller about any
|
|
44 |
progress (percentage).
|
5318
|
45 |
Being a notification, it will be ignored if no one is interested.
|
|
46 |
If someone is interested, the caller may present this information as a progress-bar,
|
|
47 |
percentage display or whatever is useful in the UI.
|
|
48 |
Examples are:
|
|
49 |
http-requests, ftp requests, long lint checks etc.
|
|
50 |
|
5715
|
51 |
See examples (look for references to this class) on how this is used.
|
|
52 |
|
|
53 |
ProgressNotification handle:[:ex |
|
|
54 |
Transcript showCR:(ex progressValue rounded).
|
|
55 |
ex proceed.
|
|
56 |
] do:[
|
|
57 |
#(0 1 2 3 4 5 6 6 7 8 9)
|
|
58 |
do:[:i| Delay waitForMilliseconds: 50]
|
|
59 |
displayingProgress: 'Progress'
|
|
60 |
].
|
|
61 |
|
5318
|
62 |
"
|
3538
|
63 |
! !
|
|
64 |
|
4157
|
65 |
!ProgressNotification class methodsFor:'notification'!
|
3539
|
66 |
|
5715
|
67 |
notify:message progress:aPercentageNumber
|
4157
|
68 |
^ self new
|
4138
|
69 |
messageText: message;
|
5715
|
70 |
parameter: aPercentageNumber;
|
4138
|
71 |
raiseRequest
|
|
72 |
|
|
73 |
"Created: / 31-07-2012 / 16:13:54 / cg"
|
|
74 |
!
|
|
75 |
|
3539
|
76 |
progressPercentage:aPercentageNumber
|
5500
|
77 |
^ self basicNew
|
|
78 |
raiseRequestWith:aPercentageNumber
|
|
79 |
in:thisContext sender
|
|
80 |
|
|
81 |
"Modified: / 23-02-2017 / 16:51:52 / cg"
|
|
82 |
!
|
|
83 |
|
|
84 |
progressPercentage:aPercentageNumber statusInfo:statusInfo
|
|
85 |
^ self basicNew
|
|
86 |
statusInfo:statusInfo;
|
|
87 |
raiseRequestWith:aPercentageNumber
|
|
88 |
in:thisContext sender
|
|
89 |
|
|
90 |
"Created: / 23-02-2017 / 16:52:11 / cg"
|
3539
|
91 |
! !
|
|
92 |
|
5304
|
93 |
!ProgressNotification methodsFor:'accessing'!
|
3539
|
94 |
|
|
95 |
progressValue
|
5715
|
96 |
"answer the parameter that was passed to the notification requrest
|
|
97 |
as percentage parameter"
|
|
98 |
|
3539
|
99 |
^ parameter
|
5318
|
100 |
!
|
|
101 |
|
|
102 |
statusInfo
|
|
103 |
"any additional info (opaque to me)"
|
|
104 |
|
|
105 |
^ statusInfo
|
|
106 |
!
|
|
107 |
|
|
108 |
statusInfo:something
|
|
109 |
"any additional info (opaque to me)"
|
|
110 |
|
|
111 |
statusInfo := something.
|
3539
|
112 |
! !
|
|
113 |
|
3538
|
114 |
!ProgressNotification class methodsFor:'documentation'!
|
|
115 |
|
|
116 |
version
|
5304
|
117 |
^ '$Header$'
|
3538
|
118 |
! !
|
5304
|
119 |
|