62
|
1 |
ValueModel subclass:#ValueHolder
|
|
2 |
instanceVariableNames:'value changeMsg changeReceiver'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
66
|
5 |
category:'Interface-Support'
|
62
|
6 |
!
|
|
7 |
|
|
8 |
!ValueHolder class methodsFor:'instance creation'!
|
|
9 |
|
|
10 |
with:anObject
|
|
11 |
^ (super new) value:anObject
|
|
12 |
!
|
|
13 |
|
|
14 |
newString
|
|
15 |
^ self with:''
|
|
16 |
!
|
|
17 |
|
|
18 |
newBoolean
|
|
19 |
^ self with:false
|
|
20 |
! !
|
|
21 |
|
|
22 |
!ValueHolder methodsFor:'accessing'!
|
|
23 |
|
|
24 |
onChangeSend:selector to:someone
|
|
25 |
changeMsg := selector.
|
|
26 |
changeReceiver := someone
|
|
27 |
!
|
|
28 |
|
|
29 |
value:anObject
|
|
30 |
|oldValue|
|
|
31 |
|
|
32 |
oldValue := value.
|
|
33 |
value := anObject.
|
|
34 |
self changed:#value.
|
|
35 |
changeReceiver notNil ifTrue:[
|
|
36 |
changeMsg notNil ifTrue:[
|
|
37 |
changeReceiver perform:changeMsg
|
|
38 |
]
|
|
39 |
]
|
|
40 |
!
|
|
41 |
|
|
42 |
value
|
|
43 |
^ value
|
|
44 |
! !
|