62
|
1 |
Model subclass:#ValueModel
|
|
2 |
instanceVariableNames:'accepted'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
66
|
5 |
category:'Interface-Support'
|
62
|
6 |
!
|
|
7 |
|
68
|
8 |
!ValueModel class methodsFor:'documentation'!
|
|
9 |
|
|
10 |
documentation
|
|
11 |
"
|
|
12 |
abstract superclass for ValueHolders and Adaptors.
|
|
13 |
|
|
14 |
Notice: this class was implemented using protocol information
|
|
15 |
from alpha testers - it may not be complete or compatible to
|
|
16 |
the corresponding ST-80 class. If you encounter any incompatibilities,
|
|
17 |
please forward a note to the ST/X team.
|
|
18 |
"
|
|
19 |
! !
|
|
20 |
|
62
|
21 |
!ValueModel class methodsFor:'instance creation'!
|
|
22 |
|
|
23 |
new
|
|
24 |
^ (super new) initialize
|
|
25 |
! !
|
|
26 |
|
|
27 |
!ValueModel methodsFor:'initialization'!
|
|
28 |
|
|
29 |
initialize
|
|
30 |
accepted := false
|
|
31 |
! !
|
|
32 |
|
|
33 |
!ValueModel methodsFor:'accessing'!
|
|
34 |
|
|
35 |
accept
|
|
36 |
accepted := true
|
|
37 |
!
|
|
38 |
|
|
39 |
value
|
|
40 |
self subclassResponsibility
|
|
41 |
!
|
|
42 |
|
|
43 |
setValue:newValue
|
|
44 |
self subclassResponsibility
|
|
45 |
!
|
|
46 |
|
|
47 |
value:anObject
|
|
48 |
|oldValue|
|
|
49 |
|
|
50 |
oldValue := self value.
|
|
51 |
self setValue:anObject.
|
|
52 |
anObject ~= oldValue ifTrue:[
|
|
53 |
self changed:#value
|
|
54 |
]
|
|
55 |
! !
|
|
56 |
|