java - How to convert ObjectProperty<String> to StringProperty in JavaFX? -


there method convert objectproperty<integer> integerproperty. here is:

https://docs.oracle.com/javase/8/javafx/api/javafx/beans/property/integerproperty.html#integerproperty-javafx.beans.property.property-

why there no analogous method convert objectproperty<string> stringproperty? how convert then?

looking @ source integerproperty, bidirectional binding (and unbinding in finalize).

you copy integerproperty does, , modify use stringproperty:

public static stringproperty makestringproperty(final property<string> property) {     objects.requirenonnull(property, "property cannot null");      return new stringpropertybase() {         {             bindbidirectional(property);         }          @override         public object getbean() {             return null; // virtual property, no bean         }          @override         public string getname() {             return property.getname();         }          @override         protected void finalize() throws throwable {             try {                 unbindbidirectional(property);             } {                 super.finalize();             }         }     }; } 

i've modified bit here not use internal packages.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -