Support for JavaFX 2 CSS in IntelliJ IDEA 12.1
This is the second part of the serie about Java FX 2 support in the upcoming IntelliJ IDEA 12.1. Today we would show some features dedicated to help you to skin your JavaFX application with CSS. We would use the same sample application we were using in the previous post.
As you know JavaFX allows to configure stylesheets for nodes in your .fxml. IntelliJ IDEA helps to complete existing .css files:
You may rename, move, etc your .css file, the reference would be updated accordingly. If you deside to add one more stylesheet and want to convert attribute value to subtag, the IDE would also help you here.
Accepting intention Expand ‘stylesheets’ to tag would result in the following structure:
Given configured stylesheets file IDEA is able to complete registered style classes.
You can safely rename styleclasses, these references would be also updated accordingly. Of cause it is also possible to navigate from .fxml to corresponding stylesheets/styleclasses.
On the other hand you may want to skin the application right in .fxml and this is also possible (with all support which you may expect):
When no style is configured for the element, default styleclass would be used. It’s possible to modify it’s default content. Completion with default style classes is also available:
As you can see color gutter icon (and also color chooser) are also supported exactly the same way it is done in common .css.
When you need to skin more presicely you may want to set separate style class per node. It is possible to do so in JavaFX based on fx:id attribute. IntelliJ IDEA would suggest you to choose from all available id’s:
It’s also possible to get quick documentation for selected property.
That’s all for today. In the next post we’ll show how can IntelliJ IDEA help you to package your JavaFX Application.
Those who haven’t read the first part can find it here.
Develop with Pleasure!
Subscribe to Blog updates
Top 10 UI Updates in IntelliJ IDEA for 2023
Hey there, fellow developers! Today, we want to share the most significant UI updates from 2023 that have transformed how IntelliJ IDEA looks and functions. New UI Of course, the highlight of our recent updates was the launch of our new, clean, and modern UI. This was first announced at the en…
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…
Import Postman Collections to the HTTP Client
We know that many of you use Postman collections and want to stay in the flow while working with them. This means staying inside IntelliJ IDEA and not switching to a different app. Great news! You can now effortlessly transform Postman collections into .http and use them in the HTTP Client …