Using Xtext to create JavaFX-CSS Editor


While working on the example application showed in my last blog

I missed the possibility to edit the CSS-Files used to theme JavaFX-applications.

Having heard about Xtext and that it allows one easily create editors for your DSL (and CSS is nothing more) I decided to start teaching myself some Xtext and so I sat down the last 2 evenings and worked on an editor to author CSS-Files for JavaFX.

First of all I had (or better still have) not a really a knowledge about language design, LL-Parsers, … so what I produced until now is probably nonsense. Anyways even if not 100% correct yet I have a working editor which is able to parse the FX-CSS-File coming with the JavaFX 2.0 example.

It’s quite amazing at least for me as a total newbie to all this stuff to get an editor with autocompletion, … working in such a short time – Xtext rocks. If someone who has more knowledge about all this stuff and wants to help me / give feedback – the sources are available from my github-repository.

Maybe this Xtext-based editor can be used to build a JavaFX-Tooling and Runtime-Stack on top of Eclipse technologies:

  • Xtext to build tooling to author CSS-Files
  • JDT/PDE to develop OSGi based JavaFX applications (I already filed bugs against JavaFX to make it run without hacks in an OSGi-Env which are built using
  • Window Builder to write a visual editor
  • The Eclipse 4.x Application Platform as a runtime container / framework to build JavaFX-Applications using DI, the workbench model, …
  • Xtext/Xbase to build a DSL with a modern syntax supporting closures, …
This entry was posted in e(fx)clipse, e4, Eclipse. Bookmark the permalink.

5 Responses to Using Xtext to create JavaFX-CSS Editor

  1. Pingback: xhtml css templates – Using Xtext to create JavaFX-CSS Editor | Tomsondev Blog | XHTML CSS - Style sheet and html programming tutorial and guides

  2. Pingback: JavaFX links of the week, June 13 // JavaFX News, Demos and Insight // FX Experience

  3. Pingback: Java desktop links of the week, June 13 | Jonathan Giles

  4. Amaury says:

    I’ve been trying to get started with Xtext, but I just can’t get a grasp of how it works. Any good resources that helped you learn Xtext? (I personally find the official documentation is very difficult to comprehend).

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