Package io.jmix.ui.builder
Class LookupBuilderProcessor
java.lang.Object
io.jmix.ui.builder.LookupBuilderProcessor
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataManager
protected EntityStates
protected ExtendedEntities
protected FetchPlans
protected Metadata
protected MetadataTools
protected UiScreenProperties
protected WindowConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<E,
S extends Screen>
SbuildLookup
(LookupBuilder<E> builder) protected <E> Screen
createScreen
(LookupBuilder<E> builder, Screens screens) 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
(HasValue field) The method evaluates the fetch plan that is used for the entity in the givenfield
protected <E> void
handleSelectionWithContainer
(LookupBuilder<E> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) protected <E> void
handleSelectionWithField
(LookupBuilder<E> builder, HasValue field, Collection<E> itemsFromLookup, boolean isCollectionValue) protected <E> Collection<E>
reloadItemsByFetchPlan
(FetchPlan fetchPlan, Collection<E> itemsFromLookup) protected <E> Collection<E>
toCollection
(Object value, boolean isCollectionValue) protected <E> Collection<E>
transform
(Collection<E> selectedItems, LookupBuilder<E> builder) <E> void
updateFieldOptions
(OptionsField field, Collection<E> items) Updates entities in options if they contain selected item from lookup screen.
-
Field Details
-
windowConfig
-
screenProperties
-
extendedEntities
-
metadata
-
entityStates
-
dataManager
-
metadataTools
-
fetchPlans
-
-
Constructor Details
-
LookupBuilderProcessor
public LookupBuilderProcessor()
-
-
Method Details
-
buildLookup
-
createScreen
-
handleSelectionWithField
protected <E> void handleSelectionWithField(LookupBuilder<E> builder, HasValue field, Collection<E> itemsFromLookup, boolean isCollectionValue) -
toCollection
-
fromCollection
-
handleSelectionWithContainer
protected <E> void handleSelectionWithContainer(LookupBuilder<E> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) -
transform
-
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) -
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
-