[Seaside] Class Variable Browser Fix
Ted Wrinch
ted.wrinch at gmail.com
Thu Jul 14 07:56:16 UTC 2011
Found another one Lukas,
If you go to a class variable usage in the browser, say DefaultDirectory in FileDirectory>>default, and select and right click it, Seaside brings up a walk-back. My fix for this re-writes the existing method a little by using '&' instead of the older 'and:', which I find clearer. What I've done is check that the value can respond to #asNode:
globalReference
| binding |
target hasSelector
ifFalse: [ ^ nil ].
(requestor selectedClass notNil & (binding := requestor selectedClass bindingOf: target selector) notNil & binding value notNil & (binding value class selectors includes: #asNode))
ifTrue: [ ^ binding value asNode ].
(binding := Smalltalk classNamed: target selector) notNil
ifTrue: [ ^ binding value asNode ].
^ nil
T.
Ted Wrinch
On 13 Jul 2011, at 08:31, Lukas Renggli wrote:
> Thanks I integrated it with
>
> Name: OB-Standard-lr.543
> Author: lr
> Time: 13 July 2011, 9:31:10 am
> UUID: 51c5067d-fa7e-4d02-8c4a-84fce6c421b2
> Ancestors: OB-Standard-lr.542
>
> - fixes a problem with references of class variables (thanks go to Ted Wrinch)
>
> Lukas
>
> On 13 July 2011 08:42, Ted Wrinch <ted.wrinch at gmail.com> wrote:
>> Hi All,
>>
>> There seems to be a buglet in the browser concerning class variables. When you select and right click on a class variable in the browser it brings up a walk-back. I'm not sure what the procedure is for applying fixes to the code base and have included the fix below:
>>
>> OBCmdBrowseReferencesOfIt>>globalReference
>> | binding |
>> target hasSelector
>> ifFalse: [ ^ nil ].
>> (requestor selectedClass notNil and: [ (binding := requestor selectedClass bindingOf: target selector) notNil and:[binding value notNil] ])
>> ifTrue: [ ^ binding value asNode ].
>> (binding := Smalltalk classNamed: target selector) notNil
>> ifTrue: [ ^ binding value asNode ].
>> ^ nil
>>
>> I've added the phrase: "and:[binding value notNil]".
>>
>> T.
>>
>> Ted Wrinch
>>
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list