CSS Attribute Description and Validation (for JavaFX)


As part of e(fx)clipse we are implementing a custom CSS-Editor based upon Xtext.

We have a grammer of CSS-Specification so that we can parse CSS-Files, the interesting part though e.g. which properties are available, what values they can have is at least for JavaFX not speced in a machine useable format but as plain HTML.

There are rules in this file but they are not useable for tools so we defined our own small language to store the information in a structured format so that we can make use of them in the CSS-Editor to:

  • Show documentation
  • Provide attribute proposals
  • Provide value proposals
  • Validate attribute values

Today we’ve reached an important first milestone by showing the documentation of attributes and elements.

The language definition looks like this:

and results in the following documentation tooltips in our CSS-Xtext-Editor:

If you’d like to follow the implementation or want to take a look at the CSS-Definition-Grammer we’ve developed you can do this by cloning our git-repo and use the cssext-branch

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

5 Responses to CSS Attribute Description and Validation (for JavaFX)

  1. very very cool Tom !!!!

  2. Bill van Melle says:

    Excellent! Looks like this was a bunch of work. You could almost auto-generate the table portions of the css doc with this. I wonder if there’s any way the JavaFX people would be willing to maintain it for you :).

  3. Daniel Zimmermann says:

    Ah. That sounds great! I hated to re-read the spec all the time 😉

  4. Pingback: Java desktop links of the week, September 3 | Jonathan Giles

  5. Pingback: JavaFX links of the week, September 3 // JavaFX News, Demos and Insight // FX Experience

Leave a comment

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