changeset 7430:26573bfa3a11

[SCENEBUILDER] (partial) DTL-6760 Make so that Controller classes of Kit can be instantiated while FX is not initialized
author yjoan
date Fri, 04 Jul 2014 17:12:26 +0200
parents 1f4a206cca0c
children 9a14dd8d9f7d
files apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java	Fri Jul 04 17:10:40 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java	Fri Jul 04 17:12:26 2014 +0200
@@ -162,8 +162,7 @@
     private View currentView = View.TABLE;
 
     private String searchPattern;
-    private static final Image lookups = new Image(
-            CssPanelController.class.getResource("images/css-lookup-icon.png").toExternalForm()); //NOI18N
+    private static Image lookups = null;
 
     private static final String NO_MATCHING_RULES = I18N.getString("csspanel.no.matching.rule");
 
@@ -2025,6 +2024,15 @@
         String l = CssValueConverter.toCssString(style.getCssProperty(), style.getCssRule(), style.getParsedValue());
         return new Label(l);
     }
+    
+    private static Image getLookupImage() {
+        if (lookups == null) {
+            lookups = new Image(
+                CssPanelController.class.getResource("images/css-lookup-icon.png").toExternalForm()); //NOI18N
+        }
+        
+        return lookups;
+    }
 
     private static Node createLookupUI(
             final CssProperty item, final PropertyState ps, final CssStyle style,
@@ -2035,7 +2043,7 @@
         final HBox hbox = new HBox();
         hbox.setMaxWidth(Region.USE_PREF_SIZE);
         ImageView imgView = new ImageView();
-        imgView.setImage(lookups);
+        imgView.setImage(getLookupImage());
         hbox.getChildren().addAll(n, imgView);
         MenuButton lookupMb = new MenuButton();
         lookupMb.setGraphic(hbox);