A 'BXMLExpander' tool is another possibility.  It would take an input
BXML file, process each Transformable, expand it into BXML, and then
output to a new file.

For those of you familiar with the fantastic Project Lombok, this
would be equivalent to the 'delombok' tool.
http://projectlombok.org/
http://projectlombok.org/features/delombok.html


In a simple example this BXML fragment ...
<PasswordInput>
  <wtk:TextInput tooltipText="Using supplied TextInput" text="secret" />
</PasswordInput>

... would be expanded to
<TextInput tooltipText="Using supplied TextInput" text="secret"
password="true" prompt="Enter password" />


Such a tool might require an additional change to BXML serializer to
support this scenario
PasswordDecorator sets properties of the 'textInput' Component, but it
was already created in a previous XML element.  I don't think it is
currently possible to represent this in BXML (as there is no real
use-case to support it).
bxml:reference adds/sets the referenced object, but this scenario
would require just dereferencing before modifying the object in some
way.

<bxml:define>
  <TextInput bxml:id="textInput" />
</bxml:define>

<!-- Tweak any TextInput's properties to make it into a 'password'
style component -->
<PasswordDecorator target="$textInput" />



Combining a number of ideas from before, this change allows the
following workflow
- An offshore design team in country X could rapidly prototype a Pivot GUI
- built using their in house library of custom, powerful Transformables
- (which are all in the native language of country X)
- without having any knowledge of Pivot (just using a simple BXML viewer app)
- and then 'expand' the resulting BXML files to generate standard BXML
files which reference only org.apache.pivot.wtk.* classes.
- without having to reveal their highly prized Transformables to the
client or their competitors

All of the above could be achieved by the offshore team if it made
this proposed change to BXMLSerializer themselves.  However if it was
officially supported (ie, bundled into the Pivot jars), they would be
able to share their library of Transformables with the Pivot community
in a similar way to how css stylesheets, blog themes, or application
skins are shared.

Chris

Reply via email to