Home

Awesome

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


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

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

<a href="https://github.com/garzy" target="_blank">GaRzY</a>
GaRzY
<a href="https://github.com/garzy" target="_blank">github.com/garzy</a>

Support

Reach out to me at one of the following places!


License

License: LGPL v3