Package io.jmix.bulkeditor.view.builder
Class BulkEditorBuilder<E>
java.lang.Object
io.jmix.bulkeditor.view.builder.BulkEditorBuilder<E>
- Type Parameters:
E- item type
A builder that creates a new
BulkEditView with defined parameters.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<E>protected Stringprotected Function<List<MetaProperty>,Map<MetaProperty, Integer>> protected final Function<BulkEditorBuilder<E>,DialogWindow<BulkEditView<E>>> protected ListDataComponent<E>protected final MetaClassprotected View<?>protected boolean -
Constructor Summary
ConstructorsConstructorDescriptionBulkEditorBuilder(BulkEditorBuilder<E> builder) BulkEditorBuilder(MetaClass metaClass, Collection<E> entities, View<?> origin, Function<BulkEditorBuilder<E>, DialogWindow<BulkEditView<E>>> handler) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance of DialogWindow forBulkEditViewView<?>booleanopen()Builds and opens an instance of DialogWindow forBulkEditViewwithExclude(String exclude) Sets a regular expression to exclude some fields explicitly from the list of attributes available for editing.withFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) Sets field sorter function that allows you to sort fields by custom logic.withFieldValidators(Map<String, Validator<?>> fieldValidators) Sets a map with validators for fields that will be used for editing certain properties.withIncludeProperties(List<String> includeProperties) Sets the entity attributes to be included to bulk editor view.withListDataComponent(ListDataComponent<E> listDataComponent) Sets the list data component that displays the items to be edited.withModelValidators(List<Validator<E>> modelValidators) Sets a map with validators for the result of bulk editing.withUseConfirmDialog(boolean useConfirmDialog) Sets whether the confirmation dialog should be displayed to the user before saving the changes.
-
Field Details
-
metaClass
-
entities
-
handler
-
listDataComponent
-
exclude
-
includeProperties
-
fieldValidators
-
modelValidators
-
useConfirmDialog
protected boolean useConfirmDialog -
fieldSorter
-
origin
-
-
Constructor Details
-
BulkEditorBuilder
-
BulkEditorBuilder
public BulkEditorBuilder(MetaClass metaClass, Collection<E> entities, View<?> origin, Function<BulkEditorBuilder<E>, DialogWindow<BulkEditView<E>>> handler)
-
-
Method Details
-
withListDataComponent
Sets the list data component that displays the items to be edited.- Parameters:
listDataComponent- the list data component to be used- Returns:
- this builder
-
withExclude
Sets a regular expression to exclude some fields explicitly from the list of attributes available for editing.- Parameters:
exclude- a regular expression- Returns:
- this builder
-
withIncludeProperties
Sets the entity attributes to be included to bulk editor view. If set, other attributes will be ignored.- Parameters:
includeProperties- the entity attributes to be included to bulk editor view- Returns:
- this builder
-
withFieldValidators
Sets a map with validators for fields that will be used for editing certain properties.- Parameters:
fieldValidators- a map with validators for fields that will be used for editing certain properties- Returns:
- this builder
-
withModelValidators
Sets a map with validators for the result of bulk editing.- Parameters:
modelValidators- a map with validators for the result of bulk editing- Returns:
- this builder
-
withUseConfirmDialog
Sets whether the confirmation dialog should be displayed to the user before saving the changes. The default value is true.- Parameters:
useConfirmDialog- whether the confirmation dialog should be displayed- Returns:
- this builder
-
withFieldSorter
public BulkEditorBuilder<E> withFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) Sets field sorter function that allows you to sort fields by custom logic.- Parameters:
fieldSorter- field sorter function- Returns:
- this builder
-
getMetaClass
- Returns:
- a
MetaClassof items
-
getEntities
- Returns:
- a collection of items to be edited
-
getListDataComponent
- Returns:
- the list data component that displays the items to be edited
-
getExclude
- Returns:
- a regular expression to exclude some fields explicitly from the list of attributes available for editing
-
getIncludeProperties
- Returns:
- the entity attributes to be included to bulk editor view
-
getFieldValidators
- Returns:
- a map with validators for fields that will be used for editing certain properties
-
getModelValidators
- Returns:
- a list with validators for the result of bulk editing
-
isUseConfirmDialog
public boolean isUseConfirmDialog()- Returns:
- whether the confirmation dialog should be displayed to the user before saving the changes
-
getFieldSorter
- Returns:
- field sorter function
-
getOrigin
- Returns:
- origin view
-
build
Builds an instance of DialogWindow forBulkEditView- Returns:
- a new instance of DialogWindow for
BulkEditView
-
open
Builds and opens an instance of DialogWindow forBulkEditView- Returns:
- a new instance of DialogWindow for
BulkEditView
-