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

StyleManager stylesheet handling doesn't make CSS to be applied.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7-pool
    • Fix Version/s: fx2.0.2
    • Component/s: javafx
    • Environment:

      b05.
      Product: javafx-2.0.2beta
      Platform: macosx-universal
      Build-Number: 29
      Build-ID: 2011-10-18_20-34-34

      Description

      The issue is located in the stylesheets content application. Node.setStyle works fine. Happen with b05.

      We have lost the dynamic application support. This seems related to StyleManager.getInstance().replaceStylesheet.

      When adding a CSS file to the scene builder we are doing:
      1) Remove the file if it already exists:
      scene.getStylesheets().remove(fileURL.toExternalForm());
      2) Parse the file and prefix all its rule with a container id.
      3) Add the file to the scene:
      scene.getStylesheets().add(url.toExternalForm());
      4)Call the style manager to replace the Stylesheet with the rewritten one:
      StyleManager.getInstance().replaceStylesheet(scene, parsedStyleSheet);

      Some observations that can help you figure out the problems:

      - The call to StyleManager.getInstance() makes the CSS to be not applied. I commented it and were able to see style applied.

      - I added StyleManager.getInstance().updateStylesheets(scene); after having called replaceStyleSheet and observed that the CSS is again applied.

      - When we detect that a css file has been modified, we are reloading it (following the described algorithm), now, any updates done in the file are not taken into account. New rules or value changes are not reflected.

      - As soon as we have a fix for it, I will provide you with a unit test that could be nice for you to add to yours.

        Attachments

        1. CSSTest.zip
          14 kB
        2. RT-17521
          20 kB

          Activity

            People

            • Assignee:
              dgrieve David Grieve
              Reporter:
              jfdenise Jean-Francois Denise (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: