JavaFx + xtend a sensational perfect match


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.

Here’s the builder:

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.

This entry was posted in e(fx)clipse. Bookmark the permalink.

1 Response to JavaFx + xtend a sensational perfect match

  1. Pingback: JavaFX + xtend an ongoing love | Tomsondev Blog

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.