pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From calathus <calat...@gmail.com>
Subject Re: [pivot] are there any tools to convert bxml to Java?
Date Mon, 03 Jan 2011 16:29:35 GMT
On Mon, Jan 3, 2011 at 5:09 AM, Greg Brown <gk_brown@verizon.net> wrote:

> > I will report some of the issues I faced later.
> > (e.g, the attribute setting invocation sometimes must be called after all
> elements are added.. but this looks not good API design for Pivot..)
> Attributes are always processed in the closing tag. This is so cases such
> as the following are properly handled:
> <TabPane selectedIndex="2">
>    <tabs>
>        <Label text="A"/>
>        <Label text="B"/>
>        <Label text="C"/>
>    </tabs>
> </TabPane>
> If the attribute was processed in the opening tag, we'd get an
> IndexOutOfBoundsException, since the Labels would not have been added yet.

This is the problem I faced. But most of other attribute seems OK to set at
the opening tag.
If Pivot is used only through BXML, these order are hidden from user, it may
not matter.
But if it is directly used in Java codes, this makes code hard to read.
since many case, there are a lot of included elements, and after all these
elements, attributes must be set. these codes are far from the corresponding
 element instantiation code.

Also this cases, I wonder why it just can't set the initial index value. The
Pivot code may select element after tabs tag is closed if selectedIndex is
In Scala, this may be implemented with lazy select function.

> G


View raw message