changeset 204:05a39a4e6788

RT-18532: [ComboBox] exception is thrown, when you try to hide/open dropDown, when showing property is unidirectionaly binded.
author jgiles
date Thu, 29 Dec 2011 16:33:33 +1000
parents 8251a20df5da
children 4499bb1a2e44
files javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java
diffstat 1 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Thu Dec 29 16:10:43 2011 +1000
+++ b/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Thu Dec 29 16:33:33 2011 +1000
@@ -26,12 +26,15 @@
 package javafx.scene.control;
 
 import com.sun.javafx.css.StyleManager;
-import javafx.beans.property.*;
+import javafx.beans.property.BooleanProperty;
+import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.ObjectPropertyBase;
+import javafx.beans.property.SimpleBooleanProperty;
+import javafx.beans.property.SimpleObjectProperty;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
-import javafx.scene.control.ButtonBase;
-import javafx.scene.control.Control;
-import javafx.scene.control.TextField;
 
 /**
  * Abstract base class for ComboBox-like controls. A ComboBox typically has
@@ -204,14 +207,18 @@
      * form of popup or dialog window.
      */
     public void show() {
-        if (!isDisabled()) showing.set(true);
+        if (!isDisabled() && ! showingProperty().isBound()) {
+            showing.set(true);
+        }
     }
 
     /**
      * Closes the popup / dialog that was shown when {@link #show()} was called.
      */
     public void hide() {
-        showing.set(false);
+        if (! showingProperty().isBound()) {
+            showing.set(false);
+        }
     }
     
     /**
@@ -223,7 +230,9 @@
      *         for developers or designers to access this function directly.
      */
     public void arm() {
-        setArmed(true);
+        if (! armedProperty().isBound()) {
+            setArmed(true);
+        }
     }
 
     /**
@@ -234,7 +243,9 @@
      *         for developers or designers to access this function directly.
      */
     public void disarm() {
-        setArmed(false);
+        if (! armedProperty().isBound()) {
+            setArmed(false);
+        }
     }