Class LookupBuilderProcessor

java.lang.Object
io.jmix.ui.builder.LookupBuilderProcessor

@Component("ui_LookupBuilderProcessor") public class LookupBuilderProcessor extends Object
  • Field Details

    • windowConfig

      @Autowired protected WindowConfig windowConfig
    • screenProperties

      @Autowired protected UiScreenProperties screenProperties
    • extendedEntities

      @Autowired protected ExtendedEntities extendedEntities
    • metadata

      @Autowired protected Metadata metadata
    • entityStates

      @Autowired protected EntityStates entityStates
    • dataManager

      @Autowired protected DataManager dataManager
    • metadataTools

      @Autowired protected MetadataTools metadataTools
    • fetchPlans

      @Autowired protected FetchPlans fetchPlans
  • Constructor Details

    • LookupBuilderProcessor

      public LookupBuilderProcessor()
  • Method Details

    • buildLookup

      public <E, S extends Screen> S buildLookup(LookupBuilder<E> builder)
    • createScreen

      protected <E> Screen createScreen(LookupBuilder<E> builder, Screens screens)
    • handleSelectionWithField

      protected <E> void handleSelectionWithField(LookupBuilder<E> builder, HasValue field, Collection<E> itemsFromLookup, boolean isCollectionValue)
    • toCollection

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

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

      protected <E> void handleSelectionWithContainer(LookupBuilder<E> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup)
    • transform

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

      @Nullable protected FetchPlan getFetchPlanForField(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 screen then there may be cases when in entities in lookup screen some attributes required in the editor 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)
    • updateFieldOptions

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