GDBEventSubscription.st
changeset 41 fb48207b6104
child 78 c24e7d8bc881
equal deleted inserted replaced
40:0ce76b671515 41:fb48207b6104
       
     1 "{ Package: 'jv:libgdbs' }"
       
     2 
       
     3 StrongSubscription subclass:#GDBEventSubscription
       
     4 	instanceVariableNames:''
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'GDB-Private'
       
     8 !
       
     9 
       
    10 !GDBEventSubscription class methodsFor:'private'!
       
    11 
       
    12 blockFor: anObject withSelector: aSelector
       
    13 
       
    14     | args |
       
    15     args := aSelector numArgs.      
       
    16 
       
    17     anObject isView ifTrue:[ 
       
    18         args = 0 ifTrue: [ ^[ anObject sensor pushUserEvent: aSelector for: anObject ] ].
       
    19         args = 1 ifTrue: [ ^[ :anAnnouncement | anObject sensor pushUserEvent: aSelector for: anObject withArgument: anAnnouncement ] ].
       
    20         args = 2 ifTrue: [ ^[ :anAnnouncement :anAnnouncer | anObject sensor pushUserEvent: aSelector for: anObject withArguments: (Array with: anAnnouncement with: anAnnouncer) ] ].
       
    21         self error: 'Couldn''t create block'.        
       
    22     ].
       
    23     (anObject isKindOf: ApplicationModel) ifTrue:[ 
       
    24         args = 0 ifTrue: [ ^[ anObject window sensor pushUserEvent: aSelector for: anObject ] ].
       
    25         args = 1 ifTrue: [ ^[ :anAnnouncement | anObject window sensor pushUserEvent: aSelector for: anObject withArgument: anAnnouncement ] ].
       
    26         args = 2 ifTrue: [ ^[ :anAnnouncement :anAnnouncer | anObject window sensor pushUserEvent: aSelector for: anObject withArguments: (Array with: anAnnouncement with: anAnnouncer) ] ].
       
    27         self error: 'Couldn''t create block'.        
       
    28     ].
       
    29     ^ super blockFor: anObject withSelector: aSelector
       
    30 
       
    31     "Created: / 18-09-2014 / 00:10:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    32 ! !
       
    33