modules/controls/src/main/java/com/sun/javafx/scene/control/skin/WebColorFieldSkin.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -25,18 +25,20 @@
 
 package com.sun.javafx.scene.control.skin;
 
 import java.util.Locale;
 
+import com.sun.javafx.scene.control.WebColorField;
 import javafx.beans.InvalidationListener;
 import javafx.geometry.NodeOrientation;
 import javafx.scene.Node;
+import javafx.scene.control.skin.ColorPickerSkin;
 import javafx.scene.paint.Color;
 
 /**
  */
-class WebColorFieldSkin extends InputFieldSkin {
+public class WebColorFieldSkin extends InputFieldSkin {
     private InvalidationListener integerFieldValueListener;
     private boolean noChangeInValue = false;
 
     /**
      * Create a new WebColorFieldSkin.

@@ -89,11 +91,11 @@
     }
 
     protected void updateText() {
         Color color = ((WebColorField) control).getValue();
         if (color == null) color = Color.BLACK;
-        getTextField().setText(ColorPickerSkin.formatHexString(color));
+        getTextField().setText(Utils.formatHexString(color));
     }
 
     protected void updateValue() {
         if (noChangeInValue) return;
         Color value = ((WebColorField) control).getValue();

@@ -105,11 +107,11 @@
                     ((WebColorField) control).setValue(newValue);
                 } else {
                     // calling setText results in updateValue - so we set this flag to true
                     // so that when this is true updateValue simply returns.
                     noChangeInValue = true; 
-                    getTextField().setText(ColorPickerSkin.formatHexString(newValue));
+                    getTextField().setText(Utils.formatHexString(newValue));
                     noChangeInValue = false;
                 }
             } catch (java.lang.IllegalArgumentException ex) {
                 System.out.println("Failed to parse ["+text+"]");
             }