Class MultiSelectField.Builder<T extends MultiSelectField>
- java.lang.Object
-
- io.github.jonestimd.swing.component.MultiSelectField.Builder<T>
-
- Enclosing class:
- MultiSelectField
public static class MultiSelectField.Builder<T extends MultiSelectField> extends java.lang.Object
Helper class for building aMultiSelectField
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(boolean showDelete, boolean opaqueItems, MultiSelectField.Constructor<T> constructor)
protected
Builder(MultiSelectField.Builder<?> source, MultiSelectField.Constructor<T> constructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiSelectField.Builder<T>
disableTab()
Disabletab
as text input and enable focus traversal usingtab
andshift tab
.T
get()
MultiSelectField.Builder<T>
items(java.util.Collection<java.lang.String> items)
Initialize the list of values in the field.MultiSelectField.Builder<T>
pendingItemValidator(java.util.function.BiPredicate<MultiSelectField,java.lang.String> isValidItem)
Set the pending item validator.MultiSelectField.Builder<T>
setKeepTextOnFocusLost(boolean keepTextOnFocusLost)
MultiSelectField.Builder<T>
setYieldFocusOnError(boolean yieldFocusOnError)
MultiSelectField.Builder<ValidatedMultiSelectField>
validator(Validator<java.util.List<java.lang.String>> validator)
Set the item list validator.
-
-
-
Constructor Detail
-
Builder
protected Builder(boolean showDelete, boolean opaqueItems, MultiSelectField.Constructor<T> constructor)
- See Also:
MultiSelectField(boolean, boolean)
-
Builder
protected Builder(MultiSelectField.Builder<?> source, MultiSelectField.Constructor<T> constructor)
-
-
Method Detail
-
pendingItemValidator
public MultiSelectField.Builder<T> pendingItemValidator(java.util.function.BiPredicate<MultiSelectField,java.lang.String> isValidItem)
Set the pending item validator.
-
items
public MultiSelectField.Builder<T> items(java.util.Collection<java.lang.String> items)
Initialize the list of values in the field.
-
validator
public MultiSelectField.Builder<ValidatedMultiSelectField> validator(Validator<java.util.List<java.lang.String>> validator)
Set the item list validator. Creates aValidatedMultiSelectField
.
-
disableTab
public MultiSelectField.Builder<T> disableTab()
Disabletab
as text input and enable focus traversal usingtab
andshift tab
.
-
setYieldFocusOnError
public MultiSelectField.Builder<T> setYieldFocusOnError(boolean yieldFocusOnError)
-
setKeepTextOnFocusLost
public MultiSelectField.Builder<T> setKeepTextOnFocusLost(boolean keepTextOnFocusLost)
-
get
public T get()
- Returns:
- a
MultiSelectField
orValidatedMultiSelectField
-
-