ProtocolAdaptor.st
changeset 733 3c9ce994ec80
parent 231 2fec6188bd28
child 2414 c0ea8c7ed3c8
equal deleted inserted replaced
732:db51a760126a 733:3c9ce994ec80
   206 	obj := subjectChannel value
   206 	obj := subjectChannel value
   207     ].
   207     ].
   208     ^ self valueUsingSubject:obj
   208     ^ self valueUsingSubject:obj
   209 !
   209 !
   210 
   210 
       
   211 value:newValue
       
   212     "set my value & send change notifications to my dependents
       
   213      if it changed. But only if my subject does not itself
       
   214      send change notifications (otherwise, we'd send double notifications)."
       
   215 
       
   216     |oldValue|
       
   217 
       
   218     oldValue := self value.
       
   219     oldValue ~~ newValue ifTrue:[
       
   220         self setValue:newValue.
       
   221         subjectSendsUpdates ifFalse:[
       
   222             self changed:#value
       
   223         ]
       
   224     ]
       
   225 
       
   226     "Created: / 1.11.1997 / 14:04:45 / cg"
       
   227 !
       
   228 
   211 valueUsingSubject:anObject
   229 valueUsingSubject:anObject
   212     "return the value from anObject, using the selectors in accessPath.
   230     "return the value from anObject, using the selectors in accessPath.
   213      A helper for value."
   231      A helper for value."
   214 
   232 
   215     |obj|
   233     |obj|
   322 	self changed:#value.
   340 	self changed:#value.
   323 	^ self
   341 	^ self
   324     ].
   342     ].
   325 ! !
   343 ! !
   326 
   344 
   327 !ProtocolAdaptor methodsFor:'change notification'!
   345 !ProtocolAdaptor ignoredMethodsFor:'change notification'!
   328 
   346 
   329 changed:aspect
   347 changed:aspect
   330     "redefined to suppress change notifications, if my subject already did it"
   348     "redefined to suppress change notifications, if my subject already did it"
   331 
   349 
   332     subjectSendsUpdates ifFalse:[
   350     subjectSendsUpdates ifFalse:[
   348 ! !
   366 ! !
   349 
   367 
   350 !ProtocolAdaptor class methodsFor:'documentation'!
   368 !ProtocolAdaptor class methodsFor:'documentation'!
   351 
   369 
   352 version
   370 version
   353     ^ '$Header: /cvs/stx/stx/libview2/ProtocolAdaptor.st,v 1.12 1996-04-27 17:58:56 cg Exp $'
   371     ^ '$Header: /cvs/stx/stx/libview2/ProtocolAdaptor.st,v 1.13 1997-11-02 17:50:19 cg Exp $'
   354 ! !
   372 ! !