{"id":1592,"date":"2014-10-09T17:38:07","date_gmt":"2014-10-09T15:38:07","guid":{"rendered":"http:\/\/www.jensd.de\/wordpress\/?p=1592"},"modified":"2014-10-09T17:38:07","modified_gmt":"2014-10-09T15:38:07","slug":"the-jdk-8u20-tap-trap","status":"publish","type":"post","link":"https:\/\/www.jensd.de\/wordpress\/?p=1592","title":{"rendered":"The JDK 8u20 &#8220;Tap trap&#8221;"},"content":{"rendered":"<p>When switching MQTT.fx to  JDK 8u20 I was nicked by the fix of <a href=\"http:\/\/hg.openjdk.java.net\/openjfx\/8u-dev\/rt\/rev\/07114320d480\" title=\"http:\/\/hg.openjdk.java.net\/openjfx\/8u-dev\/rt\/rev\/07114320d480\" target=\"_blank\">RT-24658<\/a>.<br \/>\nThe fix definitely makes sense but may clash with my <a href=\"http:\/\/www.jensd.de\/wordpress\/?p=1332\" title=\"TabPaneDetacher: Make your tabs detachable\" target=\"_blank\">TabPaneDetacher<\/a> approach.<\/p>\n<p>In <a href=\"http:\/\/www.mqttfx.org\" title=\"MQTT.fx\" target=\"_blank\">MQTT.fx<\/a> the content of the Tabs is disabled as long the MQTT-Broker is not connected.<br \/>\nAnd I am using Property Bindings for this. E.g. in the PublishController &#8220;publishBox&#8221; is the root of the Publish-Tab content and it is bound to the <code><strong>brokerConnectedProperty()<\/strong><\/code>:<br \/>\n[java]<br \/>\npublishBox.disableProperty().bind(model.brokerConnectedProperty().not());<br \/>\n[\/java]<\/p>\n<p>This worked well until JDK 8u20 as now this leads into:<br \/>\n<code><strong><br \/>\nException in thread \"JavaFX Application Thread\" java.lang.RuntimeException: A bound value cannot be set.<br \/>\n\tat javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:139)<br \/>\n\tat javafx.scene.Node.setDisable(Node.java:1539)<br \/>\n        [...]<br \/>\n<\/strong><\/code><br \/>\nThis is because each time when e.g. adding a <code><strong>Tab<\/strong><\/code> to a <code><strong>TabPane <\/strong><\/code> <code><strong>updateDisabled()<\/strong><\/code> is called to <strong>explicitly SET<\/strong> the disabled value of the content also:<\/p>\n<p>[java]<br \/>\n private void updateDisabled() {<br \/>\n        boolean disabled = isDisable() || (getTabPane() != null &#038;&#038; getTabPane().isDisabled());<br \/>\n        setDisabled(disabled);<\/p>\n<p>        \/\/ Fix for RT-24658 &#8211; content should be disabled if the tab is disabled<br \/>\n        Node content = getContent();<br \/>\n        if (content != null) {<br \/>\n            content.setDisable(disabled);<br \/>\n        }<br \/>\n    }<br \/>\n[\/java]<\/p>\n<p><strong>Options to deal with this:<\/strong><br \/>\nQuit using Binding here and use <code><strong>ChangeListener<\/strong><\/code> instead.<br \/>\nOr simply wrap the content root in another Pane.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When switching MQTT.fx to JDK 8u20 I was nicked by the fix of RT-24658. The fix definitely makes sense but may clash with my TabPaneDetacher approach. In MQTT.fx the content of the Tabs is disabled as long the MQTT-Broker is not connected. And I am using Property Bindings for this. E.g. in the PublishController &#8220;publishBox&#8221;&hellip; <span class=\"clear\"><\/span><a href=\"https:\/\/www.jensd.de\/wordpress\/?p=1592\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">The JDK 8u20 &#8220;Tap trap&#8221;<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"The JDK 8u20 \"Tap trap\" http:\/\/wp.me\/p38FCL-pG","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[51,52,4],"tags":[107,108,76],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p38FCL-pG","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1592"}],"collection":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1592"}],"version-history":[{"count":12,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions"}],"predecessor-version":[{"id":1604,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions\/1604"}],"wp:attachment":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}