changeset 1433:30b375f0ad85

RT-20643: add Scene to CssError and Node to CssError.PropertySetError - fix bug found by SceneBuilder testing
author David Grieve<david.grieve@oracle.com>
date Wed, 11 Jul 2012 08:03:29 -0400
parents cefe52608b67
children 1953b610d096
files javafx-ui-common/src/com/sun/javafx/css/CssError.java javafx-ui-common/src/com/sun/javafx/css/StyleManager.java
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/CssError.java	Tue Jul 10 20:22:00 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/CssError.java	Wed Jul 11 08:03:29 2012 -0400
@@ -49,6 +49,9 @@
      */
     public static void setCurrentScene(Scene scene) {
         
+        // Treat as a no-op if noone cares about CssErrors
+        if (StyleManager.getInstance().getErrors() == null) return;
+        
         if (scene != null) {
             // don't make new ref for same scene
             final Scene oldScene = SCENE_REF != null ? SCENE_REF.get() : null;
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Jul 10 20:22:00 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Wed Jul 11 08:03:29 2012 -0400
@@ -1124,6 +1124,9 @@
             
             final List<ParentStylesheetContainer> list = new ArrayList<ParentStylesheetContainer>();
             
+            // RT-20643 
+            CssError.setCurrentScene(parent.getScene());
+            
             for (int n=0, nMax=parentStylesheets.size(); n<nMax; n++) {
                 final String fname = parentStylesheets.get(n);
                 ParentStylesheetContainer container = null;
@@ -1150,6 +1153,8 @@
                 }
                 if (container != null) list.add(container);
             }
+            // RT-20643 
+            CssError.setCurrentScene(null);
             
             return list;
         }