Package io.jmix.ui.builder
Class LookupBuilderProcessor
java.lang.Object
io.jmix.ui.builder.LookupBuilderProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataManagerprotected EntityStatesprotected ExtendedEntitiesprotected FetchPlansprotected Metadataprotected MetadataToolsprotected UiScreenPropertiesprotected WindowConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E,S extends Screen>
SbuildLookup(LookupBuilder<E> builder) protected <E> ScreencreateScreen(LookupBuilder<E> builder, Screens screens) protected <E> ObjectfromCollection(Collection<E> value, boolean isCollectionValue) protected <E> FetchPlangetFetchPlanForCollectionContainer(CollectionContainer<E> collectionDc, boolean initializeMasterReference, MetaProperty inverseMetaProperty) SeegetFetchPlanForField(HasValue)javadoc.protected FetchPlangetFetchPlanForField(HasValue field) The method evaluates the fetch plan that is used for the entity in the givenfieldprotected <E> voidhandleSelectionWithContainer(LookupBuilder<E> builder, CollectionContainer<E> collectionDc, Collection<E> itemsFromLookup) protected <E> voidhandleSelectionWithField(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> voidupdateFieldOptions(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 givenfieldIf 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
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) -
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
-