[Seaside] Class Variable Browser Fix
Ted Wrinch
ted.wrinch at gmail.com
Thu Jul 14 12:25:00 UTC 2011
You're right Josef,
I thought of that too but couldn't quite remember/find the selector. It's been nearly 15 years now since I've done any Smalltalk (was a great fan for 5 years in the early 90s)!
T.
Ted Wrinch
On 14 Jul 2011, at 09:05, Josef Springer wrote:
> Hello Ted,
>
> i think it is better to use 'binding value canRespondTo:' instead of 'binding value class selectors includes:' because #canRespondTo: includes all superclasses of 'binding value' too.
> mit freundlichen Grüßen / best regards,
> Josef Springer
> (Geschäftsleitung/Management)
>
> <Postal.jpg>
> Address
> Josef.Springer at joops.com
> Orlando-di-Lasso Str. 2
> D-85640 Putzbrunn
> <Phone.jpg>
> Office
> +49 (0)89 600 6920
>
>
> <Phone.jpg> Fax
> +49 (0)89 600 69220
>
>
> <Web.jpg>
> Web
> http://www.joops.com
>
>
> <Image120.jpg>
> (HRB München 86239)
>
> -- the software company --
>
> Ted Wrinch wrote:
>>
>> 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
>>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110714/fbb2ca97/attachment.htm
More information about the seaside
mailing list