Interface EntityComboBoxModel.Builder
- Enclosing interface:
- EntityComboBoxModel
public static interface EntityComboBoxModel.Builder
Builds a
EntityComboBoxModel
.-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Collection<Attribute<?>> attributes) Specifies the attributes to include when selecting the entities to populate this model with.build()
comparator
(Comparator<Entity> comparator) Note that this comparator is not used iforderBy(OrderBy)
has been specified.filterSelected
(boolean filterSelected) Specifies whether filtering the model affects the currently selected item.handleEditEvents
(boolean handleEditEvents) includeNull
(boolean includeNull) nullCaption
(String nullCaption) Enables the null item and sets the null item caption.Specifies theOrderBy
to use when selecting entities for this model.
-
Method Details
-
orderBy
Specifies theOrderBy
to use when selecting entities for this model. in the combo box model.- Parameters:
orderBy
- theOrderBy
to use when selecting- Returns:
- this builder instance
-
comparator
Note that this comparator is not used iforderBy(OrderBy)
has been specified.- Parameters:
comparator
- the comparator to use, null for unsorted- Returns:
- this builder instance
-
condition
- Parameters:
condition
- the condition supplier to use when querying data- Returns:
- this builder instance
-
attributes
Specifies the attributes to include when selecting the entities to populate this model with. Note that the primary key attribute values are always included. An empty Collection indicates that all attributes should be selected.- Parameters:
attributes
- the attributes to select, an empty Collection for all- Returns:
- this builder instance
-
includeNull
- Parameters:
includeNull
- if true then the null item is enabled using the default null item caption (FilterComboBoxModel.NULL_CAPTION
)- Returns:
- this builder instance
- See Also:
-
nullCaption
Enables the null item and sets the null item caption.- Parameters:
nullCaption
- the null item caption- Returns:
- this builder instance
-
handleEditEvents
- Parameters:
handleEditEvents
- controls whether this combo box model should handle entity edit events, by adding inserted items, updating any updated items and removing deleted ones- Returns:
- this builder instance
- See Also:
-
filterSelected
Specifies whether filtering the model affects the currently selected item. If true, the selection is cleared when the selected item is filtered from the model, otherwise the selected item can potentially represent a value which is not currently visible in the model This is false by default.- Parameters:
filterSelected
- if true then the selected item is cleared when filtered- Returns:
- this builder instance
- See Also:
-
build
EntityComboBoxModel build()- Returns:
- a new
EntityComboBoxModel
instance
-