Two ChoiceBox API additions
Paru Somashekar
parvathi.somashekar at oracle.com
Wed Jan 11 15:59:46 PST 2012
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(), converterProperty())
Allows a way to specify how to represent objects in the items list. When
a StringConverter is set, the object toString method is not called and
instead its toString(object T) is called, passing the objects in the
items list. This is useful when using domain objects in a ChoiceBox as
this property allows for customization of the representation. Developers
can set any of the pre-built Converters available in the
javafx.util.converter package.
thanks,
Paru.
More information about the openjfx-dev
mailing list