Programmatic JavaFXBuilder w/o JavaFX bean properties
java.whoover at gmail.com
Fri May 25 05:20:02 PDT 2012
I was thinking that we could use something like the existing
Bindings.bindBidirectional(property1, property2), but utilize what FXML has
done under the hood...
Then we could do something like Bindings.bind(person, "location.name",
myJavaFxControlProperty). Where the specified JavaFX Property would be
systematically bound (one-way) from the specified Property to the passed
POJO path. This capability would at least give us a way to bind without
creating a lot of boiler-plate code that is currently needed (i.e. JavaFX
properties for all the domain model POJO properties used within an
application). I noticed that most of the implementation for this currently
exists within various components used by the FXMLLoader class. So, I would
suspect that it would be trivial to implement?
An even better solution would be to introduce an extension provider where
other java specifications like JPA could play a role in the binding process.
For example, JPA provides a mechanism to annotate an @Entity with
@PrePersist, @PostPersist, @PreRemove, @PostRemove, @PreUpdate, @PostUpdate,
and @PostLoad which allows a JPA binding provider implementation to capture
changes to an @Entity POJO. Now, we could allow bi-directional binding using
JavaFX control properties and JPA @Entity fields... Every time an @Entity
field changes it can be reflected in the JavaFX control. Maybe something
like Bindings.addProvider(myJpaToJavaFxBindingProvider) and
From: Richard Bair [mailto:richard.bair at oracle.com]
Sent: Thursday, May 24, 2012 9:30 PM
To: Will Hoover
Cc: openjfx-dev at openjdk.java.net
Subject: Re: Programmatic JavaFXBuilder w/o JavaFX bean properties
I'm not sure what you have in mind?
On May 24, 2012, at 11:07 AM, Will Hoover <java.whoover at gmail.com> wrote:
> Is there a way to programmatically use some of the automatic POJO binding
> capabilities of the JavaFXBuilder class?
> I know we can use JavaFX bean properties using Bindings like
> http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm , but who wants
> to create a property for all the fields used in an domain entity/model
More information about the openjfx-dev