Two ChoiceBox API additions
jonathan.giles at oracle.com
Thu Jan 12 00:15:00 PST 2012
The reason why it is named 'converter' is for consistency across the
API. The intention is that future controls may also have a converter
that is a StringConverter. Already ComboBox has this API (but of course
uses both toString(..) and fromString(..), which ChoiceBox does not).
I can see your thinking behind the name - it is more specifically what
it is - but at the same time I personally like the improved discovery
(and lessened mental overhead) of using consistent API naming.
What do others think?
On Thursday, 12 January 2012 8:40:41 p.m., Tom Schindl wrote:
> Am 12.01.12 00:59, schrieb Paru Somashekar:
>> The controls team is planning to add 2 new APIs to ChoiceBox control.
>> They are :-
>> 1. valueProperty : (getValue(), setValue() and valueProperty())
>> The value of a ChoiceBox is defined as the selected item in the
>> ChoiceBox selection model. The valueProperty is synchronized with the
>> selectedItem, in that when a user sets the value property the selected
>> item/index is updated accordingly. And when selection changes, the value
>> property also reflects the change. This property allows for
>> bi-directional binding of external properties to the ChoiceBox and
>> updates the selection model accordingly.
>> 2. converterProperty : (getConverter(), setConverter(),
> Wouldn't it better named labelConverterProperty?
More information about the openjfx-dev