java - How to convert ObjectProperty<String> to StringProperty in JavaFX? -
there method convert objectproperty<integer>
integerproperty
. here is:
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
Post a Comment