From a092654ded4696806a0133756e45898a22b1f443 Mon Sep 17 00:00:00 2001 From: Konrad Neitzel Date: Thu, 12 Nov 2026 07:27:31 +0100 Subject: [PATCH 1/4] Apply Component FXML attributes after injected initialization --- fx/README.md | 8 ++ .../java/de/neitzel/fx/view/Components.java | 85 ++++++++++++++++++- .../fx/view/EditAddressInAComponentTest.java | 43 ++++++++++ .../fx/view/component/AddressForm.java | 16 ++++ .../fx/view/fixture/SampleAddress.java | 9 ++ .../fx/view/address-component-attributes.fxml | 8 ++ .../address-component-invalid-number.fxml | 3 + .../address-component-invalid-unknown.fxml | 3 + 8 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 fx/src/test/java/de/neitzel/fx/view/fixture/SampleAddress.java create mode 100644 fx/src/test/resources/de/neitzel/fx/view/address-component-attributes.fxml create mode 100644 fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-number.fxml create mode 100644 fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-unknown.fxml diff --git a/fx/README.md b/fx/README.md index 44e8ab2..16c1c9b 100644 --- a/fx/README.md +++ b/fx/README.md @@ -247,6 +247,14 @@ A component's `@ViewModelClass` applies to that component's model, not to the pa ## Component +Component elements accept writable FXML properties, including custom attributes and inherited +layout properties such as `prefWidth`. The container constructs the Component first; its own +FXML and `initialize()` run before the containing document's property values are applied. +JavaFX performs the normal property conversion and rejects unknown properties or invalid values. +Object references such as `model="$address"` retain their identity and are assigned after the +Component's model listener is installed. Static layout constraints such as `GridPane.rowIndex` +remain handled by the containing FXMLLoader. + A component is a class the container can create. It extends a pane, loads `ClassName.fxml` from its own package through `fx:root`, and is the controller of that file. It has no `fx:controller`. It exposes one JavaFX property named `model`. `AddressForm` edits the home address. `VisitForm` edits one visit in the repeated list. `NoteForm` edits a note. `VisitRow` edits one table row. Each is `@Singleton`, extends `VBox` or `HBox`, and has `modelProperty()`. diff --git a/fx/src/main/java/de/neitzel/fx/view/Components.java b/fx/src/main/java/de/neitzel/fx/view/Components.java index 2938917..21fbc4f 100644 --- a/fx/src/main/java/de/neitzel/fx/view/Components.java +++ b/fx/src/main/java/de/neitzel/fx/view/Components.java @@ -6,7 +6,12 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.util.Builder; +import java.io.ByteArrayInputStream; import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.AbstractMap; +import java.util.LinkedHashMap; +import java.util.Set; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; @@ -58,8 +63,84 @@ final class Components { if (!LoadSession.claimFirst(type)) { component = context.createComponent(type.asSubclass(Object.class)); } - Object created = component; - return () -> load(created, context); + return new ComponentBuilder(component, context); + } + + /** + * Collects instance properties while FXML constructs an injected Component. + * Properties are applied after its own document and model listener are ready. + */ + private static final class ComponentBuilder extends AbstractMap implements Builder { + /** The injected instance. */ + private final Object component; + /** The context used to load its document. */ + private final ApplicationContext context; + /** Values already resolved by the containing FXMLLoader. */ + private final Map values = new LinkedHashMap<>(); + + /** + * Creates a builder for an injected instance. + * @param component the instance + * @param context its dependency context + */ + private ComponentBuilder(Object component, ApplicationContext context) { + this.component = component; + this.context = context; + } + + /** + * Records a property for application after Component initialization. + * @param key the property name + * @param value the resolved value + * @return the previous value + */ + @Override + public Object put(String key, Object value) { + return values.put(key, value); + } + + /** + * Returns the recorded properties. + * @return the property entries + */ + @Override + public Set> entrySet() { + return values.entrySet(); + } + + /** + * Loads the Component and applies properties with standard FXML coercion. + * @return the initialized Component + */ + @Override + public Object build() { + Object result = load(component, context); + if (!values.isEmpty()) { + // A second fx:root load uses the public FXMLLoader API for bean setters, + // enum/numeric coercion and diagnostics, without depending on BeanAdapter + // internals or serializing values (which may be Model object references). + FXMLLoader properties = new FXMLLoader(); + properties.setRoot(result); + properties.setClassLoader(result.getClass().getClassLoader()); + StringBuilder document = new StringBuilder(" entry : values.entrySet()) { + String variable = "componentValue" + index++; + properties.getNamespace().put(variable, entry.getValue()); + document.append(' ').append(entry.getKey()).append("=\"$") + .append(variable).append('"'); + } + document.append("/>"); + try { + properties.load(new ByteArrayInputStream(document.toString().getBytes(StandardCharsets.UTF_8))); + } catch (IOException failure) { + throw new IllegalStateException("Could not apply Component properties to " + + result.getClass().getName(), failure); + } + } + return result; + } } /** diff --git a/fx/src/test/java/de/neitzel/fx/view/EditAddressInAComponentTest.java b/fx/src/test/java/de/neitzel/fx/view/EditAddressInAComponentTest.java index a8971cc..41e8d86 100644 --- a/fx/src/test/java/de/neitzel/fx/view/EditAddressInAComponentTest.java +++ b/fx/src/test/java/de/neitzel/fx/view/EditAddressInAComponentTest.java @@ -145,6 +145,49 @@ class EditAddressInAComponentTest { }); } + /** + * Attributes retain FXML conversion and identity while injection precedes setters. + */ + @Test + void componentAttributesApplyAfterInitialization() throws Exception { + onFx(() -> { + var context = new ApplicationContext("de.neitzel.fx.view.component"); + var loaded = ViewLoader.load(getClass().getResource("address-component-attributes.fxml"), + new Person("Ada"), context); + var first = (AddressForm) loaded.getRoot().lookup("#first"); + var second = (AddressForm) loaded.getRoot().lookup("#second"); + assertEquals("Home & work", first.getCaption()); + assertEquals(190, first.getPrefWidth()); + assertEquals(360, first.getMaxWidth()); + assertEquals(false, first.isVisible()); + assertEquals(javafx.geometry.Pos.CENTER_RIGHT, first.getAlignment()); + assertEquals(1, javafx.scene.layout.GridPane.getColumnIndex(first)); + assertSame(first.getModel(), second.getModel()); + assertEquals("Second", second.getCaption()); + assertEquals(280, second.getPrefWidth()); + assertSame(first, context.getComponent(AddressForm.class)); + TextField field = (TextField) first.lookup("#streetField"); + assertEquals("Main", field.getText()); + field.setText("Oak"); + assertEquals("Oak", ((Address) first.getModel()).getStreet()); + }); + } + + /** + * Invalid names and malformed values fail rather than disappearing in the builder. + */ + @Test + void invalidComponentAttributesFailTheLoad() throws Exception { + onFx(() -> { + for (String kind : java.util.List.of("unknown", "number")) { + var context = new ApplicationContext("de.neitzel.fx.view.component"); + org.junit.jupiter.api.Assertions.assertThrows(IllegalStateException.class, + () -> ViewLoader.load(getClass().getResource("address-component-invalid-" + kind + ".fxml"), + new Person("Ada"), context)); + } + }); + } + /** * Runs one check on the JavaFX application thread. * diff --git a/fx/src/test/java/de/neitzel/fx/view/component/AddressForm.java b/fx/src/test/java/de/neitzel/fx/view/component/AddressForm.java index ce1389b..c72716d 100644 --- a/fx/src/test/java/de/neitzel/fx/view/component/AddressForm.java +++ b/fx/src/test/java/de/neitzel/fx/view/component/AddressForm.java @@ -67,6 +67,22 @@ public class AddressForm extends VBox implements HasViewModel { streetLabel.setText(captions.prefix()); } + /** + * Returns the custom caption after initialization. + * @return the caption + */ + public String getCaption() { + return streetLabel.getText(); + } + + /** + * Sets a custom FXML attribute; the label must already be injected. + * @param caption the caption + */ + public void setCaption(String caption) { + streetLabel.setText(caption); + } + /** * Returns the model property a parent view sets with a direct binding. * diff --git a/fx/src/test/java/de/neitzel/fx/view/fixture/SampleAddress.java b/fx/src/test/java/de/neitzel/fx/view/fixture/SampleAddress.java new file mode 100644 index 0000000..4e44167 --- /dev/null +++ b/fx/src/test/java/de/neitzel/fx/view/fixture/SampleAddress.java @@ -0,0 +1,9 @@ +package de.neitzel.fx.view.fixture; + +/** Address that FXML can declare to test object-valued Component attributes. */ +public class SampleAddress extends Address { + /** Creates an initially empty address. */ + public SampleAddress() { + super(""); + } +} diff --git a/fx/src/test/resources/de/neitzel/fx/view/address-component-attributes.fxml b/fx/src/test/resources/de/neitzel/fx/view/address-component-attributes.fxml new file mode 100644 index 0000000..fa21094 --- /dev/null +++ b/fx/src/test/resources/de/neitzel/fx/view/address-component-attributes.fxml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-number.fxml b/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-number.fxml new file mode 100644 index 0000000..2339ab6 --- /dev/null +++ b/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-number.fxml @@ -0,0 +1,3 @@ + + + diff --git a/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-unknown.fxml b/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-unknown.fxml new file mode 100644 index 0000000..7a9d56c --- /dev/null +++ b/fx/src/test/resources/de/neitzel/fx/view/address-component-invalid-unknown.fxml @@ -0,0 +1,3 @@ + + + From 90e08b7835501f6810f12b845d7a9dacd7749425 Mon Sep 17 00:00:00 2001 From: Konrad Neitzel Date: Fri, 13 Nov 2026 19:51:19 +0100 Subject: [PATCH 2/4] Support generated ViewModel defaults and stored property access --- fx/README.md | 4 + fx/docs/generated-viewmodels.md | 9 ++ .../java/de/neitzel/fx/view/ViewModel.java | 7 + .../de/neitzel/fx/view/ViewModelDefaults.java | 65 ++++++++ .../fx/view/ViewModelRegistration.java | 15 ++ .../fx/view/ViewModelRegistrations.java | 10 ++ .../de/neitzel/fx/view/ViewModelRegistry.java | 7 + .../java/de/neitzel/fx/view/ViewModels.java | 10 +- .../fx/view/GeneratedViewModelTest.java | 152 ++++++++++++++++++ .../de.neitzel.fx.view.ViewModelRegistry | 1 + 10 files changed, 275 insertions(+), 5 deletions(-) create mode 100644 fx/docs/generated-viewmodels.md create mode 100644 fx/src/main/java/de/neitzel/fx/view/ViewModelDefaults.java create mode 100644 fx/src/main/java/de/neitzel/fx/view/ViewModelRegistration.java create mode 100644 fx/src/main/java/de/neitzel/fx/view/ViewModelRegistrations.java create mode 100644 fx/src/main/java/de/neitzel/fx/view/ViewModelRegistry.java create mode 100644 fx/src/test/java/de/neitzel/fx/view/GeneratedViewModelTest.java create mode 100644 fx/src/test/resources/META-INF/services/de.neitzel.fx.view.ViewModelRegistry diff --git a/fx/README.md b/fx/README.md index 16c1c9b..dc1ecc4 100644 --- a/fx/README.md +++ b/fx/README.md @@ -503,3 +503,7 @@ These are the `IllegalArgumentException` messages a document can produce. The vi | `No component found for type:` | the container was asked for a controller, component, or converter it did not scan | A conversion failure does not fail the load. It records a message, as [Converter](#converter) describes. + +Generated Java ViewModels can share the existing runtime storage and identity registry; see +[the generated ViewModel runtime contract](docs/generated-viewmodels.md) for stored-property +access, declarative service defaults, compatible overrides and module-path registration. diff --git a/fx/docs/generated-viewmodels.md b/fx/docs/generated-viewmodels.md new file mode 100644 index 0000000..0a62a7e --- /dev/null +++ b/fx/docs/generated-viewmodels.md @@ -0,0 +1,9 @@ +# Generated ViewModel runtime contract + +A generator may extend `ViewModel` with typed constructors and accessors. Accessors call the protected final `storedProperty(name)` method, which returns the existing Attribute property and never invokes a reflective accessor. Unknown stored Attributes fail explicitly. Property storage, write-back, lazy nested Models, collection contents and Messages remain owned by `ViewModel`. + +Modules contribute public `ViewModelRegistry` marker services annotated with repeatable `ViewModelRegistration` declarations. Each declaration names the configured Model, generated base and selected default class. Registries are inspected through `ServiceLoader.Provider.type()` without constructing them; their annotations are also available to non-initializing designer discovery. Classpath applications package `META-INF/services/de.neitzel.fx.view.ViewModelRegistry`; named modules declare `provides` and export/open generated ViewModel packages as appropriate. + +`ViewModelDefaults.select` checks duplicate/conflicting defaults, finds the most-specific applicable Model declaration, and requires an explicit override to extend the corresponding generated base. No declaration preserves generic/default replacement behavior. A compatible explicit request takes precedence before creation. Existing instances are reused for a requested superclass/interface that they satisfy; incompatible requests fail. Nested lazy loading uses the same registry and identity table as direct loading. Failed subclass construction removes its partially registered instance. + +Generated Java source and compiler integration live in NeitzelFXDesigner. This library API is a development snapshot, not a published release. Runtime regressions cover stored identity/write-back, cycles, null children, Messages, compatible/incompatible requests, most-specific defaults, provider non-execution, conflicting contributions and constructor failure cleanup. Existing ungenerated Model and Component tests remain required. diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModel.java b/fx/src/main/java/de/neitzel/fx/view/ViewModel.java index 64950d9..9cf5adc 100644 --- a/fx/src/main/java/de/neitzel/fx/view/ViewModel.java +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModel.java @@ -169,6 +169,13 @@ public class ViewModel { } } + /** Returns a stored Attribute only, without invoking a generated or custom accessor. */ + protected final Property storedProperty(String name) { + Property property = properties.get(name); + if (property == null) throw new IllegalArgumentException("No stored Attribute: " + name); + return property; + } + /** * Returns the JavaFX property for an Attribute name. *

diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModelDefaults.java b/fx/src/main/java/de/neitzel/fx/view/ViewModelDefaults.java new file mode 100644 index 0000000..0a89357 --- /dev/null +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModelDefaults.java @@ -0,0 +1,65 @@ +package de.neitzel.fx.view; + +import java.util.*; + +/** Resolves declarative services without constructing providers or Models. */ +public final class ViewModelDefaults { + private ViewModelDefaults() {} + + public static Class select(Class model, Class explicit, ClassLoader loader) { + var entries = new HashMap, ViewModelRegistration>(); + var origins = new HashMap, String>(); + for (var provider : ServiceLoader.load(ViewModelRegistry.class, loader).stream().toList()) { + Class type = provider.type(); + for (var entry : type.getAnnotationsByType(ViewModelRegistration.class)) { + if (!entry.generated().isAssignableFrom(entry.defaultType())) { + throw new IllegalArgumentException( + "Default must extend generated ViewModel: " + type.getName()); + } + var old = entries.putIfAbsent(entry.model(), entry); + if (old != null + && (old.generated() != entry.generated() + || old.defaultType() != entry.defaultType())) { + throw new IllegalArgumentException( + "Conflicting ViewModel defaults for " + + entry.model().getName() + + " in " + + origins.get(entry.model()) + + " and " + + type.getName()); + } + origins.putIfAbsent(entry.model(), type.getName()); + } + } + var candidates = + entries.values().stream().filter(e -> e.model().isAssignableFrom(model)).toList(); + var best = + candidates.stream() + .filter( + e -> + candidates.stream() + .noneMatch( + other -> + other != e + && e.model() + .isAssignableFrom( + other + .model()))) + .toList(); + if (best.size() > 1) + throw new IllegalArgumentException( + "Ambiguous ViewModel defaults for " + model.getName()); + var chosen = best.isEmpty() ? null : best.getFirst(); + if (explicit != null && explicit != ViewModel.class) { + if (chosen != null && !chosen.generated().isAssignableFrom(explicit)) { + throw new IllegalArgumentException( + "Explicit ViewModel " + + explicit.getName() + + " must extend " + + chosen.generated().getName()); + } + return explicit; + } + return chosen == null ? ViewModel.class : chosen.defaultType(); + } +} diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistration.java b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistration.java new file mode 100644 index 0000000..edd4171 --- /dev/null +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistration.java @@ -0,0 +1,15 @@ +package de.neitzel.fx.view; + +import java.lang.annotation.*; + +/** A compiled, non-executing default declaration contributed by a registry service. */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Repeatable(ViewModelRegistrations.class) +public @interface ViewModelRegistration { + Class model(); + + Class generated(); + + Class defaultType(); +} diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistrations.java b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistrations.java new file mode 100644 index 0000000..f0f58f6 --- /dev/null +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistrations.java @@ -0,0 +1,10 @@ +package de.neitzel.fx.view; + +import java.lang.annotation.*; + +/** Container for generated registry declarations. */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface ViewModelRegistrations { + ViewModelRegistration[] value(); +} diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistry.java b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistry.java new file mode 100644 index 0000000..d805d25 --- /dev/null +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModelRegistry.java @@ -0,0 +1,7 @@ +package de.neitzel.fx.view; + +/** + * Marker service for declarative generated ViewModel registrations. Providers are never + * instantiated. + */ +public interface ViewModelRegistry {} diff --git a/fx/src/main/java/de/neitzel/fx/view/ViewModels.java b/fx/src/main/java/de/neitzel/fx/view/ViewModels.java index b7c6b73..e61143f 100644 --- a/fx/src/main/java/de/neitzel/fx/view/ViewModels.java +++ b/fx/src/main/java/de/neitzel/fx/view/ViewModels.java @@ -47,20 +47,19 @@ final class ViewModels { * @return the ViewModel for that instance, or the replacement */ static Object of(Object model, Class viewModelClass) { + Class selected = ViewModelDefaults.select(model.getClass(), viewModelClass, model.getClass().getClassLoader()); Object existing = BY_INSTANCE.get(model); if (existing != null) { if (viewModelClass != null && viewModelClass != ViewModel.class - && existing.getClass() != viewModelClass) { + && !selected.isInstance(existing)) { throw new IllegalArgumentException( "ViewModel is " + existing.getClass().getName() + " but the View names " + viewModelClass.getName()); } return existing; } - if (viewModelClass == null || viewModelClass == ViewModel.class) { - return new ViewModel(model); - } - return construct(model, viewModelClass); + if (selected == ViewModel.class) return new ViewModel(model); + return construct(model, selected); } /** @@ -101,6 +100,7 @@ final class ViewModels { } return created; } catch (InvocationTargetException failure) { + BY_INSTANCE.remove(model); if (failure.getCause() instanceof RuntimeException runtime) { throw runtime; } diff --git a/fx/src/test/java/de/neitzel/fx/view/GeneratedViewModelTest.java b/fx/src/test/java/de/neitzel/fx/view/GeneratedViewModelTest.java new file mode 100644 index 0000000..a8af5a3 --- /dev/null +++ b/fx/src/test/java/de/neitzel/fx/view/GeneratedViewModelTest.java @@ -0,0 +1,152 @@ +package de.neitzel.fx.view; + +import static org.junit.jupiter.api.Assertions.*; + +import javafx.beans.property.*; + +import org.junit.jupiter.api.Test; + +public class GeneratedViewModelTest { + public static class Node { + private String name = "sample"; + private Node child; + + public String getName() { + return name; + } + + public void setName(String n) { + name = n; + } + + public Node getChild() { + return child; + } + + public void setChild(Node n) { + child = n; + } + } + + public static class Special extends Node {} + + public static class Generated extends ViewModel { + public Generated(Node n) { + super(n); + } + + public StringProperty nameProperty() { + return (StringProperty) storedProperty("name"); + } + + @SuppressWarnings("unchecked") + public Property childProperty() { + return (Property) (Property) storedProperty("child"); + } + + public Property missingProperty() { + return storedProperty("missing"); + } + } + + public static class Custom extends Generated { + public Custom(Node n) { + super(n); + } + } + + public static class Other extends Generated { + public Other(Node n) { + super(n); + } + } + + public static class Specific extends Generated { + public Specific(Special n) { + super(n); + } + } + + @ViewModelRegistration( + model = Node.class, + generated = Generated.class, + defaultType = Custom.class) + @ViewModelRegistration( + model = Special.class, + generated = Specific.class, + defaultType = Specific.class) + public static class Registry implements ViewModelRegistry { + public Registry() { + throw new AssertionError("Provider executed"); + } + } + + @Test + void storedPropertiesWriteBackAndShareCyclesAndMessages() { + Node n = new Node(); + n.setChild(n); + var vm = (Custom) ViewModels.of(n); + assertSame(vm.nameProperty(), vm.property("name")); + vm.nameProperty().set("changed"); + assertEquals("changed", n.getName()); + assertSame(vm, vm.childProperty().getValue()); + assertSame(vm, ViewModels.of(n, Generated.class)); + vm.addMessage(new Message(Message.Severity.INFO, "notice", "name")); + assertEquals("notice", vm.property("latestMessage").getValue()); + assertThrows(IllegalArgumentException.class, vm::missingProperty); + assertThrows(IllegalArgumentException.class, () -> ViewModels.of(n, Other.class)); + } + + @Test + void explicitAndMostSpecificDefaultsAndNullChildren() { + Node n = new Node(); + var custom = (Other) ViewModels.of(n, Other.class); + assertNull(custom.childProperty().getValue()); + assertSame(custom, ViewModels.of(n)); + assertInstanceOf(Specific.class, ViewModels.of(new Special())); + assertThrows(IllegalArgumentException.class, () -> ViewModels.of(new Node(), String.class)); + } + + @ViewModelRegistration( + model = Node.class, + generated = Generated.class, + defaultType = Other.class) + public static class Conflict implements ViewModelRegistry {} + + public static class Failing extends Generated { + public Failing(Node n) { + super(n); + throw new IllegalStateException("failed constructor"); + } + } + + @Test + void conflictingServicesIdentifyBothOrigins() throws Exception { + var folder = java.nio.file.Files.createTempDirectory("viewmodel-services-"); + var service = folder.resolve("META-INF/services/de.neitzel.fx.view.ViewModelRegistry"); + java.nio.file.Files.createDirectories(service.getParent()); + java.nio.file.Files.writeString(service, Conflict.class.getName()); + try (var loader = + new java.net.URLClassLoader( + new java.net.URL[] {folder.toUri().toURL()}, getClass().getClassLoader())) { + var error = + assertThrows( + IllegalArgumentException.class, + () -> ViewModelDefaults.select(Node.class, null, loader)); + assertTrue(error.getMessage().contains(Registry.class.getName())); + assertTrue(error.getMessage().contains(Conflict.class.getName())); + } finally { + try (var paths = java.nio.file.Files.walk(folder)) { + for (var p : paths.sorted(java.util.Comparator.reverseOrder()).toList()) + java.nio.file.Files.delete(p); + } + } + } + + @Test + void failedConstructionDoesNotRetainPartialInstance() { + Node n = new Node(); + assertThrows(IllegalStateException.class, () -> ViewModels.of(n, Failing.class)); + assertInstanceOf(Custom.class, ViewModels.of(n)); + } +} diff --git a/fx/src/test/resources/META-INF/services/de.neitzel.fx.view.ViewModelRegistry b/fx/src/test/resources/META-INF/services/de.neitzel.fx.view.ViewModelRegistry new file mode 100644 index 0000000..d75ee65 --- /dev/null +++ b/fx/src/test/resources/META-INF/services/de.neitzel.fx.view.ViewModelRegistry @@ -0,0 +1 @@ +de.neitzel.fx.view.GeneratedViewModelTest$Registry From 922ede8608c0c5c50a570c2ff160f12eb7e5c1be Mon Sep 17 00:00:00 2001 From: Konrad Neitzel Date: Fri, 13 Nov 2026 23:04:20 +0100 Subject: [PATCH 3/4] Document FX and injection and integrate the Designer reference example --- .gitignore | 3 + README.md | 10 +- fx-example/README.md | 84 +++++++- fx-example/pom.xml | 50 +++++ .../preview/AddressPreviewProvider.java | 31 +++ .../example/preview/DeskPreviewProvider.java | 21 ++ .../example/preview/NotePreviewProvider.java | 22 ++ .../example/preview/PreviewProvidersTest.java | 86 ++++++++ .../fx/example/preview/SampleSession.java | 11 + .../neitzel-fx-designer/examples.properties | 37 ++++ .../fx/example/view/DeskController.java | 12 ++ .../neitzel/fx/example/view/AddressForm.fxml | 3 +- .../de/neitzel/fx/example/view/Desk.fxml | 14 +- .../de/neitzel/fx/example/view/NoteForm.fxml | 3 +- .../de/neitzel/fx/example/view/VisitForm.fxml | 3 +- .../de/neitzel/fx/example/view/VisitRow.fxml | 3 +- fx/README.md | 90 ++++++-- fx/docs/architecture.md | 71 ++++++ fx/docs/generated-viewmodels.md | 52 ++++- fx/docs/integer-spinners.md | 12 ++ fx/docs/quick-start.md | 203 ++++++++++++++++++ fx/docs/tray-support.md | 26 +++ .../java/de/neitzel/fx/view/ViewModels.java | 10 +- injection/README.md | 52 ++++- neitzel-fx-designer.json | 17 ++ 25 files changed, 876 insertions(+), 50 deletions(-) create mode 100644 fx-example/src/designer/java/de/neitzel/fx/example/preview/AddressPreviewProvider.java create mode 100644 fx-example/src/designer/java/de/neitzel/fx/example/preview/DeskPreviewProvider.java create mode 100644 fx-example/src/designer/java/de/neitzel/fx/example/preview/NotePreviewProvider.java create mode 100644 fx-example/src/designer/java/de/neitzel/fx/example/preview/PreviewProvidersTest.java create mode 100644 fx-example/src/designer/java/de/neitzel/fx/example/preview/SampleSession.java create mode 100644 fx-example/src/designer/resources/META-INF/neitzel-fx-designer/examples.properties create mode 100644 fx/docs/architecture.md create mode 100644 fx/docs/quick-start.md create mode 100644 neitzel-fx-designer.json diff --git a/.gitignore b/.gitignore index b5a5fe3..1597ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ debug.out /nbactions.xml dependency-reduced-pom.xml .DS_Store + +# Machine-local designer paths, snapshots and drafts +.neitzel-fx-designer/ diff --git a/README.md b/README.md index 0d9cbc0..9f9cf1e 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Package scanner and type-based container used by `fx`. See [injection/README.md] ### fx-example -Person desk that shows how to use `fx` and `injection`. Run `mvn -pl fx-example -am javafx:run`. See [fx-example/README.md](fx-example/README.md). +Person desk that shows how to use `fx` and `injection`. Build with `./mvnw -pl fx-example -am install`, then run `./mvnw -f fx-example/pom.xml javafx:run`. See [fx-example/README.md](fx-example/README.md). ### gson @@ -68,4 +68,10 @@ Some network stuff using javax.mail as dependency. ### quarkus -Some additions for quarkus that might be useful. \ No newline at end of file +Some additions for quarkus that might be useful. + +## Start a JavaFX project + +The [complete quick start](fx/docs/quick-start.md) includes local snapshot installation, a standalone Maven POM, Java classes, FXML and launch commands. Continue with [MVVM and runtime architecture](fx/docs/architecture.md), the [FXML reference](fx/README.md), and the [person desk walkthrough](fx-example/README.md). The [injection guide](injection/README.md) also covers use without JavaFX. + +Build with Java 21. Maven wrapper version is 3.9.11; the project requires Maven 3.8.6 or later. Library version `1.0-SNAPSHOT` denotes development artifacts, not a published stable release. The parent POM currently ignores Surefire failures: check test reports, as explained in the quick start, rather than relying only on Maven's exit code. diff --git a/fx-example/README.md b/fx-example/README.md index 2013b0e..7ae86bd 100644 --- a/fx-example/README.md +++ b/fx-example/README.md @@ -1,13 +1,85 @@ -# fx-example +# Person desk reference application -A person desk that uses [`fx`](../fx/README.md) and [`injection`](../injection/README.md). The guides use this module as the worked example. +This runnable application demonstrates [NeitzelLib FX](../fx/README.md) and [injection](../injection/README.md) together. It edits one Person with a home Address, nested Note, visit list, selected visit and tags. Use it as a reference for wiring a real screen; the [minimal quick start](../fx/docs/quick-start.md) is the smaller starting point for a new project. -The desk shows a direct binding in each direction, a converter, a computed binding, a view model subclass, a component with a nested note, a repeat, a table with a starting width and an open column, a date column, a list of simple values, and messages. The container side shows `@Config`, `@Singleton`, `@Named`, and injection by constructor, field, and setter. +## Build and run -From the NeitzelLib root, with Java 21: +From the NeitzelLib root with JDK 21: ```bash -mvn -pl fx-example -am javafx:run +./mvnw -pl fx-example -am install +./mvnw -f fx-example/pom.xml javafx:run ``` -The launch class is `de.neitzel.fx.example.Main`. The model is an ordinary `Person`. The view is `Desk.fxml`. `DeskLoadsTest` loads that same desk. +The first command installs local `1.0-SNAPSHOT` artifacts; the second runs only the application module. Do not combine `javafx:run` with `-am`, since the parent has no JavaFX launcher. The repository currently ignores Surefire failures; verify XML reports as shown in the [quick start](../fx/docs/quick-start.md), even when Maven reports success. + +The packaged alternative, after `package` or `install`, is: + +```bash +java -jar fx-example/target/fx-example-1.0-SNAPSHOT.jar +``` + +Keep the adjacent `target/libs` directory with the JAR: the manifest refers to those copied runtime dependencies. A desktop session is required. This example has no `module-info.java`; it is a classpath application. + +## Follow the code + +Paths below are relative to this module. Java sources share `src/main/java/de/neitzel/fx/example/`; FXML resources share `src/main/resources/de/neitzel/fx/example/view/`. + +| File/type | Responsibility | +| --- | --- | +| `Main` | Plain Java launcher calling `Application.launch` | +| `DeskApp` | Scan configuration, fresh sample Model, ViewLoader, Scene and message popup registration | +| `model/Person`, `Address`, `Note`, `Role` | JavaBean data and enum; no JavaFX properties required | +| `view/DeskController` and `Desk.fxml` | Screen handlers, computed greeting, controls and binding declarations | +| `view/PersonViewModel` | Handwritten ViewModel subclass with a derived title | +| `view/AddressForm` and `AddressForm.fxml` | Reusable home subform and injected heading, containing NoteForm | +| `view/NoteForm` and `NoteForm.fxml` | Nested Component bound to the note | +| `view/VisitForm` and `VisitForm.fxml` | Fresh form per repeated Address | +| `view/VisitRow` and `VisitRow.fxml` | Table row with editable fields and a trailing Remove button | +| `src/test/resources/de/neitzel/fx/example/NameLine.fxml` | Test-only second View of the same Person without reusable Component nodes | +| `view/AgeConverter`, `StreetConverter`, `VisitedOnConverter` | Text adaptation, validation failures and ISO dates | + +Use the actual source directories to locate helper services such as `AgeSuffix`, `StreetPolicy` and `FormHeading`. The injection guide explains constructor, field and setter injection with these types. No code generation is required to run this example; `PersonViewModel` is handwritten. + +## Try the behaviors + +1. Change Name. The Model and name echo follow; title and computed greeting refresh. The draft field uses `direction="model"`: its edits write to the Model but later changes from another field do not overwrite it. +2. Edit Age using its `years ` text format. An invalid value stays visible while the previous Model value is retained. A message explains the failure; a valid value clears that conversion failure. +3. Edit the home street. The path-bound label follows. Empty street input fails through `StreetConverter`; the parent receives the child message with the `home.street` source prefix. +4. Edit the nested note. AddressForm's inner NoteForm binds to its own Model. The `Opened as ...` label records initial setup rather than tracking every later city edit. +5. Add a visit. Both the repeated forms and Table gain a row. Edit a street in one representation and observe the same Address in the other. The Table's Remove button delegates to the controller. +6. Select a visit in the ComboBox or Table. Both use the `selectedVisit` Attribute. Resize, sort and filter Table columns; filtering and sorting affect displayed rows without reordering the Model's list. +7. Edit the visited date in ISO form (`yyyy-MM-dd`). Invalid text keeps the old date. Add a tag to see a shared ObservableList of simple values. +8. Try the information, warning and fatal message buttons. Severity is data and logging behavior; a fatal message does not itself exit the application. Close each non-blocking popup normally. + +Changing a JavaBean setter directly after loading does not notify controls. All edits above go through ViewModel properties or observable collections. The [architecture guide](../fx/docs/architecture.md) explains this distinction and why you should normally use a new context for a separate window. + +## Automated regression coverage + +`src/test/java/de/neitzel/fx/example/DeskLoadsTest.java` loads the real Desk FXML on JavaFX and checks initial values, all binding directions, derived/computed text, conversion failures and recovery, child messages, Table edits/removal, message severities and boolean/enum write-back. It also demonstrates that a direct bean setter leaves controls unchanged and that another simple View reuses the same Model's ViewModel. + +Run the reactor tests without installing artifacts with: + +```bash +./mvnw -pl fx-example -am clean verify +``` + +Inspect Surefire XML reports; a successful Maven exit alone is insufficient with the current parent configuration. JavaFX tests need a usable graphical environment. See the Designer integration section below for the optional preview setup; ordinary application tests do not require the Designer. + +## Open the example in NeitzelFXDesigner + +The repository root includes `neitzel-fx-designer.json` with the `person-desk` context. It selects `fx-example`, classpath launch, the `designer-preview` Maven profile, the local runtime key `java21`, and `de.neitzel.fx.example.preview.DeskPreviewProvider`. Configure your own JDK path for that key; machine paths are not part of the shared project configuration. + +The optional profile adds the Designer preview API only to the test source set, compiles `src/designer/java`, includes its resources, and produces Model metadata for Person, Address and Note. It does not add a runtime dependency to the ordinary application, replace its handwritten PersonViewModel, or generate a default ViewModel registry. + +After preparing the Designer's local preview API and metadata processor artifacts, build with: + +```bash +./mvnw -pl fx-example -am -Pdesigner-preview verify +``` + +Check XML test reports as for the normal build. Follow `docs/user-guide/quick-start.md` in the [NeitzelFXDesigner repository](https://gitea.neitzel.de/konrad/NeitzelFXDesigner) for the complete artifact preparation, library-example setup script, local runtime mapping, application launch and Build and Refresh workflow. That guide covers both the standalone host and IntelliJ integration; this profile alone is not a Designer installation. + +FXML documents carry `neitzel-model` processing instructions for discovery. The preview provider offers `desk`, `address`, `visit`, `row` and `note` samples for the corresponding documents. Every session receives fresh sample Models and an injection context; the preview does not install the application's message popups. Open the document, Build and Refresh, choose its matching sample, then start interactive preview. Editing the preview's data does not save those values into the application source. + +The role choices are populated in `DeskController.initialize()` rather than using an application-enum `fx:constant` in FXML, because the current Designer projection cannot resolve that application constant. This is a Designer limitation, not a restriction of NeitzelLib or ordinary FXMLLoader. The regular application still shows the same Role values. diff --git a/fx-example/pom.xml b/fx-example/pom.xml index aa380e5..84617fd 100644 --- a/fx-example/pom.xml +++ b/fx-example/pom.xml @@ -97,4 +97,54 @@ + + + designer-preview + + + de.neitzel.fxdesigner + designer-preview-api + 0.1.0-SNAPSHOT + test + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + designer-preview-sources + generate-test-sources + add-test-sourceadd-test-resource + + src/designer/java + src/designer/resources + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + full + + + de.neitzel.fxdesigner + designer-model-processor + 0.1.0-SNAPSHOT + + + + -Adesigner.models=de.neitzel.fx.example.model.Person,de.neitzel.fx.example.model.Address,de.neitzel.fx.example.model.Note + + + + + + + diff --git a/fx-example/src/designer/java/de/neitzel/fx/example/preview/AddressPreviewProvider.java b/fx-example/src/designer/java/de/neitzel/fx/example/preview/AddressPreviewProvider.java new file mode 100644 index 0000000..3e7170d --- /dev/null +++ b/fx-example/src/designer/java/de/neitzel/fx/example/preview/AddressPreviewProvider.java @@ -0,0 +1,31 @@ +package de.neitzel.fx.example.preview; + +import de.neitzel.fx.example.DeskApp; +import de.neitzel.fx.example.model.Address; +import de.neitzel.fx.example.view.DeskController; +import de.neitzel.fx.example.view.PersonViewModel; +import de.neitzel.fxdesigner.preview.PreviewProvider; +import de.neitzel.fxdesigner.preview.PreviewSession; +import de.neitzel.injection.ApplicationContext; + +/** Independent samples for the nested, repeated and table-row Address components. */ +public final class AddressPreviewProvider implements PreviewProvider { + @Override + public Class

modelType() { + return Address.class; + } + + @Override + public PreviewSession open(String id) { + if (!java.util.Set.of("address", "visit", "row").contains(id)) + throw new IllegalArgumentException("Unknown address example: " + id); + var person = DeskApp.sample(); + var context = new ApplicationContext(DeskApp.class); + // An independently previewed row still needs the parent action's state. + // No Desk.fxml is loaded and no popup listener is installed. + if ("row".equals(id)) + context.getComponent(DeskController.class).setViewModel(new PersonViewModel(person)); + return new SampleSession<>( + "address".equals(id) ? person.getHome() : person.getVisits().getFirst(), context); + } +} diff --git a/fx-example/src/designer/java/de/neitzel/fx/example/preview/DeskPreviewProvider.java b/fx-example/src/designer/java/de/neitzel/fx/example/preview/DeskPreviewProvider.java new file mode 100644 index 0000000..a3811fe --- /dev/null +++ b/fx-example/src/designer/java/de/neitzel/fx/example/preview/DeskPreviewProvider.java @@ -0,0 +1,21 @@ +package de.neitzel.fx.example.preview; + +import de.neitzel.fx.example.DeskApp; +import de.neitzel.fx.example.model.Person; +import de.neitzel.fxdesigner.preview.PreviewProvider; +import de.neitzel.fxdesigner.preview.PreviewSession; +import de.neitzel.injection.ApplicationContext; + +/** Optional test-source preview adapter; it never enters the application distribution. */ +public final class DeskPreviewProvider implements PreviewProvider { + @Override + public Class modelType() { + return Person.class; + } + + @Override + public PreviewSession open(String id) { + if (!"desk".equals(id)) throw new IllegalArgumentException("Unknown desk example: " + id); + return new SampleSession<>(DeskApp.sample(), new ApplicationContext(DeskApp.class)); + } +} diff --git a/fx-example/src/designer/java/de/neitzel/fx/example/preview/NotePreviewProvider.java b/fx-example/src/designer/java/de/neitzel/fx/example/preview/NotePreviewProvider.java new file mode 100644 index 0000000..23db4f4 --- /dev/null +++ b/fx-example/src/designer/java/de/neitzel/fx/example/preview/NotePreviewProvider.java @@ -0,0 +1,22 @@ +package de.neitzel.fx.example.preview; + +import de.neitzel.fx.example.DeskApp; +import de.neitzel.fx.example.model.Note; +import de.neitzel.fxdesigner.preview.PreviewProvider; +import de.neitzel.fxdesigner.preview.PreviewSession; +import de.neitzel.injection.ApplicationContext; + +/** Independent sample for the nested note editor. */ +public final class NotePreviewProvider implements PreviewProvider { + @Override + public Class modelType() { + return Note.class; + } + + @Override + public PreviewSession open(String id) { + if (!"note".equals(id)) throw new IllegalArgumentException("Unknown note example: " + id); + return new SampleSession<>( + DeskApp.sample().getHome().getNote(), new ApplicationContext(DeskApp.class)); + } +} diff --git a/fx-example/src/designer/java/de/neitzel/fx/example/preview/PreviewProvidersTest.java b/fx-example/src/designer/java/de/neitzel/fx/example/preview/PreviewProvidersTest.java new file mode 100644 index 0000000..2c3daa2 --- /dev/null +++ b/fx-example/src/designer/java/de/neitzel/fx/example/preview/PreviewProvidersTest.java @@ -0,0 +1,86 @@ +package de.neitzel.fx.example.preview; + +import static org.junit.jupiter.api.Assertions.*; + +import de.neitzel.fx.example.view.DeskController; +import de.neitzel.fx.view.ViewLoader; + +import javafx.application.Platform; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.concurrent.*; + +class PreviewProvidersTest { + @BeforeAll + static void startToolkit() throws Exception { + var ready = new CountDownLatch(1); + try { + Platform.startup(ready::countDown); + } catch (IllegalStateException alreadyRunning) { + ready.countDown(); + } + assertTrue(ready.await(10, TimeUnit.SECONDS)); + } + + private static void onFx(Runnable action) throws Exception { + var result = new CompletableFuture(); + Platform.runLater( + () -> { + try { + action.run(); + result.complete(null); + } catch (Throwable e) { + result.completeExceptionally(e); + } + }); + result.get(20, TimeUnit.SECONDS); + } + + @Test + void deskSamplesAreFreshAndLoadTheRealDesk() throws Exception { + onFx( + () -> { + var provider = new DeskPreviewProvider(); + var first = provider.open("desk"); + var second = provider.open("desk"); + assertNotSame(first.model(), second.model()); + assertNotSame(first.model().getHome(), second.model().getHome()); + assertNotSame(first.context(), second.context()); + var view = + ViewLoader.load( + DeskController.class.getResource("Desk.fxml"), + first.model(), + first.context()); + assertNotNull(view.getRoot().lookup("#nameField")); + assertEquals("Ada Lovelace", first.model().getName()); + assertTrue(first.ready().toCompletableFuture().isDone()); + assertThrows(IllegalArgumentException.class, () -> provider.open("unknown")); + }); + } + + @Test + void componentSamplesAndIndependentRowActionHaveRequiredState() throws Exception { + onFx( + () -> { + var addresses = new AddressPreviewProvider(); + var home = addresses.open("address"); + assertNotNull(home.model().getNote()); + var visit = addresses.open("visit"); + assertNotNull(visit.model().getVisitedOn()); + var row = addresses.open("row"); + assertDoesNotThrow( + () -> + row.context() + .getComponent(DeskController.class) + .removeVisit(row.model())); + var note = new NotePreviewProvider().open("note"); + assertEquals("Kept at home", note.model().getText()); + assertThrows(IllegalArgumentException.class, () -> addresses.open("desk")); + assertThrows( + IllegalArgumentException.class, + () -> new NotePreviewProvider().open("desk")); + }); + } +} diff --git a/fx-example/src/designer/java/de/neitzel/fx/example/preview/SampleSession.java b/fx-example/src/designer/java/de/neitzel/fx/example/preview/SampleSession.java new file mode 100644 index 0000000..8e29aa7 --- /dev/null +++ b/fx-example/src/designer/java/de/neitzel/fx/example/preview/SampleSession.java @@ -0,0 +1,11 @@ +package de.neitzel.fx.example.preview; + +import de.neitzel.fxdesigner.preview.PreviewSession; +import de.neitzel.injection.ApplicationContext; + +/** The sample owns no timers, network connections or background work to release. */ +record SampleSession(M model, ApplicationContext context) + implements PreviewSession { + @Override + public void close() {} +} diff --git a/fx-example/src/designer/resources/META-INF/neitzel-fx-designer/examples.properties b/fx-example/src/designer/resources/META-INF/neitzel-fx-designer/examples.properties new file mode 100644 index 0000000..a34ff5d --- /dev/null +++ b/fx-example/src/designer/resources/META-INF/neitzel-fx-designer/examples.properties @@ -0,0 +1,37 @@ +format=1 +count=5 +example.0.id=desk +example.0.label=Person desk +example.0.modelType=de.neitzel.fx.example.model.Person +example.0.providerClass=de.neitzel.fx.example.preview.DeskPreviewProvider +example.0.viewResource=de/neitzel/fx/example/view/Desk.fxml +example.0.componentPackage=de.neitzel.fx.example.view + +example.1.id=address +example.1.label=Home address +example.1.modelType=de.neitzel.fx.example.model.Address +example.1.providerClass=de.neitzel.fx.example.preview.AddressPreviewProvider +example.1.viewResource=de/neitzel/fx/example/view/AddressForm.fxml +example.1.componentPackage=de.neitzel.fx.example.view + +example.2.id=visit +example.2.label=Repeated visit +example.2.modelType=de.neitzel.fx.example.model.Address +example.2.providerClass=de.neitzel.fx.example.preview.AddressPreviewProvider +example.2.viewResource=de/neitzel/fx/example/view/VisitForm.fxml +example.2.componentPackage=de.neitzel.fx.example.view + +example.3.id=row +example.3.label=Table row +example.3.modelType=de.neitzel.fx.example.model.Address +example.3.providerClass=de.neitzel.fx.example.preview.AddressPreviewProvider +example.3.viewResource=de/neitzel/fx/example/view/VisitRow.fxml +example.3.componentPackage=de.neitzel.fx.example.view + +example.4.id=note +example.4.label=Address note +example.4.modelType=de.neitzel.fx.example.model.Note +example.4.providerClass=de.neitzel.fx.example.preview.NotePreviewProvider +example.4.viewResource=de/neitzel/fx/example/view/NoteForm.fxml +example.4.componentPackage=de.neitzel.fx.example.view + diff --git a/fx-example/src/main/java/de/neitzel/fx/example/view/DeskController.java b/fx-example/src/main/java/de/neitzel/fx/example/view/DeskController.java index faade7b..fc4b2a9 100644 --- a/fx-example/src/main/java/de/neitzel/fx/example/view/DeskController.java +++ b/fx-example/src/main/java/de/neitzel/fx/example/view/DeskController.java @@ -1,6 +1,7 @@ package de.neitzel.fx.example.view; import de.neitzel.fx.example.model.Address; +import de.neitzel.fx.example.model.Role; import de.neitzel.fx.view.HasViewModel; import de.neitzel.fx.view.Message; import de.neitzel.fx.view.ViewModel; @@ -8,6 +9,7 @@ import de.neitzel.fx.view.ViewModelClass; import jakarta.inject.Singleton; import javafx.fxml.FXML; import javafx.scene.control.TextField; +import javafx.scene.control.ChoiceBox; import java.time.LocalDate; import java.util.List; @@ -35,6 +37,16 @@ public class DeskController implements HasViewModel { @FXML private TextField tagField; + /** Role values are supplied in the application runtime, not instantiated by the designer host. */ + @FXML + private ChoiceBox roleChoice; + + /** Supplies enum choices before the declarative value binding is applied. */ + @FXML + public void initialize() { + roleChoice.getItems().setAll(Role.values()); + } + /** * The person view model, set before the bindings run. */ diff --git a/fx-example/src/main/resources/de/neitzel/fx/example/view/AddressForm.fxml b/fx-example/src/main/resources/de/neitzel/fx/example/view/AddressForm.fxml index 76862bf..7721f0f 100644 --- a/fx-example/src/main/resources/de/neitzel/fx/example/view/AddressForm.fxml +++ b/fx-example/src/main/resources/de/neitzel/fx/example/view/AddressForm.fxml @@ -1,4 +1,5 @@ + @@ -9,7 +10,7 @@ + xmlns:fx="http://javafx.com/fxml/1" spacing="6"> diff --git a/fx-example/src/main/resources/de/neitzel/fx/example/view/Desk.fxml b/fx-example/src/main/resources/de/neitzel/fx/example/view/Desk.fxml index 5f356c7..67caff1 100644 --- a/fx-example/src/main/resources/de/neitzel/fx/example/view/Desk.fxml +++ b/fx-example/src/main/resources/de/neitzel/fx/example/view/Desk.fxml @@ -1,6 +1,6 @@ + - @@ -13,7 +13,6 @@ - @@ -22,7 +21,7 @@ - @@ -70,14 +69,7 @@