Package io.jmix.flowui.view.builder
Class LookupWindowClassBuilder<E,V extends View<?> & LookupView<E>>
java.lang.Object
io.jmix.flowui.view.builder.AbstractWindowBuilder<V>
io.jmix.flowui.view.builder.LookupWindowBuilder<E,V>
io.jmix.flowui.view.builder.LookupWindowClassBuilder<E,V>
- Type Parameters:
V- a view type which is opened in a dialog windowE- entity type
- All Implemented Interfaces:
DialogWindowBuilder<V>,DialogWindowClassBuilder<V>
public class LookupWindowClassBuilder<E,V extends View<?> & LookupView<E>>
extends LookupWindowBuilder<E,V>
implements DialogWindowClassBuilder<V>
Provides a fluent interface to configure and open a lookup view with
the specific class in a
DialogWindow.-
Field Summary
FieldsFields inherited from class io.jmix.flowui.view.builder.LookupWindowBuilder
container, entityClass, field, fieldCollectionValue, listDataComponent, selectHandler, selectValidator, transformationFields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, handler, origin, viewId -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLookupWindowClassBuilder(LookupWindowBuilder<E, V> builder, Class<V> viewClass) LookupWindowClassBuilder(View<?> origin, Class<E> entityClass, Class<V> viewClass, Function<? extends LookupWindowClassBuilder<E, V>, DialogWindow<V>> handler) -
Method Summary
Modifier and TypeMethodDescriptionwithAfterCloseListener(Consumer<DialogWindow.AfterCloseEvent<V>> listener) AddsDialogWindow.AfterCloseEventlistener to the dialog window.withAfterOpenListener(Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEventlistener to the dialog window.withContainer(CollectionContainer<E> container) SetsCollectionContainerto updated after the lookup view is closed.<T extends com.vaadin.flow.component.HasValue<?,E>>
LookupWindowClassBuilder<E,V> withField(T field) Sets the field in which the framework sets the selected entity after successful lookup.withListDataComponent(ListDataComponent<E> listDataComponent) Sets list data component that is used to get thecontainerif it is not set explicitly byLookupWindowBuilder.withContainer(CollectionContainer)method.<T extends com.vaadin.flow.component.HasValue<?,Collection<E>>>
LookupWindowClassBuilder<E,V> withMultiValueField(T field) Sets the field in which the framework sets the selected entities after successful lookup.withSelectHandler(Consumer<Collection<E>> selectHandler) Sets selection handler for the lookup view.withSelectValidator(Predicate<LookupView.ValidationContext<E>> selectValidator) Sets selection validator for the lookup view.withTransformation(Function<Collection<E>, Collection<E>> transformation) Sets code to transform the entities after selection.withViewId(String viewId) Sets identifier of the opened view as specified in theViewControllerannotation.Methods inherited from class io.jmix.flowui.view.builder.LookupWindowBuilder
getContainer, getEntityClass, getField, getListDataComponent, getSelectHandler, getSelectValidator, getTransformation, isFieldCollectionValue, withViewClassMethods inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
build, getAfterCloseListener, getAfterOpenListener, getOrigin, getViewId, openMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.view.builder.DialogWindowBuilder
getAfterCloseListener, getAfterOpenListener, getOrigin, getViewId
-
Field Details
-
viewClass
-
-
Constructor Details
-
LookupWindowClassBuilder
-
LookupWindowClassBuilder
-
-
Method Details
-
withViewId
Description copied from class:LookupWindowBuilderSets identifier of the opened view as specified in theViewControllerannotation.- Overrides:
withViewIdin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
viewId- identifier of the opened view as specified in theViewControllerannotation- Returns:
- this instance for chaining
-
withSelectHandler
Description copied from class:LookupWindowBuilderSets selection handler for the lookup view.- Overrides:
withSelectHandlerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
selectHandler- handler to set- Returns:
- this instance for chaining
-
withSelectValidator
public LookupWindowClassBuilder<E,V> withSelectValidator(Predicate<LookupView.ValidationContext<E>> selectValidator) Description copied from class:LookupWindowBuilderSets selection validator for the lookup view.- Overrides:
withSelectValidatorin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
selectValidator- validator to set- Returns:
- this instance for chaining
-
withTransformation
public LookupWindowClassBuilder<E,V> withTransformation(@Nullable Function<Collection<E>, Collection<E>> transformation) Description copied from class:LookupWindowBuilderSets code to transform the entities after selection.Applied only if either field or container or listDataComponent is assigned.
- Overrides:
withTransformationin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
transformation- edited entity transformation object- Returns:
- this instance for chaining
- See Also:
-
withContainer
Description copied from class:LookupWindowBuilderSetsCollectionContainerto updated after the lookup view is closed.If the container is
Nested, the framework automatically initializes the reference to the parent entity and sets up data contexts for added One-To-Many and Many-To-Many relations.- Overrides:
withContainerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
container- the container to update after the lookup view is closed- Returns:
- this instance for chaining
-
withListDataComponent
public LookupWindowClassBuilder<E,V> withListDataComponent(@Nullable ListDataComponent<E> listDataComponent) Description copied from class:LookupWindowBuilderSets list data component that is used to get thecontainerif it is not set explicitly byLookupWindowBuilder.withContainer(CollectionContainer)method.Usually, the list component is a
DataGriddisplaying the list of entities.- Overrides:
withListDataComponentin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
listDataComponent- the component to set- Returns:
- this instance for chaining
-
withField
public <T extends com.vaadin.flow.component.HasValue<?,E>> LookupWindowClassBuilder<E,V> withField(@Nullable T field) Description copied from class:LookupWindowBuilderSets the field in which the framework sets the selected entity after successful lookup.- Overrides:
withFieldin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
field- the field to set- Returns:
- this instance for chaining
-
withMultiValueField
public <T extends com.vaadin.flow.component.HasValue<?,Collection<E>>> LookupWindowClassBuilder<E,V> withMultiValueField(@Nullable T field) Description copied from class:LookupWindowBuilderSets the field in which the framework sets the selected entities after successful lookup.- Overrides:
withMultiValueFieldin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
field- the field to set- Returns:
- this instance for chaining
-
withAfterOpenListener
public LookupWindowClassBuilder<E,V> withAfterOpenListener(@Nullable Consumer<DialogWindow.AfterOpenEvent<V>> listener) Description copied from class:AbstractWindowBuilderAddsDialogWindow.AfterOpenEventlistener to the dialog window.- Overrides:
withAfterOpenListenerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withAfterCloseListener
public LookupWindowClassBuilder<E,V> withAfterCloseListener(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> listener) Description copied from class:AbstractWindowBuilderAddsDialogWindow.AfterCloseEventlistener to the dialog window.- Overrides:
withAfterCloseListenerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
getViewClass
- Specified by:
getViewClassin interfaceDialogWindowClassBuilder<E>- Returns:
- opened view class
-