Class DetailWindowClassBuilder<E,V extends View<?> & DetailView<E>>
- Type Parameters:
V
- a view type which is opened in a dialog windowE
- edited entity type
- All Implemented Interfaces:
DialogWindowBuilder<V>
,DialogWindowClassBuilder<V>
DialogWindow
.-
Field Summary
Fields inherited from class io.jmix.flowui.view.builder.DetailWindowBuilder
addFirst, container, editedEntity, entityClass, field, initializer, listDataComponent, mode, newEntity, parentDataContext, transformation
Fields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, handler, origin, viewConfigurer, viewId
-
Constructor Summary
ModifierConstructorDescriptionprotected
DetailWindowClassBuilder
(DetailWindowBuilder<E, V> builder, Class<V> viewClass) DetailWindowClassBuilder
(View<?> origin, Class<E> entityClass, Class<V> viewClass, Function<? extends DetailWindowClassBuilder<E, V>, DialogWindow<V>> handler) -
Method Summary
Modifier and TypeMethodDescriptioneditEntity
(E entity) SetsDetailViewMode
toEDIT
and the builder for chaining.SetsDetailViewMode
toCREATE
and the builder for chaining.SetsDetailViewMode
toCREATE
and the builder for chaining.withAddFirst
(Boolean addFirst) Defines whether a new item will be added to the beginning or to the end of collection.withAfterCloseListener
(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 update after the detail view is saved.Sets the field in which the framework sets the saved entity after successful detail view saving.withInitializer
(Consumer<E> initializer) Sets callback to initialize a new entity instance.withListDataComponent
(ListDataComponent<E> listDataComponent) Sets list data component that is used to get thecontainer
if it is not set explicitly byDetailWindowBuilder.withContainer(CollectionContainer)
method.withParentDataContext
(DataContext parentDataContext) Sets parentDataContext
for the detail view.withTransformation
(Function<E, E> transformation) Sets code to transform the edited entity after detail view saved.withViewConfigurer
(Consumer<V> configurer) Adds configurer to the dialog window.withViewId
(String viewId) Sets identifier of the opened view as specified in theViewController
annotation.Methods inherited from class io.jmix.flowui.view.builder.DetailWindowBuilder
getAddFirst, getContainer, getEditedEntity, getEntityClass, getField, getInitializer, getListDataComponent, getMode, getNewEntity, getParentDataContext, getTransformation, withViewClass
Methods inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
build, getAfterCloseListener, getAfterOpenListener, getOrigin, getViewConfigurer, 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, getViewConfigurer, getViewId
-
Field Details
-
viewClass
-
-
Constructor Details
-
DetailWindowClassBuilder
-
DetailWindowClassBuilder
-
-
Method Details
-
newEntity
Description copied from class:DetailWindowBuilder
SetsDetailViewMode
toCREATE
and the builder for chaining.A new entity instance will be created automatically. It can be initialized by code passed to the
DetailWindowBuilder.withInitializer(Consumer)
method.- Overrides:
newEntity
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Returns:
- this instance for chaining
-
newEntity
Description copied from class:DetailWindowBuilder
SetsDetailViewMode
toCREATE
and the builder for chaining.The new entity instance is accepted as the parameter. It can be initialized by code passed to the
DetailWindowBuilder.withInitializer(Consumer)
method.- Overrides:
newEntity
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
entity
- new entity instance to be passed to the detail view- Returns:
- this instance for chaining
-
editEntity
Description copied from class:DetailWindowBuilder
SetsDetailViewMode
toEDIT
and the builder for chaining.- Overrides:
editEntity
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
entity
- entity instance to be passed to the detail view- Returns:
- this instance for chaining
-
withViewId
Description copied from class:DetailWindowBuilder
Sets identifier of the opened view as specified in theViewController
annotation.- Overrides:
withViewId
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
viewId
- identifier of the opened view as specified in theViewController
annotation- Returns:
- this instance for chaining
-
withInitializer
Description copied from class:DetailWindowBuilder
Sets callback to initialize a new entity instance.The initializer is invoked only when
DetailViewMode
isCREATE
, i.e. whenDetailWindowBuilder.newEntity()
orDetailWindowBuilder.newEntity(Object)
methods are invoked on the builder.- Overrides:
withInitializer
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
initializer
- callback to initialize a new entity instance.- Returns:
- this instance for chaining
-
withTransformation
Description copied from class:DetailWindowBuilder
Sets code to transform the edited entity after detail view saved.Applied only if either field or container or listDataComponent is assigned.
- Overrides:
withTransformation
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
transformation
- edited entity transformation object- Returns:
- this instance for chaining
- See Also:
-
withContainer
Description copied from class:DetailWindowBuilder
SetsCollectionContainer
to update after the detail view is saved.If the container is
Nested
, the framework automatically initializes the reference to the parent entity and sets up data contexts for editing compositions.- Overrides:
withContainer
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
container
- the container to update after the detail view is saved.- Returns:
- this instance for chaining
-
withParentDataContext
Description copied from class:DetailWindowBuilder
Sets parentDataContext
for the detail view.The view will save data to the parent context instead of directly to
DataManager
.- Overrides:
withParentDataContext
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
parentDataContext
- parent data context to set- Returns:
- this instance for chaining
-
withListDataComponent
public DetailWindowClassBuilder<E,V> withListDataComponent(@Nullable ListDataComponent<E> listDataComponent) Description copied from class:DetailWindowBuilder
Sets list data component that is used to get thecontainer
if it is not set explicitly byDetailWindowBuilder.withContainer(CollectionContainer)
method.Usually, the list component is a
DataGrid
displaying the list of entities.- Overrides:
withListDataComponent
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
listDataComponent
- the component to set- Returns:
- this instance for chaining
-
withField
public DetailWindowClassBuilder<E,V> withField(@Nullable com.vaadin.flow.component.HasValue<?, E> field) Description copied from class:DetailWindowBuilder
Sets the field in which the framework sets the saved entity after successful detail view saving.- Overrides:
withField
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
field
- the field to set- Returns:
- this instance for chaining
-
withAddFirst
Description copied from class:DetailWindowBuilder
Defines whether a new item will be added to the beginning or to the end of collection. Affects only standalone containers, for nested containers new items are always added to the end.- Overrides:
withAddFirst
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
addFirst
- whether a new item will be added to the beginning of collection- Returns:
- this instance for chaining
-
withAfterOpenListener
public DetailWindowClassBuilder<E,V> withAfterOpenListener(@Nullable Consumer<DialogWindow.AfterOpenEvent<V>> listener) Description copied from class:AbstractWindowBuilder
AddsDialogWindow.AfterOpenEvent
listener to the dialog window.- Overrides:
withAfterOpenListener
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withAfterCloseListener
public DetailWindowClassBuilder<E,V> withAfterCloseListener(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> listener) Description copied from class:AbstractWindowBuilder
AddsDialogWindow.AfterCloseEvent
listener to the dialog window.- Overrides:
withAfterCloseListener
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withViewConfigurer
Description copied from class:AbstractWindowBuilder
Adds configurer to the dialog window.- Overrides:
withViewConfigurer
in classDetailWindowBuilder<E,
V extends View<?> & DetailView<E>> - Parameters:
configurer
- the configurer to add- Returns:
- the instance for chaining
-
getViewClass
- Specified by:
getViewClass
in interfaceDialogWindowClassBuilder<E>
- Returns:
- opened view class
-