JavaFX micro-framework that follows MVVM Pattern with Google Guice dependency Injection

Overview

ReactiveDeskFX (JavaFX and Google Guice MVVM Pattern micro-framework)

JavaFX micro-framework to develop very fast JavaFX components with minimal code following MVVM architecture pattern with passive view.

FXML auto-loading with Google Guice dependency Injection.

License: LGPL v3 Build Status Quality Gate Status


Installation

This library is compatible with java 11 or higher version, lower versions are not supported

Maven artifact

<dependency>
  <groupId>com.tangorabox</groupId>
  <artifactId>reactive-desk-fx</artifactId>
  <version>1.0.2</version>
</dependency>

Features

  • An a 'ready to go' ReactiveApplication class that extends Application to auto-instance the Guice Injector, simply extend it and override the startReactiveApp(Stage primaryStage) to start your JavaFX Application with Guice Injection. @Inject attributes of your Application class are ready to use in startReactiveApp method call

  • Automatic FXML file loading (your component must be inyected, don't use new)

  • ReactiveModel combines multiple JavaFX properties in only one model which has invalidation events

  • Injection of custom components inside your view (through @Inject)

  • Convention over Configuration: you don't need to specify the component of .fxml, simply place .fxml with the same name in the same location of your component (you must set up maven accord for that)

  • Optional tag `fxml:controller´ in your .fxml (only needed if you want IDE features)


Example project

If you want to see how to code with this framework please visit my ResumeFX project witch uses that.


Usage Steps

  1. .fxml file must have <fx:root> tag (fx:controller attribute it's optional)
  2. View class must extend the class of your top node in level hierarchy of your .fxml (type attribute of fx:root)
  3. View class must be annotated with @FXMLView (com.tangorabox.reactivedesk.FXMLView)
  4. After injection logic can be done in @FML void initialize() method as usually in JavaFX (or implementing Initializable interface)

Maven configuration for nested .fxml

.fxml files must be placed at the same level of it's .java component, If you want place .fxml in the same package, not in resources folder, you must set up maven accordingly:

<build>
    <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.build.sourceDirectory}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>${project.build.testSourceDirectory}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>
</build>

Limitations

When custom component is included inside another .fxml, there should be no customization properties in the tag, or fxml loading will crash on runtime.

Non compliant example:

  <CustomComponent fx:id="myComponent" text="Hello World" maxWidth="800"/>

Compliant example

  <HBox maxWidth="800">
    <CustomComponent fx:id="myComponent"/>
  </HBox>

As you can see, restrict size values through a wrapping Parent, or set this in fxml or your CustomComponent, or in the view code.

If you want to set the text "hello world" please do it programmatically in your view code.

Inspiration Projects

  • Afterburner.fx: I think that it's FXMLView class generate multiple empty useless classes in projects, one for each view

  • JuiceFx: my fork of Afterburner.fx to add @Guice injection features

  • mvvmFX: interesting alternative but seems to have problems with java11+

  • fx-guice: very similar to my project, and I could have used it, but it seems the project is very old and is dead

Contributing

If you want to contribute to upgrade this project with new features or fixing bugs, you're welcome, please make a pull request.


Team

GaRzY
GaRzY
github.com/garzy

Support

Reach out to me at one of the following places!


License

License: LGPL v3

You might also like...

Lightweight JavaFX Framework for Kotlin

Lightweight JavaFX Framework for Kotlin

TornadoFX JavaFX Framework for Kotlin Important: TornadoFX is not yet compatible with Java 9/10 Oracle is intending to decouple JavaFX from the JDK. W

Dec 29, 2022

A lightweight RCP framework for JavaFX applications.

A lightweight RCP framework for JavaFX applications.

WorkbenchFX The one and only framework to build large JavaFX Applications! Maven To use this framework as part of your Maven build simply add the foll

Jan 8, 2023

😉PrettyZoo is a GUI for Zookeeper created by JavaFX and Apache Curator Framework.

😉PrettyZoo is a GUI for Zookeeper created by JavaFX and Apache Curator Framework.

😉 Pretty nice Zookeeper GUI, Support Win / Mac / Linux Platform

Jan 5, 2023

Collection of Binding helpers for JavaFX(8)

Advanced-Bindings for JavaFX (8) advanced-bindings is a collection of useful helpers and custom binding implementations to simplify the development of

Nov 19, 2022

A library of +70 ready-to-use animations for JavaFX

AnimateFX A library of ready-to-use animations for JavaFX Features: Custom animations Custom interpolators Play/Stop animation Play an animation after

Jan 5, 2023

BootstrapFX: Bootstrap for JavaFX

BootstrapFX: Bootstrap for JavaFX

BootstrapFX BootstrapFX is a partial port of Twitter Bootstrap for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original whi

Dec 28, 2022

Allow runtime modification of JavaFX CSS

Allow runtime modification of JavaFX CSS

cssfx ⚠ WARNING ⚠ In version 11.3.0 we have relocated & refactored the project. maven groupId has been changed to fr.brouillard.oss java module name h

Jan 2, 2023

MDI components for JavaFX

MDI components for JavaFX

DesktopPaneFX DesktopPaneFX is a JavaFX version of Swing’s JDesktopPane which can be used as a container for individual "child" similar to JInternalFr

Sep 23, 2022

Efficient VirtualFlow for JavaFX

Flowless Efficient VirtualFlow for JavaFX. VirtualFlow is a layout container that lays out cells in a vertical or horizontal flow. The main feature of

Nov 24, 2022
Releases(reactive-desk-fx-1.0.2)
Owner
TangoraBox
#indie studio composed by a cat and a box to develop #javafx apps
TangoraBox
组件化、极简依赖、模块单独运行、mvvm、kotlin、koin、jetpack(livedata、viewmodel、lifecycle、viewbinding、...)、buildsrc、coroutines

相关内容 组件化、支持模块单独运行 androidx mvvm kotlin koin jetpack(livedata、viewmodel、lifecycle、viewbinding、...) buildsrc coroutines liveeventbus ... 项目用到的依赖库 APK下载体

panyy 51 Jan 3, 2023
Full Featured Google Chrome Dev Tools to JavaFX WebView browser debugging.

JavaFX WebView Debugger Via WebSocket connection to Google Chrome Dev Tools JavaFx WebView debugging with Chrome Dev tools is highly dependent on Goog

Vladimir Schneider 56 Dec 19, 2022
Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.

FXTrayIcon Library intended for use in JavaFX applications that makes adding a System Tray icon easier. The FXTrayIcon class handles all the messy AWT

Dustin Redmond 248 Dec 30, 2022
Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Peter Rogge 13 Apr 13, 2022
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
Docking framework for JavaFX platform

Docking framework for JavaFX platform AnchorFX is a gratis and open source library for JavaFX to create graphical interfaces with docking features Anc

Alessio Vinerbi 197 Oct 15, 2022
A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

CalendarFX A Java framework for creating sophisticated calendar views based on JavaFX. A detailed developer manual can be found online: CalendarFX 8 D

DLSC Software & Consulting GmbH 660 Jan 6, 2023
A JavaFX UI framework to create fully customized undecorated windows

CustomStage A JavaFX undecorated stage which can fully be customized Donations If this project is helpful to you and love my work and feel like showin

Oshan Mendis 186 Jan 6, 2023
A framework for easily creating forms for a JavaFX UI.

FormsFX Forms for business application made easy. Creating forms in Java has never been this easy! Maven To use this framework as part of your Maven b

DLSC Software & Consulting GmbH 534 Dec 30, 2022
Desktop/Mobile JavaFX application framework

Basilisk is desktop/mobile application development platform for the JVM. Inspired by Griffon, Basilisk leverages JavaFX and JavafXPorts to bring the s

Basilisk 55 Feb 10, 2022