Class BulkEditorBuilder<E>

java.lang.Object
io.jmix.bulkeditor.view.builder.BulkEditorBuilder<E>
Type Parameters:
E - item type

public class BulkEditorBuilder<E> extends Object
A builder that creates a new BulkEditView with defined parameters.
  • Field Details

  • Constructor Details

  • Method Details

    • withListDataComponent

      public BulkEditorBuilder<E> withListDataComponent(ListDataComponent<E> listDataComponent)
      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

      public BulkEditorBuilder<E> withExclude(String exclude)
      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

      public BulkEditorBuilder<E> withIncludeProperties(List<String> includeProperties)
      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

      public BulkEditorBuilder<E> withFieldValidators(Map<String,Validator<?>> fieldValidators)
      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

      public BulkEditorBuilder<E> withModelValidators(List<Validator<E>> modelValidators)
      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

      public BulkEditorBuilder<E> withUseConfirmDialog(boolean useConfirmDialog)
      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

      public MetaClass getMetaClass()
      Returns:
      a MetaClass of items
    • getEntities

      public Collection<E> getEntities()
      Returns:
      a collection of items to be edited
    • getListDataComponent

      @Nullable public ListDataComponent<E> getListDataComponent()
      Returns:
      the list data component that displays the items to be edited
    • getExclude

      @Nullable public String getExclude()
      Returns:
      a regular expression to exclude some fields explicitly from the list of attributes available for editing
    • getIncludeProperties

      @Nullable public List<String> getIncludeProperties()
      Returns:
      the entity attributes to be included to bulk editor view
    • getFieldValidators

      @Nullable public Map<String,Validator<?>> getFieldValidators()
      Returns:
      a map with validators for fields that will be used for editing certain properties
    • getModelValidators

      @Nullable public List<Validator<E>> 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

      @Nullable public Function<List<MetaProperty>,Map<MetaProperty,Integer>> getFieldSorter()
      Returns:
      field sorter function
    • getOrigin

      public View<?> getOrigin()
      Returns:
      origin view
    • build

      public DialogWindow<BulkEditView<E>> build()
      Builds an instance of DialogWindow for BulkEditView
      Returns:
      a new instance of DialogWindow for BulkEditView
    • open

      public DialogWindow<BulkEditView<E>> open()
      Builds and opens an instance of DialogWindow for BulkEditView
      Returns:
      a new instance of DialogWindow for BulkEditView