changeset 1823:7e671f637e68

Fixed com.sun API for listening to cell changes on a VirtualFlow, should have had getters and setters not public field.
author "Jasper Potts"
date Mon, 22 Oct 2012 17:40:59 -0700
parents 732db3a8f698
children 3a9f57c30378
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java
diffstat 1 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Mon Oct 22 17:10:28 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Mon Oct 22 17:40:59 2012 -0700
@@ -222,7 +222,6 @@
      * between 0 and 1.
      */
     private double position;
-    public Runnable cellChangeNotification;
 
     public double getPosition() {
         return position;
@@ -236,6 +235,33 @@
             requestLayout();
         }
     }
+
+    /**
+     * Cell change notification listener.
+     */
+    private Runnable cellChangeNotification;
+
+    /**
+     * Get the cell change notification listener. This can be set by the control
+     * skin when it needs to react to changes in the set of visible cells.
+     *
+     * @return The current cell change notification listener
+     */
+    public Runnable getCellChangeNotificationListener() {
+        return cellChangeNotification;
+    }
+
+    /**
+     * Set the cell change notification listener. This can be set by the control
+     * skin when it needs to react to changes in the set of visible cells. There
+     * is only one listener for performance reasons so setting it will replace
+     * any existing listener.
+     *
+     * @param listener The cell change notification listener to set
+     */
+    public void setCellChangeNotificationListener(Runnable listener) {
+        this.cellChangeNotification = listener;
+    }
     
     /**
      * Use this (temporary) key to set a fixed cell length in the ListView,