Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101519

Application wide style sheet

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: None
    • Fix Version/s: 8
    • Component/s: javafx

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dgrieve David Grieve
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: