Notification.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Jun 2018 14:39:23 +0000
branchjv
changeset 23108 77cd6e1625e1
parent 19812 0866264d6eed
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     1
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     3
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     4
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     5
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     6
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
     9
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    10
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    11
"
6206
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5227
diff changeset
    12
"{ Package: 'stx:libbasic' }"
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5227
diff changeset
    13
17598
7618f46602ea class: Notification
sr
parents: 16283
diff changeset
    14
"{ NameSpace: Smalltalk }"
7618f46602ea class: Notification
sr
parents: 16283
diff changeset
    15
8817
387971ee2b30 Notification is not an exception.
Claus Gittinger <cg@exept.de>
parents: 8778
diff changeset
    16
GenericException subclass:#Notification
13674
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
    17
	instanceVariableNames:'tag'
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    20
	category:'Kernel-Exceptions'
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    21
!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    23
!Notification class methodsFor:'documentation'!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    24
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    25
copyright
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    26
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    27
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    28
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    29
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    30
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    31
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    33
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    34
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    35
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    36
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    37
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    38
!
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
    39
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    40
documentation
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    41
"    
12277
29a16650c9f4 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 12084
diff changeset
    42
    Notification is the superclass of all notification signals in the system.
11200
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    43
    contrast to regular exceptions, Notifications are ignored, if no handler is present
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    44
    and a default value is returned from the raise.
15680
9b6fca4e1eb9 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15668
diff changeset
    45
    When a handler finishes, the do-block is proceeded with the exception handler's value
8701
bd5034470a47 Optional code to make the default handler action to proceed.
Stefan Vogel <sv@exept.de>
parents: 8698
diff changeset
    46
    (an Exception does a return in this case.).
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    47
11200
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    48
    Thanks to proceedable exceptions, Notifications allow for non-GUI model code to provide
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    49
    user notifications which are optionally shown.
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    50
    Very useful, for example to provide progress information from a method which can be
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    51
    invoked both from a GUI-Tool (where notifications are wanted) and also from the system,
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    52
    where such notifications are not desired.
Claus Gittinger <cg@exept.de>
parents: 8817
diff changeset
    53
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
    [author:]
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
        Stefan Vogel
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    57
    [see also:]
15668
d91b53dd8c85 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15285
diff changeset
    58
        Signal QuerySignal Query
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    59
"
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    60
!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    61
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    62
examples 
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    63
"
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    64
  an up-notification from a deeply nested operation to a higher level:
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    65
                                                                        [exBegin]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    66
    |zero|
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    67
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    68
    zero := 0.
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    69
    Notification handle:[:n |
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    70
        Transcript showCR:'Please note that: ' , n description.
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    71
        n proceedWith:true
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    72
    ] do:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    73
        'nesting'.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    74
        [
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    75
            [
8516
14ec9e1d3b39 example
Stefan Vogel <sv@exept.de>
parents: 6451
diff changeset
    76
                Error handle:[:ex |
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    77
                    Transcript showCR:'some error: ' , ex errorString.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    78
                    ex proceed
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    79
                ] do:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    80
                    [
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    81
                        1 // zero.  'an error which is caught in the handler'.
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    82
                        Notification notify:'hello world'
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    83
                    ] value
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    84
                ]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    85
            ] value
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    86
        ] value
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    87
    ]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    88
                                                                        [exEnd]
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    89
"
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    90
! !
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    91
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    92
!Notification class methodsFor:'initialization'!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    93
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    94
initialize
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    95
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    96
    NotifierString := 'Notification:'
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    97
! !
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    98
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
    99
!Notification class methodsFor:'answering queries'!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   100
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   101
answer:someAnswer do:aBlock
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   102
    "evaluate the argument, aBlock.
12060
49c65efc6abb changed: #answer:do:
Claus Gittinger <cg@exept.de>
parents: 12042
diff changeset
   103
     If the receiver is queried during evaluation, answer and proceed with someAnswer.
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   104
     This is a wrapper for #handle:do: for lazy typists; no new functionality."
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   105
8698
948da171e6e5 Make #handle - contexts also #return-able
Stefan Vogel <sv@exept.de>
parents: 8692
diff changeset
   106
    <context: #return>
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   107
    <exception: #handle>
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   108
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   109
    "/ thisContext markForHandle. -- same as above pragma
5227
73a2dc34cb42 #answer:do: now returns the evaluated blocks value
Claus Gittinger <cg@exept.de>
parents: 4605
diff changeset
   110
    ^ aBlock value.  "the real logic is in Exception>>doRaise"
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   111
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   112
    "
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   113
     Notification answer:true do:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   114
        Transcript showCR:'query answers: ' , (Query query printString).
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   115
     ]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   116
    "
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   117
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   118
    "
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   119
     Notification answer:false do:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   120
        Transcript showCR:'first query answers: ' , (Query query printString).
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   121
        Query answer:true do:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   122
            Transcript showCR:'second query answers: ' , (Query query printString).
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   123
        ]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   124
     ]
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   125
    "
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   126
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   127
    "Created: / 10.7.1996 / 15:08:20 / cg"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   128
    "Modified: / 14.10.1996 / 16:59:18 / cg"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   129
    "Modified: / 25.7.1999 / 23:12:19 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   130
! !
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   131
12084
8cdb5d246455 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12060
diff changeset
   132
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   133
!Notification class methodsFor:'queries'!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   134
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   135
accepts:aSignal
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   136
    "return true, if the receiver accepts the argument, aSignal.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   137
     (i.e. the receiver is aSignal or a parent of it). False otherwise."
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   138
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   139
    |s|
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   140
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   141
    self == aSignal ifTrue:[^ true].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   142
    aSignal isQuerySignal ifFalse:[^ false].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   143
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   144
    s := aSignal parent.
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   145
    [s notNil] whileTrue:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   146
        self == s ifTrue:[^ true].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   147
        s := s parent
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   148
    ].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   149
    ^ false
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   150
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   151
    "Modified: / 22.3.1999 / 12:45:32 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   152
    "Created: / 23.7.1999 / 15:18:00 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   153
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   154
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   155
defaultAnswer
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   156
    "Return the default answer to the Query. This method is called,
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   157
     if nobody catches the signal.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   158
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   159
     Subclasses may redefine this method."
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   160
19778
de6ffd31401f #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 19777
diff changeset
   161
    "Calling raiseRequest here will execute the exception's action method
de6ffd31401f #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 19777
diff changeset
   162
     which returns the defaultResumeValue."    
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   163
19778
de6ffd31401f #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 19777
diff changeset
   164
    ^ super raiseRequest
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   165
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   166
    "Created: / 23.7.1999 / 15:16:03 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   167
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   168
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   169
handlerForSignal:signal context:theContext originator:originator
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   170
    "answer the handler block for the signal from originator.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   171
     The block is retrieved from aContext.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   172
     Answer nil if the signal is not handled"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   173
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   174
    |arg|
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   175
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   176
    theContext selector == #'answer:do:' ifTrue:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   177
        (self == signal or:[self accepts:signal]) ifTrue:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   178
            arg := theContext argAt:1.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   179
            ^ [:ex| ex proceedWith:arg].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   180
        ]
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   181
    ] ifFalse:[
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   182
        ^ super handlerForSignal:signal context:theContext originator:originator.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   183
    ].
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   184
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   185
    ^ nil
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   186
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   187
    "Created: / 25.7.1999 / 23:11:55 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   188
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   189
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   190
handles:anException
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   191
    "return true, if the receiver handles the argument, anException.
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   192
     (i.e. the receiver is anExceptions signal or a parent of it)"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   193
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   194
    |signal|
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   195
15114
77142b5c937a use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 14948
diff changeset
   196
    signal := anException creator.
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   197
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   198
    self == signal ifTrue:[^ true].               "quick check"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   199
    anException isNotification ifFalse:[^ false]. "speed up non-queries by not traversing the parent chain"
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   200
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   201
    [(signal := signal parent) notNil] whileTrue:[
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   202
        self == signal ifTrue:[^ true].
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   203
    ].
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   204
    ^ false
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   205
!
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   206
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   207
isQuerySignal
4605
7d5e97290c97 comment only
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
   208
    "return true, if this is a querySignal - always return true here"
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   209
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   210
    ^ true
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   211
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   212
    "Created: / 23.7.1999 / 14:59:50 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   213
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   214
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   215
notify:aMessageString
15680
9b6fca4e1eb9 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15668
diff changeset
   216
    "raise the query - return the handler's value, or the default
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   217
     value, if there is no handler."
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   218
16283
f5d92aa70835 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15849
diff changeset
   219
    "/ cg: must be redefined, so we get a reasonable originator
f5d92aa70835 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15849
diff changeset
   220
    "/ some apps depend on aoriginator being the non-exception context here.
f5d92aa70835 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15849
diff changeset
   221
    "/ (do not do a self raiseRequestErrorString: here)
f5d92aa70835 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15849
diff changeset
   222
    ^ self basicNew
f5d92aa70835 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15849
diff changeset
   223
        raiseRequestErrorString:aMessageString in:thisContext sender
6431
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   224
!
584b4b6e231c common code with Query
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   225
19796
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   226
notify:aMessageString with:aParameter
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   227
    "raise the query - return the handler's value, or the default
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   228
     value, if there is no handler."
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   229
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   230
    "/ cg: must be redefined, so we get a reasonable originator
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   231
    "/ some apps depend on an originator being the non-exception context here.
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   232
    "/ (do not do a self raiseRequestErrorString: here)
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   233
    ^ self basicNew
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   234
        parameter:aParameter;
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   235
        raiseRequestErrorString:aMessageString in:thisContext sender
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   236
!
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   237
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   238
query
15680
9b6fca4e1eb9 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15668
diff changeset
   239
    "raise the query - return the handler's value, or the default
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   240
     value, if there is no handler.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   241
     Invoking the handler is exactly the functionality of Signal>>raiseRequest,
8778
a71a9d3c1344 comment
Claus Gittinger <cg@exept.de>
parents: 8701
diff changeset
   242
     but we can do it faster here (avoiding the construction of an exception instance)."
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   243
19777
6e16198576c7 #REFACTORING by sr
sr
parents: 19200
diff changeset
   244
    ^ self raiseAsQuery
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   245
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   246
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   247
raise
15849
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   248
    "Notifications are proceedable by definition,
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   249
     so they should be raised with #query or #raiseRequest"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   250
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   251
    ^ self shouldNotImplement
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   252
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   253
    "Created: / 23.7.1999 / 15:19:17 / stefan"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   254
!
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   255
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   256
raiseRequest
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   257
    "redefined to use #query"
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   258
19777
6e16198576c7 #REFACTORING by sr
sr
parents: 19200
diff changeset
   259
    ^ self raiseAsQuery
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   260
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   261
    "Created: / 25.7.1999 / 23:25:59 / stefan"
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   262
! !
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   263
15849
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   264
!Notification class methodsFor:'utilities'!
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   265
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   266
deprecated
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   267
    "invoked by some open source packages (SOAP and YAXO, for example)"
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   268
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   269
    self notify:'called deprecated interface'
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   270
! !
e752f846dea6 class: Notification
Claus Gittinger <cg@exept.de>
parents: 15680
diff changeset
   271
13674
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   272
!Notification methodsFor:'accessing'!
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   273
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   274
tag
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   275
    "for squeak compatibility"
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   276
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   277
    ^ tag
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   278
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   279
    "Modified (comment): / 11-09-2011 / 16:40:54 / cg"
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   280
!
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   281
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   282
tag:aSzmbol
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   283
    "for squeak compatibility"
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   284
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   285
    tag := aSzmbol.
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   286
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   287
    "Modified (format): / 11-09-2011 / 16:41:01 / cg"
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   288
! !
89734bcfdb32 class definition
Claus Gittinger <cg@exept.de>
parents: 13363
diff changeset
   289
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   290
!Notification methodsFor:'default actions'!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   291
4525
999e680a29ca Make error classes public.
Stefan Vogel <sv@exept.de>
parents: 4508
diff changeset
   292
defaultAction
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   293
    "the default action is to return the default value.
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   294
     Subclasses may redefine this"
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   295
8683
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   296
    |handlerBlock|
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   297
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   298
    "try per signal handler.
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   299
     I may have been created from a QuerySignal"
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   300
15285
7c7d4ed8296d class: Notification
Stefan Vogel <sv@exept.de>
parents: 15114
diff changeset
   301
    (handlerBlock := self creator handlerBlock) notNil ifTrue:[
8683
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   302
        "... and call it"
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   303
        ^ handlerBlock value:self.
a162510a0408 QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents: 8681
diff changeset
   304
    ].
6451
f22b12c0349a renamed #defaultValue -> #defaultResumeValue (vw54 compat.)
Claus Gittinger <cg@exept.de>
parents: 6431
diff changeset
   305
    ^ self defaultResumeValue
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   306
4550
66adee5e8491 Renamed from Query.st
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   307
    "Modified: / 23.7.1999 / 15:13:34 / stefan"
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   308
! !
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   309
14948
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   310
!Notification methodsFor:'helpers'!
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   311
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   312
hasDialog
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   313
    "answer true, if we can use a Dialog window"
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   314
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   315
    (Smalltalk isInitialized 
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   316
     and:[Dialog notNil
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   317
     and:[Screen notNil
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   318
     and:[Screen current notNil
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   319
     and:[Screen current isOpenAndDispatching
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   320
    ]]]]) ifTrue:[
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   321
        Dialog autoload.        "in case its autoloaded"
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   322
        ^ true.
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   323
    ].
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   324
    ^ false
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   325
! !
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   326
12042
324365132b54 added: #query
fm
parents: 11200
diff changeset
   327
!Notification methodsFor:'queries'!
324365132b54 added: #query
fm
parents: 11200
diff changeset
   328
19796
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   329
notify
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   330
    "notice the implementation on the class-side: if no additional parameters are to be passed,
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   331
     we do not even arrive here, because query has inlined the raiseRequest code"
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   332
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   333
    ^ self raiseRequestIn:thisContext sender
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   334
!
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   335
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   336
notify:aMessageString
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   337
    "notice the implementation on the class-side: if no additional parameters are to be passed,
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   338
     we do not even arrive here, because query has inlined the raiseRequest code"
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   339
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   340
    ^ self raiseRequestErrorString:aMessageString in:thisContext sender
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   341
!
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   342
12042
324365132b54 added: #query
fm
parents: 11200
diff changeset
   343
query
324365132b54 added: #query
fm
parents: 11200
diff changeset
   344
    "notice the implementation on the class-side: if no additional parameters are to be passed,
324365132b54 added: #query
fm
parents: 11200
diff changeset
   345
     we do not even arrive here, because query has inlined the raiseRequest code"
324365132b54 added: #query
fm
parents: 11200
diff changeset
   346
19796
f08240ae07ef #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19778
diff changeset
   347
    ^ self raiseRequestIn:thisContext sender
12042
324365132b54 added: #query
fm
parents: 11200
diff changeset
   348
! !
324365132b54 added: #query
fm
parents: 11200
diff changeset
   349
8681
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   350
!Notification methodsFor:'testing'!
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   351
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   352
isNotification
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   353
    ^ true
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   354
! !
38aa963476a5 Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents: 8516
diff changeset
   355
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   356
!Notification class methodsFor:'documentation'!
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   357
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   358
version
18675
2a0bff29806f class: Notification
Claus Gittinger <cg@exept.de>
parents: 17598
diff changeset
   359
    ^ '$Header$'
12042
324365132b54 added: #query
fm
parents: 11200
diff changeset
   360
!
324365132b54 added: #query
fm
parents: 11200
diff changeset
   361
324365132b54 added: #query
fm
parents: 11200
diff changeset
   362
version_CVS
18675
2a0bff29806f class: Notification
Claus Gittinger <cg@exept.de>
parents: 17598
diff changeset
   363
    ^ '$Header$'
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   364
! !
8516
14ec9e1d3b39 example
Stefan Vogel <sv@exept.de>
parents: 6451
diff changeset
   365
14948
c792f4a1ceea class: Notification
Claus Gittinger <cg@exept.de>
parents: 13674
diff changeset
   366
4443
6928884b4c8a initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   367
Notification initialize!