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.

About these ads

Trackbacks/Pingbacks

  1. JavaFX + xtend an ongoing love | Tomsondev Blog - May 29, 2012

    [...] 29, 2012 by Tom Schindl 0 Comments So I’ve already blogged (here and here) about the prefect match between JavaFX and [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 676 other followers

%d bloggers like this: