Bind named read-only observables toward FXML views

This commit is contained in:
2026-11-23 18:22:59 +01:00
parent e915ed392f
commit 981cd68f49
7 changed files with 275 additions and 27 deletions
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import de.neitzel.fx.view.BindingList?>
<?import de.neitzel.fx.view.DirectBinding?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns:fx="http://javafx.com/fxml/1"
fx:controller="de.neitzel.fx.view.readable.ReadableSourcesController">
<fx:define>
<BindingList>
<DirectBinding control="commit" property="disable" path="disabled" direction="view"/>
<DirectBinding control="title" property="text" path="title" direction="view"/>
<DirectBinding control="caption" property="text" path="observableTitle" direction="view"
converter="de.neitzel.fx.view.readable.ReadableSourcesController$Caption"/>
</BindingList>
</fx:define>
<Button fx:id="commit" text="Commit"/>
<Label fx:id="title"/>
<Label fx:id="caption"/>
<TextField fx:id="unrelated"/>
</VBox>