You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Michael Allman <ms...@allman.ms> on 2010/07/02 23:57:47 UTC

Re: WTKXSerializer -> BeanSerializer

On Mon, 19 Apr 2010, Greg Brown wrote:

> The fact that WTKXSerializer doesn't have any dependencies on WTK is 
> almost a strong enough argument on its own to move it to pivot-core.

Maybe it should?

WTKX and WTKXSerializer are very elegant in their simplicity, but they 
aren't as convenient as they could be for UI markup.  And that's what WTKX 
is for, right?

One thing that's been bugging me as I work on my first Pivot project is 
the verbosity of specifying styles on elements.  Why can't styles be 
specified as attributes on the element in their own right?  Instead of

<BoxPane styles="{ backgroundColor: 'red', horizontalAlignment: 'left' }"/>

how about

<BoxPane backgroundColor="red" horizontalAlignment="left"/>

?

The latter syntax is significantly more compact and IMHO much more 
readable.  Of course, there's no reason the current syntax for settings 
styles couldn't be retained.

To handle this syntax, the parser could look for a skin property matching 
an attribute name if the component itself has no such property.

Cheers,

Michael

Re: WTKXSerializer -> BeanSerializer

Posted by Michael Allman <ms...@allman.ms>.
I'm going to retract this message indefinitely as upon further reflection 
I am not fully committed to it.

Cheers,

Michael


On Fri, 2 Jul 2010, Michael Allman wrote:

> On Mon, 19 Apr 2010, Greg Brown wrote:
>
>> The fact that WTKXSerializer doesn't have any dependencies on WTK is almost 
>> a strong enough argument on its own to move it to pivot-core.
>
> Maybe it should?
>
> WTKX and WTKXSerializer are very elegant in their simplicity, but they aren't 
> as convenient as they could be for UI markup.  And that's what WTKX is for, 
> right?
>
> One thing that's been bugging me as I work on my first Pivot project is the 
> verbosity of specifying styles on elements.  Why can't styles be specified as 
> attributes on the element in their own right?  Instead of
>
> <BoxPane styles="{ backgroundColor: 'red', horizontalAlignment: 'left' }"/>
>
> how about
>
> <BoxPane backgroundColor="red" horizontalAlignment="left"/>
>
> ?
>
> The latter syntax is significantly more compact and IMHO much more readable. 
> Of course, there's no reason the current syntax for settings styles couldn't 
> be retained.
>
> To handle this syntax, the parser could look for a skin property matching an 
> attribute name if the component itself has no such property.
>
> Cheers,
>
> Michael
>

Re: WTKXSerializer -> BeanSerializer

Posted by Greg Brown <gk...@mac.com>.
>> The fact that WTKXSerializer doesn't have any dependencies on WTK is almost a strong enough argument on its own to move it to pivot-core.
> 
> Maybe it should?

It has been moved to pivot-core and renamed BXMLSerializer for Pivot 2.0.

> One thing that's been bugging me as I work on my first Pivot project is the verbosity of specifying styles on elements.  Why can't styles be specified as attributes on the element in their own right?  Instead of
> 
> <BoxPane styles="{ backgroundColor: 'red', horizontalAlignment: 'left' }"/>
> 
> how about
> 
> <BoxPane backgroundColor="red" horizontalAlignment="left"/>

That could be a bit confusing, since it looks like they are properties of the BoxPane. However, you can do this if you prefer:

<BoxPane>
    <styles backgroundColor="red" horizontalAlignment="left"/>
</BoxPane>