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
Fields inherited from class io.jmix.flowui.view.builder.LookupWindowBuilder
container, entityClass, field, fieldCollectionValue, listDataComponent, selectHandler, selectValidator, transformation
Fields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, handler, origin, viewId
-
Constructor Summary
ModifierConstructorDescriptionprotected
LookupWindowClassBuilder
(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.AfterCloseEvent
listener to the dialog window.withAfterOpenListener
(Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEvent
listener to the dialog window.withContainer
(CollectionContainer<E> container) SetsCollectionContainer
to 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 thecontainer
if 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 theViewController
annotation.Methods inherited from class io.jmix.flowui.view.builder.LookupWindowBuilder
getContainer, getEntityClass, getField, getListDataComponent, getSelectHandler, getSelectValidator, getTransformation, isFieldCollectionValue, withViewClass
Methods inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
build, getAfterCloseListener, getAfterOpenListener, getOrigin, getViewId, open
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:LookupWindowBuilder
Sets identifier of the opened view as specified in theViewController
annotation.- Overrides:
withViewId
in classLookupWindowBuilder<E,
V extends View<?> & LookupView<E>> - Parameters:
viewId
- identifier of the opened view as specified in theViewController
annotation- Returns:
- this instance for chaining
-
withSelectHandler
Description copied from class:LookupWindowBuilder
Sets selection handler for the lookup view.- Overrides:
withSelectHandler
in 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:LookupWindowBuilder
Sets selection validator for the lookup view.- Overrides:
withSelectValidator
in 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:LookupWindowBuilder
Sets code to transform the entities after selection.Applied only if either field or container or listDataComponent is assigned.
- Overrides:
withTransformation
in 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:LookupWindowBuilder
SetsCollectionContainer
to 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:
withContainer
in 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:LookupWindowBuilder
Sets list data component that is used to get thecontainer
if it is not set explicitly byLookupWindowBuilder.withContainer(CollectionContainer)
method.Usually, the list component is a
DataGrid
displaying the list of entities.- Overrides:
withListDataComponent
in 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:LookupWindowBuilder
Sets the field in which the framework sets the selected entity after successful lookup.- Overrides:
withField
in 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:LookupWindowBuilder
Sets the field in which the framework sets the selected entities after successful lookup.- Overrides:
withMultiValueField
in 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:AbstractWindowBuilder
AddsDialogWindow.AfterOpenEvent
listener to the dialog window.- Overrides:
withAfterOpenListener
in 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:AbstractWindowBuilder
AddsDialogWindow.AfterCloseEvent
listener to the dialog window.- Overrides:
withAfterCloseListener
in classLookupWindowBuilder<E,
V extends View<?> & LookupView<E>> - Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
getViewClass
- Specified by:
getViewClass
in interfaceDialogWindowClassBuilder<E>
- Returns:
- opened view class
-