ProtocolAdaptor.st
author Claus Gittinger <cg@exept.de>
Thu, 23 Nov 1995 11:43:41 +0100
changeset 125 fa5b5e4336bf
parent 114 e577a2f332d0
child 129 f890eaabc487
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
75
claus
parents: 71
diff changeset
     1
"
claus
parents: 71
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 71
diff changeset
     3
	      All Rights Reserved
claus
parents: 71
diff changeset
     4
claus
parents: 71
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 71
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 71
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 71
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 71
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 71
diff changeset
    10
 hereby transferred.
claus
parents: 71
diff changeset
    11
"
claus
parents: 71
diff changeset
    12
69
claus
parents:
diff changeset
    13
ValueModel subclass:#ProtocolAdaptor
claus
parents:
diff changeset
    14
	 instanceVariableNames:'accessPath subject subjectChannel subjectSendsUpdates'
claus
parents:
diff changeset
    15
	 classVariableNames:''
claus
parents:
diff changeset
    16
	 poolDictionaries:''
71
claus
parents: 69
diff changeset
    17
	 category:'Interface-Support-Models'
69
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
claus
parents:
diff changeset
    20
!ProtocolAdaptor class methodsFor:'documentation'!
claus
parents:
diff changeset
    21
claus
parents:
diff changeset
    22
copyright
claus
parents:
diff changeset
    23
"
claus
parents:
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
71
claus
parents: 69
diff changeset
    25
	      All Rights Reserved
69
claus
parents:
diff changeset
    26
claus
parents:
diff changeset
    27
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    31
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    32
 hereby transferred.
claus
parents:
diff changeset
    33
"
claus
parents:
diff changeset
    34
!
claus
parents:
diff changeset
    35
claus
parents:
diff changeset
    36
documentation
claus
parents:
diff changeset
    37
"
claus
parents:
diff changeset
    38
    a ProtocolAdaptor allows access to embeded values in a
claus
parents:
diff changeset
    39
    complex model and plays model towards the outside world.
claus
parents:
diff changeset
    40
claus
parents:
diff changeset
    41
    Consider the case where editFields are required for the
claus
parents:
diff changeset
    42
    elements (instance variables) of a more complex model.
claus
parents:
diff changeset
    43
    Using ValueHolders, you had to copy the individual
claus
parents:
diff changeset
    44
    values out-of and into multiple valueHolders.
claus
parents:
diff changeset
    45
    A protocolAdaptor makes this easier, by playing model towards
claus
parents:
diff changeset
    46
    the editField, returning a value from the complex model, 
claus
parents:
diff changeset
    47
    and forwards changes to the complex model.
claus
parents:
diff changeset
    48
claus
parents:
diff changeset
    49
    Notice: since you can specify the aspect- and changeSymbols in most ST/X
claus
parents:
diff changeset
    50
    widgets, ProtocolAdapters are not always needed (at  least, if no access-
claus
parents:
diff changeset
    51
    path is required). 
claus
parents:
diff changeset
    52
    However, if you want to apply widgets on objects which where not originally 
claus
parents:
diff changeset
    53
    designed as models (such as Arrays), ProtocolAdapters are very useful.
claus
parents:
diff changeset
    54
claus
parents:
diff changeset
    55
    Notice: this class was implemented using protocol information
claus
parents:
diff changeset
    56
    from alpha testers - it may not be complete or compatible to
claus
parents:
diff changeset
    57
    the corresponding ST-80 class. If you encounter any incompatibilities,
claus
parents:
diff changeset
    58
    please forward a note to the ST/X team.
claus
parents:
diff changeset
    59
"
claus
parents:
diff changeset
    60
!
claus
parents:
diff changeset
    61
claus
parents:
diff changeset
    62
examples 
claus
parents:
diff changeset
    63
"
claus
parents:
diff changeset
    64
	|a obj|
claus
parents:
diff changeset
    65
claus
parents:
diff changeset
    66
	a := ProtocolAdaptor accessPath:#(1 2 3).
claus
parents:
diff changeset
    67
	obj := Array with:#(11 (121 122 123) 13)
claus
parents:
diff changeset
    68
		     with:#(21 (221 222 223) 23)
claus
parents:
diff changeset
    69
		     with:#(33 (321 322 323) 33).
claus
parents:
diff changeset
    70
	a valueUsingSubject:obj  
claus
parents:
diff changeset
    71
claus
parents:
diff changeset
    72
claus
parents:
diff changeset
    73
claus
parents:
diff changeset
    74
	|a obj|
claus
parents:
diff changeset
    75
claus
parents:
diff changeset
    76
	a := ProtocolAdaptor accessPath:#(1 2 origin).
claus
parents:
diff changeset
    77
	obj := Array with:(Array with:1@1 with:(1@2 corner:100@100))
claus
parents:
diff changeset
    78
		     with:(Array with:2@1 with:2@2)
claus
parents:
diff changeset
    79
		     with:(Array with:3@1 with:3@2).
claus
parents:
diff changeset
    80
	a valueUsingSubject:obj  
claus
parents:
diff changeset
    81
claus
parents:
diff changeset
    82
claus
parents:
diff changeset
    83
claus
parents:
diff changeset
    84
	|a model|
claus
parents:
diff changeset
    85
claus
parents:
diff changeset
    86
	a := ProtocolAdaptor accessPath:#(1 2 origin).
claus
parents:
diff changeset
    87
	model := (Array with:(Array with:1@1 with:(1@2 corner:100@100))
claus
parents:
diff changeset
    88
		     with:(Array with:2@1 with:2@2)
claus
parents:
diff changeset
    89
		     with:(Array with:3@1 with:3@2)) asValue.
claus
parents:
diff changeset
    90
	a subjectChannel:model.
claus
parents:
diff changeset
    91
	a value   
claus
parents:
diff changeset
    92
"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    93
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    94
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    95
version
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    96
    ^ '$Header: /cvs/stx/stx/libview2/ProtocolAdaptor.st,v 1.8 1995-11-23 10:42:39 cg Exp $'
69
claus
parents:
diff changeset
    97
! !
claus
parents:
diff changeset
    98
claus
parents:
diff changeset
    99
!ProtocolAdaptor class methodsFor:'instance creation'!
claus
parents:
diff changeset
   100
claus
parents:
diff changeset
   101
accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   102
    ^ (self new) accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   103
!
claus
parents:
diff changeset
   104
claus
parents:
diff changeset
   105
subject:anObject
claus
parents:
diff changeset
   106
    ^ (self new) subject:anObject
claus
parents:
diff changeset
   107
!
claus
parents:
diff changeset
   108
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   109
subject:anObject accessPath:aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   110
    ^ (self new) subject:anObject; accessPath:aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   111
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   112
69
claus
parents:
diff changeset
   113
subject:anObject sendsUpdates:aBoolean
claus
parents:
diff changeset
   114
    ^ (self new) subject:anObject; sendsUpdates:aBoolean
claus
parents:
diff changeset
   115
!
claus
parents:
diff changeset
   116
claus
parents:
diff changeset
   117
subject:anObject sendsUpdates:aBoolean accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   118
    ^ (self new) subject:anObject; sendsUpdates:aBoolean; accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   119
!
claus
parents:
diff changeset
   120
claus
parents:
diff changeset
   121
subjectChannel:aValueHolder
claus
parents:
diff changeset
   122
    ^ (self new) subjectChannel:aValueHolder
claus
parents:
diff changeset
   123
!
claus
parents:
diff changeset
   124
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   125
subjectChannel:aValueHolder accessPath:aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   126
    ^ (self new) subjectChannel:aValueHolder; accessPath:aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   127
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   128
69
claus
parents:
diff changeset
   129
subjectChannel:aValueHolder sendsUpdates:aBoolean 
claus
parents:
diff changeset
   130
    ^ (self new) subjectChannel:aValueHolder; sendsUpdates:aBoolean
claus
parents:
diff changeset
   131
!
claus
parents:
diff changeset
   132
claus
parents:
diff changeset
   133
subjectChannel:aValueHolder sendsUpdates:aBoolean accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   134
    ^ (self new) subjectChannel:aValueHolder; sendsUpdates:aBoolean; accessPath:aCollectionOfSelectors
claus
parents:
diff changeset
   135
! !
claus
parents:
diff changeset
   136
claus
parents:
diff changeset
   137
!ProtocolAdaptor methodsFor:'accessing'!
claus
parents:
diff changeset
   138
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
setValue:newValue
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   140
    "set the value in my subject or subjectChannel."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   141
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   142
    |obj|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   143
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   144
    subject notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   145
	obj := subject.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   146
    ] ifFalse:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   147
	obj := subjectChannel value
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   148
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   149
    ^ self setValue:newValue usingSubject:obj
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   150
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   151
69
claus
parents:
diff changeset
   152
setValue:newValue usingSubject:anObject
claus
parents:
diff changeset
   153
    "set a value in anObject, using the selectors in accessPath.
claus
parents:
diff changeset
   154
     A helper for setValue:."
claus
parents:
diff changeset
   155
claus
parents:
diff changeset
   156
    |obj lastIndex|
claus
parents:
diff changeset
   157
claus
parents:
diff changeset
   158
    obj := anObject.
claus
parents:
diff changeset
   159
    lastIndex := accessPath size.
claus
parents:
diff changeset
   160
    accessPath keysAndValuesDo:[:idx :aSelectorOrIndex |
claus
parents:
diff changeset
   161
	aSelectorOrIndex isInteger ifTrue:[
claus
parents:
diff changeset
   162
	    idx == lastIndex ifTrue:[
claus
parents:
diff changeset
   163
		obj at:aSelectorOrIndex put:newValue
claus
parents:
diff changeset
   164
	    ] ifFalse:[
claus
parents:
diff changeset
   165
		obj := obj at:aSelectorOrIndex
claus
parents:
diff changeset
   166
	    ]
claus
parents:
diff changeset
   167
	] ifFalse:[
claus
parents:
diff changeset
   168
	    idx == lastIndex ifTrue:[
claus
parents:
diff changeset
   169
		obj perform:(aSelectorOrIndex , ':') asSymbol with:newValue
claus
parents:
diff changeset
   170
	    ] ifFalse:[
claus
parents:
diff changeset
   171
		obj := obj perform:aSelectorOrIndex
claus
parents:
diff changeset
   172
	    ]
claus
parents:
diff changeset
   173
	]
claus
parents:
diff changeset
   174
    ].
claus
parents:
diff changeset
   175
    ^ newValue
claus
parents:
diff changeset
   176
!
claus
parents:
diff changeset
   177
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
value
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
    "return the value from my subject or subjectChannel."
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   181
    |obj|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   183
    subject notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
	obj := subject.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
    ] ifFalse:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   186
	obj := subjectChannel value
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   187
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   188
    ^ self valueUsingSubject:obj
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   189
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   190
69
claus
parents:
diff changeset
   191
valueUsingSubject:anObject
claus
parents:
diff changeset
   192
    "return the value from anObject, using the selectors in accessPath.
claus
parents:
diff changeset
   193
     A helper for value."
claus
parents:
diff changeset
   194
claus
parents:
diff changeset
   195
    |obj|
claus
parents:
diff changeset
   196
claus
parents:
diff changeset
   197
    obj := anObject.
claus
parents:
diff changeset
   198
    accessPath notNil ifTrue:[
claus
parents:
diff changeset
   199
	accessPath do:[:aSelectorOrIndex |
claus
parents:
diff changeset
   200
	    aSelectorOrIndex isInteger ifTrue:[
claus
parents:
diff changeset
   201
		obj := obj at:aSelectorOrIndex
claus
parents:
diff changeset
   202
	    ] ifFalse:[
claus
parents:
diff changeset
   203
		obj := obj perform:aSelectorOrIndex
claus
parents:
diff changeset
   204
	    ]
claus
parents:
diff changeset
   205
	].
claus
parents:
diff changeset
   206
    ].
claus
parents:
diff changeset
   207
    ^ obj
claus
parents:
diff changeset
   208
! !
claus
parents:
diff changeset
   209
claus
parents:
diff changeset
   210
!ProtocolAdaptor methodsFor:'accessing-spec'!
claus
parents:
diff changeset
   211
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   212
accessPath
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   213
    ^ accessPath
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   214
!
69
claus
parents:
diff changeset
   215
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   216
accessPath:aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   217
    accessPath := aCollectionOfSelectors
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   218
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   219
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   220
subject
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   221
    ^ subject
69
claus
parents:
diff changeset
   222
!
claus
parents:
diff changeset
   223
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   224
subject:anObject
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   225
    subject notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   226
	subject removeDependent:self
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   227
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   228
    subject := anObject.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   229
    self changed:#value.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   230
    subject notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   231
	subject addDependent:self
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   232
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   233
!
69
claus
parents:
diff changeset
   234
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   235
subjectChannel
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   236
    ^ subjectChannel
69
claus
parents:
diff changeset
   237
!
claus
parents:
diff changeset
   238
claus
parents:
diff changeset
   239
subjectChannel:aValueHolder
claus
parents:
diff changeset
   240
    |oldChannel|
claus
parents:
diff changeset
   241
100
claus
parents: 96
diff changeset
   242
    subjectChannel notNil ifTrue:[
claus
parents: 96
diff changeset
   243
	subjectChannel removeDependent:self
claus
parents: 96
diff changeset
   244
    ].
69
claus
parents:
diff changeset
   245
    oldChannel := subjectChannel.
claus
parents:
diff changeset
   246
    subjectChannel := aValueHolder.
100
claus
parents: 96
diff changeset
   247
    subjectChannel notNil ifTrue:[
claus
parents: 96
diff changeset
   248
	subjectChannel addDependent:self
claus
parents: 96
diff changeset
   249
    ].
69
claus
parents:
diff changeset
   250
    oldChannel notNil ifTrue:[
claus
parents:
diff changeset
   251
	self changed:#value.
claus
parents:
diff changeset
   252
    ].
100
claus
parents: 96
diff changeset
   253
claus
parents: 96
diff changeset
   254
    "Modified: 6.9.1995 / 01:19:27 / claus"
69
claus
parents:
diff changeset
   255
!
claus
parents:
diff changeset
   256
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   257
subjectSendsUpdates
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   258
    "return true, if the subject sends updates itself
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   259
     If true, the receiver will not send updates on changes"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   260
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   261
    ^ subjectSendsUpdates
69
claus
parents:
diff changeset
   262
!
claus
parents:
diff changeset
   263
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   264
subjectSendsUpdates:aBoolean
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   265
    "set/clear the flag which states if the subject sends updates itself.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   266
     If true, the receiver will not send updates on changes"
69
claus
parents:
diff changeset
   267
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   268
    subjectSendsUpdates := aBoolean.
69
claus
parents:
diff changeset
   269
! !
claus
parents:
diff changeset
   270
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   271
!ProtocolAdaptor methodsFor:'change & update'!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   272
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   273
update:something with:aPArameter from:changedObject
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   274
    "translate updates from my subject into value-changes towards
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   275
     my dependents. Since I have no specific aspect, every change is forwarded"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   276
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   277
    (changedObject == subject
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   278
    or:[changedObject == subjectChannel]) ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   279
	self changed:#value.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   280
	^ self
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   281
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   282
! !
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   283
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   284
!ProtocolAdaptor methodsFor:'change notification'!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   285
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   286
changed:aspect
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   287
    subjectSendsUpdates ifFalse:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   288
	super changed:aspect
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   289
    ]
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   290
! !
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   291
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   292
!ProtocolAdaptor methodsFor:'initialization'!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   293
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   294
initialize
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   295
    super initialize.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   296
    subjectSendsUpdates := false. 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   297
! !
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   298