[REVIEW] Restricting the ComboBox selection model to single selection
Richard Bair
richard.bair at oracle.com
Mon Feb 6 06:50:22 PST 2012
Sounds like a universal +1.
Shura can you chime in?
On Feb 3, 2012, at 4:18 PM, Jonathan Giles <jonathan.giles at oracle.com> wrote:
> Hi all,
>
> http://javafx-jira.kenai.com/browse/RT-19367
>
> I'm asking for approval to change the API of the ComboBox selectionModel property, from the more general SelectionModel class, to the more specific SingleSelectionModel class. This enforces the fact that the ComboBox, for now and evermore, will only support single selection (much like the ChoiceBox control). Should multiple selection ever be needed, a separate 'ListBox' control can be developed to more aptly serve these needs.
>
> The desire to make this change is, however, more due to the fact that the current API does no one any favours. It misleads developers to think that by installing a MultipleSelectionModel into the property, they may be afforded some multiple selection functionality, which is not true. This change makes it impossible for them to think this, as compilation will fail in this case. I would argue that this is a bug in the API, and one that should be fixed prior to being set in stone. Not fixing this bug prior to shipping the ComboBox control will lead to confusion and / or bug reports from developers expecting functionality.
>
> The proposed patch is attached to the Jira issue. The changes are minimal and, I would argue, as risk free as one can hope. It has no impact on unit tests as there were no multiple selection tests written, and I hope the same can be said for the automated tests.
>
> Thanks,
> Jonathan
More information about the openjfx-dev
mailing list