Package su.onno.ui
Class ListSpec.FilterBuilder
java.lang.Object
su.onno.ui.ListSpec.FilterBuilder
Fluent builder for one filter;
options/multiple()/multiOptions(java.lang.String...)/
contains()/startsWith()/dateRange() pick the control type.-
Method Summary
Modifier and TypeMethodDescriptioncontains()A field-scoped typeahead: a debounced text input matched case-insensitively asfield LIKE %text%.A from/to date-range filter (two date pickers) over the field.Override the control's label (defaults to the field name).multiOptions(String... options) A multi-select filter: pick any number ofoptions, matched asfield IN (…)over the chosen values (an empty selection adds no constraint).multiOptions(Collection<ListSpec.Option> options) A multi-select filter with fully authored choices, including optional per-option avatars.multiOptions(Map<String, String> valueToLabel) A multi-select filter with a value→label split: the query matches the map keys asfield IN (…)while the dropdown renders the map values.multiple()Make the current options control multi-select, matched asfield IN (…)over the checked values.A SELECT filter: pick one ofoptions, matched for equality on the field.options(Collection<ListSpec.Option> options) A SELECT filter with fully authored choices, including optional per-option avatars.A SELECT filter with a value→label split: the query matches each map key on the field while the dropdown renders the map value.single()Make the current options control single-select again (the default foroptions).Likecontains()but anchored at the start: matched asfield LIKE text%.
-
Method Details
-
label
Override the control's label (defaults to the field name). -
options
A SELECT filter: pick one ofoptions, matched for equality on the field. Each option is shown verbatim (its value is also its label); useoptions(Map)when the displayed choice should differ from the matched value. -
options
A SELECT filter with a value→label split: the query matches each map key on the field while the dropdown renders the map value. The choices appear in the map's iteration order, so pass an ordered map (e.g.LinkedHashMap) to control the dropdown order —Map.of(...)is unordered. The answer for a filter over a column whose stored values are codes/English (or an enum text-mirror) in a localized UI. -
options
A SELECT filter with fully authored choices, including optional per-option avatars. -
multiple
Make the current options control multi-select, matched asfield IN (…)over the checked values. Useful when options are declared first and multiplicity is a later choice:list.filter("city").options("Madrid", "Paris").multiple(). -
single
Make the current options control single-select again (the default foroptions). -
multiOptions
A multi-select filter: pick any number ofoptions, matched asfield IN (…)over the chosen values (an empty selection adds no constraint). Each option is shown verbatim; usemultiOptions(Map)for a value→label split. -
multiOptions
A multi-select filter with a value→label split: the query matches the map keys asfield IN (…)while the dropdown renders the map values. The choices appear in the map's iteration order, so pass an ordered map (e.g.LinkedHashMap) to control the dropdown order —Map.of(...)is unordered. -
multiOptions
A multi-select filter with fully authored choices, including optional per-option avatars. -
contains
A field-scoped typeahead: a debounced text input matched case-insensitively asfield LIKE %text%. The high-cardinality answer where a SELECT of every value would be unusable (e.g. filter a roster by a ~1.4k-name doctor column). -
startsWith
Likecontains()but anchored at the start: matched asfield LIKE text%. -
dateRange
A from/to date-range filter (two date pickers) over the field.
-