> How about
>
> <Window namedStyles="{ buttons: @button_styles.json, labels :
> {color:'#ff0000'} }"/>
BeanSerializer isn't capable of detecting an embedded @ symbol, and I don't
think it should be. That would impose too many assumptions about the content of
an attribute.
> Hmmm, all this makes me wonder why we don't use a pure-JSON format for UI
> files???
JSON doesn't provide any support for custom types, so you'd need to extend the
syntax; for example:
Window: {
title: "My Window Title",
content: BoxPane: [
Label {
text: "My Label Text"
}
]
}
YAML does something like this, as does JavaFX. It's not out of the question and
could be an interesting future exercise. However, I don't think there's
anything wrong with the XML approach for now (it is conceptually similar to
HTML, MXML, and XAML, which most developers are already familiar with).
G