You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Greg Brown <gk...@mac.com> on 2009/03/13 20:11:00 UTC

Re: [pivot-toolkit] Re: MVC, swing and pivot

This change is done and has been committed. The listener "setters" have been eliminated, and the WTKX syntax has been updated as described below.

Any future discussion on this topic should be via pivot-dev@incubator.apache.org.

G

On Friday, March 13, 2009, at 12:25PM, "Greg Brown" <gk...@mac.com> wrote:
>I think we had discussed adding knowledge of ListenerList to BeanDictionary, which we didn't (and I still don't) like. However, WTKXSerializer does have knowledge of beans and Sequences, so it's not a stretch to add ListenerList. 
>
>Since ListenerList is so integral to the framework, I think it is OK.
> 
>On Friday, March 13, 2009, at 12:04PM, "Todd Volkert" <tv...@gmail.com> wrote:
>>
>>I'm in favor, though I thought this wasn't originally done because we
>>didn't want too tight a coupling between specific classes in
>>WTKXSerializer (such as hard coded knowledge of ListenerList).  That
>>being said, the setXListener() adding to the listener list does break
>>naming conventions like Noel says, and it does make unsuspecting
>>developers look for removeXListener(), which is likely to be a common
>>confusion as Pivot gains adoption -- thus, I second the idea :)
>>
>>-T
>>
>>On Fri, Mar 13, 2009 at 11:32 AM, Greg Brown <gk...@mac.com> wrote:
>>>
>>>>One alternative would be to make the parser aware of the pivot.util.ListenerList class,
>>>>in the same way that it is aware of the Sequence class and classes that expose
>>>>bean-style getters and setters. This might allow us to eliminate the listener setters.
>>>
>>> Thinking through this a bit, the syntax might look like:
>>>
>>> <wtkx:script src="demo.js"/>
>>> <PushButton buttonData="Click Me!" buttonPressListeners="$buttonPressListener1, $buttonPressListener2"/>
>>>
>>> and:
>>>
>>> <PushButton buttonData="Click Me!">
>>>    <buttonPressListeners>
>>>        <foo:MyButtonPressListener1/>
>>>        <foo:MyButtonPressListener2/>
>>>    </buttonPressListeners>
>>> </PushButton>
>>>
>>> In Java, the code would still look like:
>>>
>>> myPushButton.getButtonPressListeners().add(buttonPressListener1);
>>> myPushButton.getButtonPressListeners().add(buttonPressListener2);
>>>
>>> We could then get rid of the setButtonPressListener() method (and others like it).
>>>
>>> I kinda like it. What do others think?
>>>
>>> Greg
>>>
>>>
>>>
>>>
>>> >
>>>
>>
>>--~--~---------~--~----~------------~-------~--~----~
>>You received this message because you are subscribed to the Google Groups "pivot-toolkit" group.
>>To post to this group, send email to pivot-toolkit@googlegroups.com
>>To unsubscribe from this group, send email to pivot-toolkit+unsubscribe@googlegroups.com
>>For more options, visit this group at http://groups.google.com/group/pivot-toolkit?hl=en
>>-~----------~----~----~----~------~----~------~--~---
>>
>>
>>
>