Skip to content

dooApp/FXBinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FXBinding

The binding you need.

FXBinding allow you to create advanced JavaFX binding on complex model.

Let me show an example :

private StringBinding nameBinding = new FXStringBinding() {
        @Override
        protected void configure() {
            try {
                addObservable(aProperty);
                addObservable(aProperty.get().bProperty());
                addObservable(aProperty.get().bProperty().get().cProperty());
                addObservable(aProperty.get().bProperty().get().cProperty().get().stringProperty());
            } catch (NullPointerException ignored) {
            }
        }
        @Override
        protected String compute() {
            try {
                return aProperty.get().bProperty().get().cProperty().get().stringProperty().get();
            } catch (NullPointerException e) {
                return null;
            }
        }
    };

Every time the model is changing, we will reconfigure the binding to always get the value you want.

Maven

To add FXBinding to your project, add this on the pom.xml

<dependencies>
    <dependency>
        <groupId>com.dooapp</groupId>
        <artifactId>FXBinding</artifactId>
        <version>0.0.1</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>fxbinding</id>
        <url>https://raw.github.com/dooApp/FXBinding/maven/</url>
        <name>fxbinding</name>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
     </repository>
</repositories>

Build Status