Bidirectional binding with conversion

Richard Bair richard.bair at oracle.com
Fri Dec 9 08:16:27 PST 2011


>> Hi Michael,
>> 
>> What about adding:
>> 
>> public void bindBidirectional(Property<?> other, StringConverter)
>> 
>> as well? The StringConverter is in javafx.util and seems like another well suited means for conversion to/from String.
>> 
> 
> Yeah, makes sense. I did not know this class exists.
> 
>> One other question not directly related -- why do our bindBidirectional methods take a Property instead of a WritableValue?
>> 
> 
> Because a WritableValue is not observable. I think at some point we had something like
> public static <E, T extends WritableValue<E> & ObservableValue<E>> void bindBidirectional(T obj1, T obj2)
> but then we dropped it and used properties instead to make the signature more readable. So far properties are the only implementation of both interfaces.

Ah, that is what Dan was saying in another thread (WritableValue is not an ObservableValue), but I have forgotten that.

Thanks
Richard


More information about the openjfx-dev mailing list