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:
E- entity typeV- a view type which is opened in a dialog window
- 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, lookupComponentMultiSelect, selectHandler, selectValidator, transformationFields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, draggedListener, handler, origin, resizeListener, viewConfigurer, 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(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> listener) AddsDialogWindow.AfterCloseEventlistener to the dialog window.withAfterOpenListener(@Nullable Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEventlistener to the dialog window.withContainer(@Nullable CollectionContainer<E> container) SetsCollectionContainerto updated after the lookup view is closed.withDraggedListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener) AddsDialog.DialogDraggedEventlistener to the dialog window.<T extends com.vaadin.flow.component.HasValue<?,E>>
LookupWindowClassBuilder<E, V> withField(@Nullable T field) Sets the field in which the framework sets the selected entity after successful lookup.withListDataComponent(@Nullable ListDataComponent<E> listDataComponent) Sets list data component that is used to get thecontainerif it is not set explicitly byLookupWindowBuilder.withContainer(CollectionContainer)method.withLookupComponentMultiSelect(@Nullable Boolean lookupComponentMultiSelect) Sets multi selection mode for the lookup component in the lookup view.<T extends com.vaadin.flow.component.HasValue<?,Collection<E>>>
LookupWindowClassBuilder<E, V> withMultiValueField(@Nullable T field) Sets the field in which the framework sets the selected entities after successful lookup.withResizeListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener) AddsDialog.DialogResizeEventlistener to the dialog window.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(@Nullable Function<Collection<E>, Collection<E>> transformation) Sets code to transform the entities after selection.withViewConfigurer(@Nullable Consumer<V> configurer) Adds configurer to the dialog window.withViewId(@Nullable 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, getLookupComponentMultiSelect, getSelectHandler, getSelectValidator, getTransformation, isFieldCollectionValue, withViewClassMethods inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
build, getAfterCloseListener, getAfterOpenListener, getDraggedListener, getOrigin, getResizeListener, getViewConfigurer, 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, getDraggedListener, getOrigin, getResizeListener, getViewConfigurer, 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
-
withLookupComponentMultiSelect
public LookupWindowClassBuilder<E,V> withLookupComponentMultiSelect(@Nullable Boolean lookupComponentMultiSelect) Description copied from class:LookupWindowBuilderSets multi selection mode for the lookup component in the lookup view.- Overrides:
withLookupComponentMultiSelectin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
lookupComponentMultiSelect- whether to use multi selection for the lookup component ornullto use the default selection mode- 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
-
withDraggedListener
public LookupWindowClassBuilder<E,V> withDraggedListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener) Description copied from class:AbstractWindowBuilderAddsDialog.DialogDraggedEventlistener to the dialog window.- Overrides:
withDraggedListenerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withResizeListener
public LookupWindowClassBuilder<E,V> withResizeListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener) Description copied from class:AbstractWindowBuilderAddsDialog.DialogResizeEventlistener to the dialog window.- Overrides:
withResizeListenerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withViewConfigurer
Description copied from class:AbstractWindowBuilderAdds configurer to the dialog window.- Overrides:
withViewConfigurerin classLookupWindowBuilder<E,V extends View<?> & LookupView<E>> - Parameters:
configurer- the configurer to add- Returns:
- the instance for chaining
-
getViewClass
- Specified by:
getViewClassin interfaceDialogWindowClassBuilder<E>- Returns:
- opened view class
-