changeset 6523:c58357d30622

RT-29629: redirect navigation control mouse events to behavior. Reviewed by: jgiles
author David Grieve<david.grieve@oracle.com>
date Wed, 19 Mar 2014 19:49:59 -0400
parents 27df155347e9
children c5ebcc5268b4
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Wed Mar 19 16:39:42 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Wed Mar 19 19:49:59 2014 -0400
@@ -60,6 +60,7 @@
 import javafx.scene.accessibility.Attribute;
 import javafx.scene.accessibility.Role;
 import javafx.scene.control.*;
+import javafx.scene.input.MouseEvent;
 import javafx.scene.input.TouchEvent;
 import javafx.scene.layout.HBox;
 import javafx.scene.layout.StackPane;
@@ -737,6 +738,12 @@
         public NavigationControl() {
             getStyleClass().setAll("pagination-control");
 
+            // redirect mouse events to behavior
+            addEventHandler(MouseEvent.MOUSE_PRESSED,  (e) -> getBehavior().mousePressed(e));
+            addEventHandler(MouseEvent.MOUSE_RELEASED, (e) -> getBehavior().mouseReleased(e));
+            addEventHandler(MouseEvent.MOUSE_ENTERED,  (e) -> getBehavior().mouseEntered(e));
+            addEventHandler(MouseEvent.MOUSE_EXITED,   (e) -> getBehavior().mouseExited(e));
+
             controlBox = new HBox();
             controlBox.getStyleClass().add("control-box");