So I couldn’t resist – and just for Chris Aniszczyk 😉 – another blog post on this topic. So I wrapped my head around this builder stuff of xtend and with the sources provided by Sven at github I managed to write a small builder for JavaFX.
and this an resulting example code:
Now the problem is that make a builder for all FXClasses one uses is not really a practical thing but the nice thing is that most of them are Beans so I added a builder method that accepts a class as the first parameter and uses reflection to create an instance.
and even autocompleteing still works in this case:
I pushed the sources to my github repo. Maybe there’s a better solution to the reflection workaround I used but currently this looks quite good.
Pingback: JavaFX + xtend an ongoing love | Tomsondev Blog