From 00fbcdfc9fe8d39e32679abb733489461c7bec10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 21 Feb 2019 13:01:13 +0100 Subject: [PATCH] Shorten code --- .../util/controls/ToolbarTitledPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/ToolbarTitledPane.java b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/ToolbarTitledPane.java index 722e95cf49..7ec3b541ac 100644 --- a/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/ToolbarTitledPane.java +++ b/pmd-ui/src/main/java/net/sourceforge/pmd/util/fxdesigner/util/controls/ToolbarTitledPane.java @@ -10,6 +10,8 @@ import java.util.Objects; import org.reactfx.value.Val; import org.reactfx.value.Var; +import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil; + import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.scene.Node; @@ -24,7 +26,7 @@ import javafx.scene.layout.StackPane; * Supported by some CSS in designer.less. * * @author Clément Fournier - * @since 7.0.0 + * @since 6.11.0 */ public final class ToolbarTitledPane extends TitledPane { @@ -63,12 +65,10 @@ public final class ToolbarTitledPane extends TitledPane { // The title region is provided by the skin, // this is the only way to access it outside of css StackPane titleRegion = (StackPane) parent; - toolBar.maxHeightProperty().unbind(); - toolBar.maxHeightProperty().bind(titleRegion.heightProperty()); - toolBar.minHeightProperty().unbind(); - toolBar.minHeightProperty().bind(titleRegion.heightProperty()); - toolBar.prefHeightProperty().unbind(); - toolBar.prefHeightProperty().bind(titleRegion.heightProperty()); + + DesignerUtil.rewire(toolBar.maxHeightProperty(), titleRegion.heightProperty()); + DesignerUtil.rewire(toolBar.minHeightProperty(), titleRegion.heightProperty()); + DesignerUtil.rewire(toolBar.prefHeightProperty(), titleRegion.heightProperty()); }); }