JavaFX · FXML · Groovy · GroovyFX
GrooveFX adds flow controls to FXML: iteration, conditionals, and multi-case branching directly in XML markup. No DSL. No FXML replacement.
Examples
<?import page.codeberg.rrangelo.groovefx.IterablePane?> <VBox> <IterablePane items="{myList}"> <HBox> <Label text="{item.name}" /> <Label text="{item.email}" /> </HBox> </IterablePane> </VBox>
<?import page.codeberg.rrangelo.groovefx.ConditionalPane?> <ConditionalPane test="{condition}"> <then> ... </then> <else> ... </else> </ConditionalPane>
<?import page.codeberg.rrangelo.groovefx.DynamicPane?> <DynamicPane test="{user.role}"> <when value="ADMIN"> ... </when> <when value="USER"> ... </when> <default> ... </default> </DynamicPane>
// In-memory PaginatedList<User> paginated = new PaginatedList<>(allUsers); paginated.setPage(0, 10); // Database PaginatedList<User> paginated = new PaginatedList<>(); paginated.setAction((page, size, filters, sort) -> { Page<User> result = userRepository.findAll( PageRequest.of(page, size) ); paginated.setTotalItems((int) result.getTotalElements()); paginated.setTotalPages(result.getTotalPages()); return result.getContent(); }); paginated.setPage(0, 10);
Why GrooveFX?
Iteration, conditionals, and multi-case branching directly in XML markup, without boilerplate in the controller.
Components listen to ObservableValue and update automatically on state changes.
Ready-to-use pagination model, compatible with in-memory lists and any ORM or database repository.
Works with Java, Groovy, and GroovyFX. Compatible with GraalVM and GluonFX. No DSL, no reflection hacks.
Components
IterablePane
Iterates a list using the parent container's layout.
ConditionalPane
Boolean branching with <then> and <else> branches.
DynamicPane
Multi-case with <when> and <default>.
PaginatedList
Pure data model for in-memory or DB pagination.
ConditionPane
Base class with shared deepClone and render.
PaginateAction
Interface implementable as a lambda in Java or a closure in Groovy.
Requirements
Java
17 or later (LTS)
Apache Groovy
4.x
JavaFX
17 or later
provided by the application
GraalVM / GluonFX
Compatible
optional
Installation
<dependency> <groupId>page.codeberg.rrangelo</groupId> <artifactId>groovefx</artifactId> <version><!-- version --></version> </dependency>
Support the project
If you find GrooveFX useful, consider supporting its development.