Package io.jmix.flowui.view.builder
Class LookupWindowBuilderProcessor
java.lang.Object
io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor
io.jmix.flowui.view.builder.LookupWindowBuilderProcessor
@Component("flowui_LookupWindowBuilderProcessor")
public class LookupWindowBuilderProcessor
extends AbstractWindowBuilderProcessor
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataManager
protected EntityStates
protected ExtendedEntities
protected FetchPlans
protected Metadata
protected MetadataTools
protected UiViewProperties
Fields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor
applicationContext, uiAccessChecker, viewRegistry, views
-
Constructor Summary
ConstructorDescriptionLookupWindowBuilderProcessor
(org.springframework.context.ApplicationContext applicationContext, Views views, ViewRegistry viewRegistry, Metadata metadata, MetadataTools metadataTools, DataManager dataManager, FetchPlans fetchPlans, EntityStates entityStates, ExtendedEntities extendedEntities, UiViewProperties viewProperties, UiAccessChecker uiAccessChecker) -
Method Summary
Modifier and TypeMethodDescription<E,
V extends View<?>>
DialogWindow<V>build
(LookupWindowBuilder<E, V> builder) protected <E> CollectionContainer<E>
findContainer
(LookupWindowBuilder<E, ?> builder) protected <E> Object
fromCollection
(Collection<E> value, boolean isCollectionValue) protected <E> FetchPlan
getFetchPlanForCollectionContainer
(CollectionContainer<E> collectionDc, boolean initializeMasterReference, MetaProperty inverseMetaProperty) SeegetFetchPlanForField(HasValue)
javadoc.protected FetchPlan
getFetchPlanForField
(com.vaadin.flow.component.HasValue<?, ?> field) The method evaluates the fetch plan that is used for the entity in the givenfield
protected <E> void
handleSelectionWithContainer
(LookupWindowBuilder<E, ?> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) protected <E,
V extends View<?>>
voidhandleSelectionWithField
(LookupWindowBuilder<E, V> builder, com.vaadin.flow.component.HasValue field, Collection<E> itemsFromLookup) inferViewClass
(DialogWindowBuilder<V> builder) protected <E> Collection<E>
reloadItemsByFetchPlan
(FetchPlan fetchPlan, Collection<E> itemsFromLookup) protected <E> Collection<E>
toCollection
(Object value, boolean isCollectionValue) protected <E> Collection<E>
transform
(LookupWindowBuilder<E, ?> builder, Collection<E> selectedItems) <E> void
updateFieldOptions
(SupportsDataProvider<E> field, Collection<E> items) Updates entities in options if they contain selected item from lookup view.Methods inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor
createDialog, createView, getViewClass, initDialog
-
Field Details
-
metadata
-
metadataTools
-
dataManager
-
fetchPlans
-
entityStates
-
extendedEntities
-
viewProperties
-
-
Constructor Details
-
LookupWindowBuilderProcessor
public LookupWindowBuilderProcessor(org.springframework.context.ApplicationContext applicationContext, Views views, ViewRegistry viewRegistry, Metadata metadata, MetadataTools metadataTools, DataManager dataManager, FetchPlans fetchPlans, EntityStates entityStates, ExtendedEntities extendedEntities, UiViewProperties viewProperties, UiAccessChecker uiAccessChecker)
-
-
Method Details
-
build
-
findContainer
-
inferViewClass
- Specified by:
inferViewClass
in classAbstractWindowBuilderProcessor
-
handleSelectionWithContainer
protected <E> void handleSelectionWithContainer(LookupWindowBuilder<E, ?> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) -
handleSelectionWithField
protected <E,V extends View<?>> void handleSelectionWithField(LookupWindowBuilder<E, V> builder, com.vaadin.flow.component.HasValue field, Collection<E> itemsFromLookup) -
transform
protected <E> Collection<E> transform(LookupWindowBuilder<E, ?> builder, Collection<E> selectedItems) -
getFetchPlanForField
The method evaluates the fetch plan that is used for the entity in the givenfield
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) SeegetFetchPlanForField(HasValue)
javadoc.- 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
-
fromCollection
-
updateFieldOptions
Updates entities in options if they contain selected item from lookup view.- Type Parameters:
E
- entity type- Parameters:
field
- options field to updateitems
- selected entities from lookup view to update options in field
-