changeset 5914:b6f3f3d2ef2d

RT-31132: Focus traversable can't be switched off for date picker
author jgiles
date Fri, 13 Dec 2013 08:39:21 +1300
parents c9b8d00649f7
children d0b4bb09641b
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Fri Dec 13 08:31:54 2013 +1300
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Fri Dec 13 08:39:21 2013 +1300
@@ -28,9 +28,6 @@
 import com.sun.javafx.scene.control.behavior.ComboBoxListViewBehavior;
 import java.util.List;
 
-import com.sun.javafx.scene.control.behavior.TextFieldBehavior;
-import com.sun.javafx.scene.traversal.TraversalEngine;
-import javafx.application.Platform;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.beans.value.ChangeListener;
@@ -388,7 +385,7 @@
         if (textField != null) return textField;
         
         textField = comboBox.getEditor();
-        textField.setFocusTraversable(true);
+        textField.focusTraversableProperty().bindBidirectional(comboBox.focusTraversableProperty());
         textField.promptTextProperty().bind(comboBox.promptTextProperty());
         textField.tooltipProperty().bind(comboBox.tooltipProperty());
 
@@ -579,6 +576,7 @@
         _listView.setId("list-view");
         _listView.placeholderProperty().bind(comboBox.placeholderProperty());
         _listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
+        _listView.setFocusTraversable(false);
 
         _listView.getSelectionModel().selectedIndexProperty().addListener(new InvalidationListener() {
              @Override public void invalidated(Observable o) {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java	Fri Dec 13 08:31:54 2013 +1300
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java	Fri Dec 13 08:39:21 2013 +1300
@@ -284,7 +284,7 @@
         if (textField != null) return textField;
 
         textField = datePicker.getEditor();
-        textField.setFocusTraversable(true);
+        textField.focusTraversableProperty().bindBidirectional(datePicker.focusTraversableProperty());
         textField.promptTextProperty().bind(datePicker.promptTextProperty());
 
         textField.focusedProperty().addListener(new ChangeListener<Boolean>() {