changeset 9584:f4c4d2980d68

8149818: TableView localization could not be changed after first usage
author leifs
date Wed, 24 Feb 2016 11:37:27 -0800
parents 3ccf14ef836f
children a0af67ebeb65
files modules/controls/src/main/java/javafx/scene/control/skin/ListViewSkin.java modules/controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java modules/controls/src/main/java/javafx/scene/control/skin/TableHeaderRow.java modules/controls/src/main/java/javafx/scene/control/skin/TableViewSkinBase.java
diffstat 4 files changed, 23 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/skin/ListViewSkin.java	Wed Feb 24 17:32:22 2016 +0530
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/ListViewSkin.java	Wed Feb 24 11:37:27 2016 -0800
@@ -75,8 +75,6 @@
      *                                                                         *
      **************************************************************************/
 
-    private static final String EMPTY_LIST_TEXT = ControlResources.getString("ListView.noContent");
-
     // RT-34744 : IS_PANNABLE will be false unless
     // javafx.scene.control.skin.ListViewSkin.pannable
     // is set to true. This is done in order to make ListView functional
@@ -93,6 +91,10 @@
      *                                                                         *
      **************************************************************************/
 
+    // JDK-8090129: This constant should not be static, because the
+    // Locale may change between instances.
+    private static final String EMPTY_LIST_TEXT = ControlResources.getString("ListView.noContent");
+
     private final VirtualFlow<ListCell<T>> flow;
 
     /**
--- a/modules/controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java	Wed Feb 24 17:32:22 2016 +0530
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java	Wed Feb 24 11:37:27 2016 -0800
@@ -81,14 +81,6 @@
      *                                                                         *
      **************************************************************************/
 
-    private static final String DONE = ControlResources.getString("ProgressIndicator.doneString");
-
-    /** doneText is just used to know the size of done as that is the biggest text we need to allow for */
-    private static final Text doneText = new Text(DONE);
-    static {
-        doneText.getStyleClass().add("text");
-    }
-
 
 
     /***************************************************************************
@@ -97,6 +89,13 @@
      *                                                                         *
      **************************************************************************/
 
+    // JDK-8090129: This constant should not be static, because the
+    // Locale may change between instances.
+    private final String DONE = ControlResources.getString("ProgressIndicator.doneString");
+
+    /** doneText is just used to know the size of done as that is the biggest text we need to allow for */
+    private final Text doneText = new Text(DONE);
+
     final Duration CLIPPED_DELAY = new Duration(300);
     final Duration UNCLIPPED_DELAY = new Duration(0);
 
@@ -127,6 +126,8 @@
 
         this.control = control;
 
+        doneText.getStyleClass().add("text");
+
         // register listeners
         registerChangeListener(control.indeterminateProperty(), e -> initialize());
         registerChangeListener(control.progressProperty(), e -> updateProgress());
--- a/modules/controls/src/main/java/javafx/scene/control/skin/TableHeaderRow.java	Wed Feb 24 17:32:22 2016 +0530
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/TableHeaderRow.java	Wed Feb 24 11:37:27 2016 -0800
@@ -72,10 +72,6 @@
      *                                                                         *
      **************************************************************************/
 
-    private static final String MENU_SEPARATOR =
-            ControlResources.getString("TableView.nestedColumnControlMenuSeparator");
-
-
 
     /***************************************************************************
      *                                                                         *
@@ -83,6 +79,11 @@
      *                                                                         *
      **************************************************************************/
 
+    // JDK-8090129: This constant should not be static, because the
+    // Locale may change between instances.
+    private final String MENU_SEPARATOR =
+            ControlResources.getString("TableView.nestedColumnControlMenuSeparator");
+
     private final VirtualFlow flow;
     private final TableViewSkinBase<?,?,?,?,?> tableSkin;
     private Map<TableColumnBase, CheckMenuItem> columnMenuItems = new HashMap<TableColumnBase, CheckMenuItem>();
--- a/modules/controls/src/main/java/javafx/scene/control/skin/TableViewSkinBase.java	Wed Feb 24 17:32:22 2016 +0530
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/TableViewSkinBase.java	Wed Feb 24 11:37:27 2016 -0800
@@ -89,9 +89,6 @@
 
     private static final double GOLDEN_RATIO_MULTIPLIER = 0.618033987;
 
-    private static final String EMPTY_TABLE_TEXT = ControlResources.getString("TableView.noContent");
-    private static final String NO_COLUMNS_TEXT = ControlResources.getString("TableView.noColumns");
-
     // RT-34744 : IS_PANNABLE will be false unless
     // javafx.scene.control.skin.TableViewSkin.pannable
     // is set to true. This is done in order to make TableView functional
@@ -108,6 +105,11 @@
      *                                                                         *
      **************************************************************************/
 
+    // JDK-8090129: These constants should not be static, because the
+    // Locale may change between instances.
+    private final String EMPTY_TABLE_TEXT = ControlResources.getString("TableView.noContent");
+    private final String NO_COLUMNS_TEXT = ControlResources.getString("TableView.noColumns");
+
     VirtualFlow<I> flow;
 
     private boolean contentWidthDirty = true;