changeset 2138:36814b27de0e

[Findbugs] Field only ever set to null: com.sun.javafx.scene.control.behavior.TextFieldBehavior.scrollDirection
author jgiles
date Fri, 04 Jan 2013 17:30:49 +1300
parents 8eaa6d17d913
children f550745ae62f
files javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextFieldBehavior.java
diffstat 1 files changed, 0 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextFieldBehavior.java	Fri Jan 04 17:30:09 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextFieldBehavior.java	Fri Jan 04 17:30:49 2013 +1300
@@ -60,45 +60,7 @@
  * Text field behavior.
  */
 public class TextFieldBehavior extends TextInputControlBehavior<TextField> {
-    public static final int SCROLL_RATE = 15;
     private TextFieldSkin skin;
-    private HorizontalDirection scrollDirection = null;
-    private Timeline scrollSelectionTimeline = new Timeline();
-    private EventHandler<ActionEvent> scrollSelectionHandler = new EventHandler<ActionEvent>() {
-        @Override
-        public void handle(ActionEvent event) {
-            TextField textField = getControl();
-
-            IndexRange selection = textField.getSelection();
-            int start = selection.getStart();
-            int end = selection.getEnd();
-
-            switch (scrollDirection) {
-                case RIGHT: {
-                    if (end < textField.getLength()) {
-                        end++;
-                        textField.selectRange(start, end);
-                    }
-
-                    break;
-                }
-
-                case LEFT: {
-                    if (start > 0) {
-                        start--;
-                        textField.selectRange(start, end);
-                    }
-
-                    break;
-                }
-
-                default: {
-                    throw new RuntimeException();
-                }
-            }
-        }
-    };
-
     private ContextMenu contextMenu;
     private TwoLevelFocusBehavior tlFocus;
 
@@ -110,10 +72,6 @@
             contextMenu.getStyleClass().add("text-input-context-menu");
         }
 
-        // Initialize scroll timeline
-        scrollSelectionTimeline.setCycleCount(Timeline.INDEFINITE);
-        List<KeyFrame> scrollTimelineKeyFrames = scrollSelectionTimeline.getKeyFrames();
-        scrollTimelineKeyFrames.add(new KeyFrame(Duration.millis(SCROLL_RATE), scrollSelectionHandler));
         handleFocusChange();
 
         // Register for change events