Package io.jmix.flowui.screen.builder
Class LookupWindowBuilderProcessor
java.lang.Object
io.jmix.flowui.screen.builder.AbstractWindowBuilderProcessor
io.jmix.flowui.screen.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 FlowUiScreenProperties
Fields inherited from class io.jmix.flowui.screen.builder.AbstractWindowBuilderProcessor
applicationContext, screenRegistry, screens
-
Constructor Summary
ConstructorDescriptionLookupWindowBuilderProcessor
(org.springframework.context.ApplicationContext applicationContext, Screens screens, ScreenRegistry screenRegistry, Metadata metadata, MetadataTools metadataTools, DataManager dataManager, FetchPlans fetchPlans, EntityStates entityStates, ExtendedEntities extendedEntities, FlowUiScreenProperties screenProperties) -
Method Summary
Modifier and TypeMethodDescription<E,
S extends Screen<?>>
DialogWindow<S>buildScreen
(LookupWindowBuilder<E, S> 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,
S extends Screen<?>>
voidhandleSelectionWithField
(LookupWindowBuilder<E, S> builder, com.vaadin.flow.component.HasValue field, Collection<E> itemsFromLookup) inferScreenClass
(DialogWindowBuilder<S> 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 screen.Methods inherited from class io.jmix.flowui.screen.builder.AbstractWindowBuilderProcessor
createDialog, createScreen, getScreenClass, initDialog
-
Field Details
-
metadata
-
metadataTools
-
dataManager
-
fetchPlans
-
entityStates
-
extendedEntities
-
screenProperties
-
-
Constructor Details
-
LookupWindowBuilderProcessor
public LookupWindowBuilderProcessor(org.springframework.context.ApplicationContext applicationContext, Screens screens, ScreenRegistry screenRegistry, Metadata metadata, MetadataTools metadataTools, DataManager dataManager, FetchPlans fetchPlans, EntityStates entityStates, ExtendedEntities extendedEntities, FlowUiScreenProperties screenProperties)
-
-
Method Details
-
buildScreen
-
findContainer
-
inferScreenClass
- Specified by:
inferScreenClass
in classAbstractWindowBuilderProcessor
-
handleSelectionWithContainer
protected <E> void handleSelectionWithContainer(LookupWindowBuilder<E, ?> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) -
handleSelectionWithField
protected <E,S extends Screen<?>> void handleSelectionWithField(LookupWindowBuilder<E, S> 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 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) 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 screen.- Type Parameters:
E
- entity type- Parameters:
field
- options field to updateitems
- selected entities from lookup screen to update options in field
-