-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
As a developer, I would like to be able to set a style sheet on an application wide level so that I can create scenes in any part of my program, any module, without knowing the path to my custom css.
Background:
Swing has a way:
UIManager.setLookAndFeel(mylaf);
I can't seem to find the equivalent of this in JavaFX. I could put the css as a system property, but that would force all classes that create a scene to know about this and use it. That is not a good approach if we talk about applications that has a modularized UI.
Lets say I create a svn client application. Lets say that the application is modularized so that I have a bunch of modules where svn-browser is one and diff-module is another. Now, I create a UI module for the browser and one for the diff module. How am I supposed force the css upon those two UI modules? Because I don't want one of them to look like caspian and the other to look like "myCustom". So I create a third module that acts as a resource module containing the css. But now I have to create a dependency between the other two modules and this. Instead, what I want is to be able to set a default css that overrides caspian, when I create my Application or when the platform is initializing. That way, my third module is redundant and the other two modules don't have to care a bit about where to get a css for skinning.
This is but one use case. Overall, setting a default style sheet would lessen the burdon on any application developer that need to create multiple scenes in very different places in an application.
Disclaimer:
This might be possible already and I have just missed it. If so, this request should be regarded as a request for documentation on how to override caspian as the default style sheet.
Background:
Swing has a way:
UIManager.setLookAndFeel(mylaf);
I can't seem to find the equivalent of this in JavaFX. I could put the css as a system property, but that would force all classes that create a scene to know about this and use it. That is not a good approach if we talk about applications that has a modularized UI.
Lets say I create a svn client application. Lets say that the application is modularized so that I have a bunch of modules where svn-browser is one and diff-module is another. Now, I create a UI module for the browser and one for the diff module. How am I supposed force the css upon those two UI modules? Because I don't want one of them to look like caspian and the other to look like "myCustom". So I create a third module that acts as a resource module containing the css. But now I have to create a dependency between the other two modules and this. Instead, what I want is to be able to set a default css that overrides caspian, when I create my Application or when the platform is initializing. That way, my third module is redundant and the other two modules don't have to care a bit about where to get a css for skinning.
This is but one use case. Overall, setting a default style sheet would lessen the burdon on any application developer that need to create multiple scenes in very different places in an application.
Disclaimer:
This might be possible already and I have just missed it. If so, this request should be regarded as a request for documentation on how to override caspian as the default style sheet.
- relates to
-
JDK-8102210 Add API to JavaFX to allow for setting preferred user agent stylesheet
- Closed