changeset 6546:20efa4fd3487

RT-22842: [Accessibility] ColorPicker keyboard accessibility
author jgiles
date Thu, 20 Mar 2014 16:40:02 +1300
parents eee373287ad8
children 372a4994afcd
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ColorPalette.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/InputFieldSkin.java
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ColorPalette.java	Mon Mar 24 11:45:37 2014 +0100
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ColorPalette.java	Thu Mar 20 16:40:02 2014 +1300
@@ -25,9 +25,6 @@
 
 package com.sun.javafx.scene.control.skin;
 
-import javafx.geometry.Bounds;
-import javafx.scene.control.ColorPicker;
-import java.util.List;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
@@ -35,10 +32,18 @@
 import javafx.event.ActionEvent;
 import javafx.event.Event;
 import javafx.event.EventHandler;
+import javafx.geometry.Bounds;
 import javafx.geometry.NodeOrientation;
 import javafx.geometry.Pos;
 import javafx.geometry.Side;
-import javafx.scene.control.*;
+import javafx.scene.control.ColorPicker;
+import javafx.scene.control.ContextMenu;
+import javafx.scene.control.Hyperlink;
+import javafx.scene.control.Label;
+import javafx.scene.control.MenuItem;
+import javafx.scene.control.PopupControl;
+import javafx.scene.control.Separator;
+import javafx.scene.control.Tooltip;
 import javafx.scene.input.KeyEvent;
 import javafx.scene.input.MouseButton;
 import javafx.scene.input.MouseEvent;
@@ -51,6 +56,8 @@
 import javafx.scene.shape.StrokeType;
 import javafx.stage.WindowEvent;
 
+import java.util.List;
+
 import static com.sun.javafx.scene.control.skin.ColorPickerSkin.getString;
 
 public class ColorPalette extends Region {
@@ -236,6 +243,7 @@
                         } else {
                             processLeftKey(ke);
                         }
+                        ke.consume();
                         break;
                     case RIGHT:
                         if (getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) {
@@ -243,15 +251,20 @@
                         } else {
                             processRightKey(ke);
                         }
+                        ke.consume();
                         break;
                     case UP:
                         processUpKey(ke);
+                        ke.consume();
                         break;
                     case DOWN:
                         processDownKey(ke);
+                        ke.consume();
                         break;
+                    case SPACE:
                     case ENTER:
                         processSelectKey(ke);
+                        ke.consume();
                         break;
                     default: // no-op
                 }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/InputFieldSkin.java	Mon Mar 24 11:45:37 2014 +0100
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/InputFieldSkin.java	Thu Mar 20 16:40:02 2014 +1300
@@ -90,6 +90,7 @@
         };
 
         textField.setId("input-text-field");
+        textField.setFocusTraversable(false);
         control.getStyleClass().addAll(textField.getStyleClass());
         textField.getStyleClass().setAll(control.getStyleClass());
         control.getStyleClass().addListener(InputFieldStyleClassListener = new InvalidationListener() {