Discover Model paths and compatible binding targets in both hosts

Add non-constructing target metadata and a shared read-only browser for the Person fixtures. Negotiate binding discovery independently, preserve FXML, and explain direction/type mismatches. Record remaining manual navigation checks as explicitly skipped.
This commit is contained in:
2026-11-13 08:57:35 +01:00
parent 2156894fa8
commit 2fe408bb4d
38 changed files with 1087 additions and 37 deletions
@@ -111,6 +111,9 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
private final Path reactorRoot;
private DesignerWorkflow workflow;
private DesignerWorkflow interactiveWorkflow;
private DesignerWorkflow bindingWorkflow;
private BindingBrowser bindingBrowser;
private long bindingRequest;
private boolean interactiveRequested, interactiveRestart;
private long interactiveRequest;
private final java.util.concurrent.atomic.AtomicLong draftChanges =
@@ -161,6 +164,15 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
launch.maven(),
launch.tools(),
this::log);
bindingWorkflow =
new DesignerWorkflow(
host,
launch.configuration(),
launch.context(),
launch.maven(),
launch.tools(),
this::log);
bindingBrowser = new BindingBrowser(this::discoverBindings);
interactiveWorkflow.onInteractiveClosed(
() ->
fx(
@@ -181,6 +193,7 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
workflow.cancel();
fx(
() -> {
invalidateBindings("Document changed; discover bindings again.");
if (interactiveRequested)
interactiveStatus.setText(
"Interactive preview uses earlier drafts; rerun or save to"
@@ -295,7 +308,9 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
var properties = new ScrollPane(componentInspector);
properties.setFitToWidth(true);
properties.setPrefViewportHeight(100);
center.setBottom(properties);
var bindings = new TitledPane("Bindings — discovery", bindingBrowser);
bindings.setExpanded(false);
center.setBottom(new VBox(properties, bindings));
output.setEditable(false);
output.setPrefRowCount(5);
Path origin = file.resolveSibling(file.getFileName() + ".origin");
@@ -599,7 +614,45 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
withDraft(() -> (redo ? document.redo() : document.undo()).whenComplete(this::updated));
}
private void invalidateBindings(String message) {
bindingRequest++;
bindingWorkflow.cancel();
bindingBrowser.invalidate(message);
}
private void discoverBindings(String path, String direction) {
withDraft(
() -> {
long ticket = ++bindingRequest;
bindingBrowser.invalidate("Discovering declared types in target runtime…");
var captured = draft;
bindingWorkflow
.bindings(last, captured, path, direction)
.whenComplete(
(metadata, error) ->
fx(
() -> {
if (closed || ticket != bindingRequest) return;
if (error != null) {
bindingBrowser.invalidate(
"Discovery unavailable: "
+ error.getMessage()
+ ". Build and Refresh, then retry.");
return;
}
bindingBrowser.show(
metadata,
(last
? "explicitly retained build (outdated)"
: "current successful build")
+ " · draft revision "
+ captured.revision());
}));
});
}
private void build(Map<java.net.URI, Long> approvals) {
invalidateBindings("Build changed; discover bindings after Build and Refresh.");
withDraft(
() -> {
renderSequence.incrementAndGet();
@@ -960,6 +1013,8 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
resize.stop();
workflow.close();
interactiveWorkflow.close();
bindingWorkflow.close();
bindingRequest++;
if (document != null) document.close();
}
}