Giter Club home page Giter Club logo

fxwrap-maven-plugin's Introduction

FXWrap

Travis CI

A Maven plugin to generate boilerplate loading code for FXML resources.

Example

Assuming a FXML resource called ExamplePane.fxml is available at compile- and run-time the following code can then be used:

FXMLLoader loader = ExamplePaneFXML.getInstance().load();
Pane root = loader.getRoot();
ExampleController controller = loader.getController();

Generated Class

FXWrap generates a class for every FXML file it finds at compile-time. These are singletons with a method public String getRelativePath() which returns the path to the FXML file and public FXMLLoader load() throws IOException which loads the FXML file and returns the loader (a new FXMLLoader is used every time).

Usage

To add the plugin you must add it to your POM along with a helper plugin and the JitPack repository.

<plugin>
     <groupId>com.github.Fylipp</groupId>
     <artifactId>fxwrap-maven-plugin</artifactId>
     <version>v1.0.1</version>
 </plugin>
 
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>build-helper-maven-plugin</artifactId>
     <version>3.0.0</version>
     <executions>
         <execution>
             <id>test</id>
             <phase>generate-sources</phase>
             <goals>
                 <goal>add-source</goal>
             </goals>
             <configuration>
                 <sources>
                     <source>${project.build.directory}/generated-sources</source>
                 </sources>
             </configuration>
         </execution>
     </executions>
 </plugin>
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Configuration Options

Option Type Default Description
classNameTemplate String %sFXML The template for generated class names
outputDirectory File ${project.build.directory}/generated-sources/ The output directory
resourceDirectories Resource[] ${project.build.resources} The directories to scan
fxmlFileFormat String fxml The file extension used by FXML files

License

MIT.

fxwrap-maven-plugin's People

Contributors

fylipp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.