> 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.
Correct - many attributes can be set in the opening tag, but any that have dependencies on child elements cannot. Since there is no harm in setting all attributes in the closing tag, that is what we do. > 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. Agreed, but if you are hand-coding using your builder style, you can put the setters wherever you like. If you are using a BXML to Java converter, it doesn't really matter where they go because the generated code isn't really meant to be human-readable (that's what BXML is for). > 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 > defined. Not sure what you mean. TabPane has a default value for selectedIndex. However, TabPane doesn't know anything about a closing tag - only BXMLSerializer knows about that. G
