[REVIEW REQUEST] Add text property to ComboBox
jonathan.giles at oracle.com
Thu Mar 15 12:41:12 PDT 2012
>>> But that aside, you really are assuming having the editor to be a text
>>> component of some sort. For entering color I may, for example have a
>>> container with three text fields (RGB). Can I not do so?
>> I put forward that text will very often be a common input method, so
>> support for it should be added at a low level. But you do have a good
>> point; multiple text fields...
> Or sliders (RGB for a color, again). Or ... anything.
> Why not?
> Since ComboBox has a type parameter, I would expect to be able to
> provide whatever editor suits better to the encapsulated type.
> As a consequence, an edited value - a value in the editor - may not be
> representable by String. Hence, again, <code>T editedValue;</code>.
> That was my point, yes.
This is the same as my previous email - the ComboBox<T> type parameter
does not necessarily reflect the input method, just the data type of the
value property. Input can be String based, and converted to T via a
For custom editors, this again should not be done via ComboBox, but
rather ComboBoxBase. As I've mentioned previously, ComboBox is a
specialisation of the ComboBoxBase class to provide the most commonly
used functionality, that is a TextField for input, and a ListView for
showing the available options.
More information about the openjfx-dev