Blog
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, ...