changeset 5168:26e00f0c1674

RT-33148: Allow ComboBox subclasses to disable autohide when the ListView popup is clicked Reviewed-by: psomashe
author jgiles
date Wed, 25 Sep 2013 11:28:58 +1200
parents a1c13e1ce899
children 35ed95c6f4ed
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Sep 24 15:49:41 2013 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Wed Sep 25 11:28:58 2013 +1200
@@ -334,7 +334,13 @@
         
         super.layoutChildren(x,y,w,h);
     }
-    
+
+    // Added to allow subclasses to prevent the popup from hiding when the
+    // ListView is clicked on (e.g when the list cells have checkboxes).
+    protected boolean isHideOnClickEnabled() {
+        return true;
+    }
+
     
     
     /***************************************************************************
@@ -609,7 +615,9 @@
                     }
                 }
                 
-                comboBox.hide();
+                if (isHideOnClickEnabled()) {
+                    comboBox.hide();
+                }
             }
         });