javafx properties are a great way to connect data-model to a javafx gui because their binding model implements a powerful notification-update mechanism.
Properties and bindings are not strictly gui-related, rather they're an extension to javabeans.
So one would like to use them in the application model classes without introducing a dependency on the package javafx.beans.property.StringProperty
and in general from javafx.*
.
In other words: (update)
I may need to split up the application into two modules.
One module should contain just classes that manipulate the data (the Model classes, MVC speaking).
A second module would contain all the graphical gui stuff, that is javafx.
If my data-classes use javafx binding, I would introduce an import javafx.beans.anything;
(the best thing would be that bindings were part of java.* or javax.*, so i wouldn't reference a "gui library" into a core-data library).
The fact that javafx will be included in stardard releases alleviate this prolbem, but it seems a tricky solution. Afterall I think I squint a web application that depends on some swing "utility" class.
Are there any options available?
I'm evaluating the effort required to create regular javabeans properties with listeneres and bridge them to fx properties.
Binding of JavaFX object to POJO (Plain Old Java Object) techinque may help you here.
See next set of tutorials: http://ugate.wordpress.com/2012/06/06/javafx-pojo-bindings/
In two words you can use next way to access POJO objects:
Person person = new Person();
PathProperty prop = new PathProperty(
person, "address.streetName", String.class);
Bindings.bindBidirectional(prop, myTextField.textProperty());
prop.set("123 1st Street");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With