Class BeanListComboBox.Builder<T>
- java.lang.Object
-
- io.github.jonestimd.swing.component.BeanListComboBox.Builder<T>
-
- Enclosing class:
- BeanListComboBox<T>
public static class BeanListComboBox.Builder<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder(java.text.Format format, LazyLoadComboBoxModel<T> model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanListComboBox.Builder<T>
editable(Validator<java.lang.String> validator)
Make the combo box editable using the sameformat
as the popup list.BeanListComboBox.Builder<T>
editable(Validator<java.lang.String> validator, PrefixSelector<T> prefixSelector)
Make the combo box editable using the sameformat
as the popup list.BeanListComboBox.Builder<T>
editable(java.text.Format itemFormat, Validator<java.lang.String> validator)
Make the combo box editable.BeanListComboBox.Builder<T>
editable(java.text.Format itemFormat, Validator<java.lang.String> validator, PrefixSelector<T> prefixSelector)
Make the combo box editable.BeanListComboBox<T>
get()
BeanListComboBox.Builder<T>
optional()
Add a null item to the beginning of the list of options.BeanListComboBox.Builder<T>
required(java.lang.String message)
Require that an item must be selected.BeanListComboBox.Builder<T>
validated(Validator<T> validator)
Add validation of the selected item (does not make the combo box editable).
-
-
-
Constructor Detail
-
Builder
public Builder(java.text.Format format, LazyLoadComboBoxModel<T> model)
- Parameters:
format
- display format for the items in the popup listmodel
- the model containing the list of items
-
-
Method Detail
-
optional
public BeanListComboBox.Builder<T> optional()
Add a null item to the beginning of the list of options.
-
required
public BeanListComboBox.Builder<T> required(java.lang.String message)
Require that an item must be selected.- Parameters:
message
- the error message if no item is selected
-
validated
public BeanListComboBox.Builder<T> validated(Validator<T> validator)
Add validation of the selected item (does not make the combo box editable).- Parameters:
validator
- the selected item validator (not the input text validator)
-
editable
public BeanListComboBox.Builder<T> editable(Validator<java.lang.String> validator)
Make the combo box editable using the sameformat
as the popup list.- Parameters:
validator
- validator for input text
-
editable
public BeanListComboBox.Builder<T> editable(Validator<java.lang.String> validator, PrefixSelector<T> prefixSelector)
Make the combo box editable using the sameformat
as the popup list.- Parameters:
validator
- validator for input textprefixSelector
- selector for the best matching item for the editor content
-
editable
public BeanListComboBox.Builder<T> editable(java.text.Format itemFormat, Validator<java.lang.String> validator)
Make the combo box editable.- Parameters:
itemFormat
- the format for converting an item to/from a stringvalidator
- validator for input text
-
editable
public BeanListComboBox.Builder<T> editable(java.text.Format itemFormat, Validator<java.lang.String> validator, PrefixSelector<T> prefixSelector)
Make the combo box editable.- Parameters:
itemFormat
- the format for converting an item to/from a stringvalidator
- validator for input textprefixSelector
- selector for the best matching item for the editor content
-
get
public BeanListComboBox<T> get()
-
-