ProgressNotification.st
author mawalch
Mon, 22 May 2017 12:20:54 +0200
changeset 5543 68eca683b70d
parent 5500 821ec5a9d9c4
child 5715 7af87f717f65
permissions -rw-r--r--
#DOCUMENTATION by mawalch class: ProgressNotification class comment/format in: #documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2008 by eXept Software AG
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libwidg2' }"
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
5304
4b50bec89cd5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
    14
"{ NameSpace: Smalltalk }"
4b50bec89cd5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
    15
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ActivityNotification subclass:#ProgressNotification
5318
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    17
	instanceVariableNames:'statusInfo'
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Kernel-Exceptions-Notifications'
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!ProgressNotification class methodsFor:'documentation'!
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 2008 by eXept Software AG
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
              All Rights Reserved
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
5318
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    37
!
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    38
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    39
documentation
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    40
"
5543
68eca683b70d #DOCUMENTATION by mawalch
mawalch
parents: 5500
diff changeset
    41
    This should be used in long-going activities to tell the caller about any
68eca683b70d #DOCUMENTATION by mawalch
mawalch
parents: 5500
diff changeset
    42
    progress (percentage).
5318
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    43
    Being a notification, it will be ignored if no one is interested.
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    44
    If someone is interested, the caller may present this information as a progress-bar,
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    45
    percentage display or whatever is useful in the UI.
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    46
    Examples are:
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    47
        http-requests, ftp requests, long lint checks etc.
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    48
5543
68eca683b70d #DOCUMENTATION by mawalch
mawalch
parents: 5500
diff changeset
    49
    See examples on how this is used by searching for references to me.
5318
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    50
"
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
4157
67226e0d3d71 class: ProgressNotification
Stefan Vogel <sv@exept.de>
parents: 4138
diff changeset
    53
!ProgressNotification class methodsFor:'notification'!
3539
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    54
4138
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    55
notify: message progress: progress
4157
67226e0d3d71 class: ProgressNotification
Stefan Vogel <sv@exept.de>
parents: 4138
diff changeset
    56
    ^ self new
4138
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    57
        messageText: message;
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    58
        parameter: progress;
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    59
        raiseRequest
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    60
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    61
    "Created: / 31-07-2012 / 16:13:54 / cg"
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    62
!
e65b7c94ed2f added: #notify:progress:
Claus Gittinger <cg@exept.de>
parents: 3541
diff changeset
    63
3539
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    64
progressPercentage:aPercentageNumber
5500
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    65
    ^ self basicNew
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    66
        raiseRequestWith:aPercentageNumber 
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    67
        in:thisContext sender
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    68
    "/ self raiseRequestWith:aPercentageNumber
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    69
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    70
    "Modified: / 23-02-2017 / 16:51:52 / cg"
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    71
!
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    72
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    73
progressPercentage:aPercentageNumber statusInfo:statusInfo
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    74
    ^ self basicNew
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    75
        statusInfo:statusInfo;
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    76
        raiseRequestWith:aPercentageNumber 
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    77
        in:thisContext sender
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    78
    "/ self raiseRequestWith:aPercentageNumber
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    79
821ec5a9d9c4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
    80
    "Created: / 23-02-2017 / 16:52:11 / cg"
3539
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    81
! !
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    82
5304
4b50bec89cd5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
    83
!ProgressNotification methodsFor:'accessing'!
3539
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    84
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    85
progressValue
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    86
    ^ parameter
5318
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    87
!
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    88
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    89
statusInfo
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    90
    "any additional info (opaque to me)"
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    91
    
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    92
    ^ statusInfo
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    93
!
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    94
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    95
statusInfo:something
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    96
    "any additional info (opaque to me)"
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    97
aa51d67864a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    98
    statusInfo := something.
3539
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
    99
! !
53b322935b6d changed #progressValue
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
   100
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
!ProgressNotification class methodsFor:'documentation'!
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
version
5304
4b50bec89cd5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
   104
    ^ '$Header$'
3538
c0e7660db9ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
! !
5304
4b50bec89cd5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
   106