Class LookupViewBuilderProcessor

java.lang.Object
io.jmix.tabbedmode.builder.AbstractViewBuilderProcessor
io.jmix.tabbedmode.builder.LookupViewBuilderProcessor

@Component("tabmod_LookupViewBuilderProcessor") public class LookupViewBuilderProcessor extends AbstractViewBuilderProcessor
  • Field Details

  • Constructor Details

  • Method Details

    • build

      public <E, V extends View<?>> V build(LookupViewBuilder<E,V> builder)
    • inferViewClass

      protected <V extends View<?>> Class<V> inferViewClass(AbstractViewBuilder<V,?> builder)
      Specified by:
      inferViewClass in class AbstractViewBuilderProcessor
    • findContainer

      @Nullable protected <E> CollectionContainer<E> findContainer(LookupViewBuilder<E,?> builder)
    • handleSelectionWithContainer

      protected <E> void handleSelectionWithContainer(LookupViewBuilder<E,?> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup)
    • handleSelectionWithField

      protected <E> void handleSelectionWithField(LookupViewBuilder<E,?> builder, com.vaadin.flow.component.HasValue field, Collection<E> itemsFromLookup)
    • transform

      protected <E> Collection<E> transform(LookupViewBuilder<E,?> builder, Collection<E> selectedItems)
    • getFetchPlanForField

      @Nullable protected FetchPlan getFetchPlanForField(com.vaadin.flow.component.HasValue<?,?> field)
      The method evaluates the fetch plan that is used for the entity in the given field

      If the value for a component (e.g. EntityPicker) is selected from lookup view then there may be cases when in entities in lookup view some attributes required in the detail are not loaded.

      Returns:
      a view or null if the fetch plan cannot be evaluated
    • getFetchPlanForCollectionContainer

      @Nullable protected <E> FetchPlan getFetchPlanForCollectionContainer(CollectionContainer<E> collectionDc, boolean initializeMasterReference, @Nullable MetaProperty inverseMetaProperty)
      Returns:
      a fetch plan or null if the fetch plan cannot be evaluated
    • reloadItemsByFetchPlan

      protected <E> Collection<E> reloadItemsByFetchPlan(FetchPlan fetchPlan, Collection<E> itemsFromLookup)
    • toCollection

      protected <E> Collection<E> toCollection(Object value, boolean isCollectionValue)
    • fromCollection

      protected <E> Object fromCollection(Collection<E> value, boolean isCollectionValue)
    • updateFieldOptions

      public <E> void updateFieldOptions(SupportsDataProvider<E> field, Collection<E> items)
      Updates entities in options if they contain selected item from lookup view.
      Type Parameters:
      E - entity type
      Parameters:
      field - options field to update
      items - selected entities from lookup view to update options in field