Package io.jmix.flowui.view.builder
Class LookupWindowBuilderProcessor
java.lang.Object
io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor
io.jmix.flowui.view.builder.LookupWindowBuilderProcessor
- Direct Known Subclasses:
TabbedModeLookupWindowBuilderProcessor
@Component("flowui_LookupWindowBuilderProcessor")
public class LookupWindowBuilderProcessor
extends AbstractWindowBuilderProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataManagerprotected EntityStatesprotected ExtendedEntitiesprotected FetchPlansprotected Metadataprotected MetadataToolsprotected UiViewPropertiesFields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor
applicationContext, uiAccessChecker, viewRegistry, views -
Constructor Summary
ConstructorsConstructorDescriptionLookupWindowBuilderProcessor(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> ObjectfromCollection(Collection<E> value, boolean isCollectionValue) protected <E> FetchPlangetFetchPlanForCollectionContainer(CollectionContainer<E> collectionDc, boolean initializeMasterReference, MetaProperty inverseMetaProperty) SeegetFetchPlanForField(HasValue)javadoc.protected FetchPlangetFetchPlanForField(com.vaadin.flow.component.HasValue<?, ?> field) The method evaluates the fetch plan that is used for the entity in the givenfieldprotected <E> voidhandleSelectionWithContainer(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> voidupdateFieldOptions(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:
inferViewClassin 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 givenfieldIf 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
nullif 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
-