PrefixSelectionComboBox

23 views
Skip to first unread message

Knut Arne Vedaa

unread,
Mar 15, 2021, 9:05:11 AM3/15/21
to control...@googlegroups.com
Hi!

I just discovered the PrefixSelectionComboBox class. It seems pretty
useful, implementing functionality that should have been on ComboBox in
the first place.

However, I can't quite figure out how it's supposed to work. It seems
that it will match on the .toString representation of the type T, and
not the actual text displayed in the combobox (which may not be the
same). Is this correct?


Best regards,

Knut Arne Vedaa

Mark Schmieder

unread,
Apr 1, 2023, 3:09:31 AM4/1/23
to ControlsFX
I suppose that is partially correct, as far as default behavior, in that all Objects in Java have a toString() that is either defaulted or overridden, but you can also override the BiFunction in PrefixSelectionComboBox, so there is sufficient flexibility as far as I can tell, such that you could probably use that method to insert any special mappings used in your custom ComboBox for stored vs. displayed values.

I tried this control a couple of years ago and didn't like it -- nor do I like the behavior it's based off of, in other apps and in OS-assertive impositions on browsers and desktop apps. You may be able to tame it to your ends, but I recommend looking also at SearchableComboBox to see if it better fits your needs and if you are more comfortable modifying it to better meet your filtration and mapping criteria.

Reply all
Reply to author
Forward
0 new messages