Module is.codion.swing.common.model
Interface SwingFilterComboBoxModel.Builder<T>
- Type Parameters:
T- the item type
- Enclosing interface:
SwingFilterComboBoxModel<T>
public static interface SwingFilterComboBoxModel.Builder<T>
Builds a Swing
SwingFilterComboBoxModel — the same options as the common
FilterComboBoxModel.Builder (the refresher is managed
internally as a ProgressWorker based one), but the chain stays Swing-typed so build()
yields a ComboBoxModel.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides a SwingSwingFilterComboBoxModel.Builder -
Method Summary
Modifier and TypeMethodDescriptionbuild()comparator(@Nullable Comparator<T> comparator) filterSelected(boolean filterSelected) includeNull(boolean includeNull) onItemSelected(Consumer<@Nullable T> item) onRefreshException(Consumer<Exception> onRefreshException) refresh(boolean refresh) translator(Function<Object, T> translator)
-
Method Details
-
comparator
- Parameters:
comparator- the comparator, null for unsorted- Returns:
- this builder
-
includeNull
- Parameters:
includeNull- true if a null item should be included- Returns:
- this builder
-
nullItem
- Parameters:
nullItem- the item representing null- Returns:
- this builder
-
select
- Parameters:
item- the item to select initially- Returns:
- this builder
-
translator
- Parameters:
translator- the selected item translator- Returns:
- this builder
-
filterSelected
- Parameters:
filterSelected- true if the selected item should be filtered- Returns:
- this builder
-
onItemSelected
- Parameters:
item- receives the selected item, possibly null- Returns:
- this builder
-
onRefreshException
- Parameters:
onRefreshException- the refresh exception handler- Returns:
- this builder
-
refresh
- Parameters:
refresh- true if the model items should be refreshed on initialization- Returns:
- this builder
-
build
SwingFilterComboBoxModel<T> build()- Returns:
- a new
SwingFilterComboBoxModelinstance
-