How can I create my own CSS pseudo classes in Java FX 2?
So that in CSS file I could use this style
.MyButton : online{ }
In FX 1 it could be done overriding methods like
public long impl_getPseudoClassState() {}
but they are now deprecated :-(
Is there a new way?
With the public API of JavaFX 8.0 it is possible to introduce custom css pseudo classes.
Node#pseudoClassStateChanged(PseudoClass, boolean)Currently you can't do it. Here is what is stated in JavaFX CSS Reference Guide about this:
At this time, the programming interfaces necessary for a class to declare support for CSS properties, to convert and load these values from CSS style sheets into object variables, and to declare and notify changes to an object's pseudo-classes, are considered internal interfaces and are not accessible directly to applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With