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
FieldsFields inherited from class io.jmix.flowui.view.builder.DetailWindowBuilder
addFirst, container, editedEntity, entityClass, field, initializer, listDataComponent, mode, newEntity, parentDataContext, transformationFields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, handler, origin, viewId -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDetailWindowClassBuilder(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) SetsDetailViewModetoEDITand the builder for chaining.SetsDetailViewModetoCREATEand the builder for chaining.SetsDetailViewModetoCREATEand 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.AfterCloseEventlistener to the dialog window.withAfterOpenListener(Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEventlistener to the dialog window.withContainer(CollectionContainer<E> container) SetsCollectionContainerto 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 thecontainerif it is not set explicitly byDetailWindowBuilder.withContainer(CollectionContainer)method.withParentDataContext(DataContext parentDataContext) Sets parentDataContextfor the detail view.withTransformation(Function<E, E> transformation) Sets code to transform the edited entity after detail view saved.withViewId(String viewId) Sets identifier of the opened view as specified in theViewControllerannotation.Methods inherited from class io.jmix.flowui.view.builder.DetailWindowBuilder
getAddFirst, getContainer, getEditedEntity, getEntityClass, getField, getInitializer, getListDataComponent, getMode, getNewEntity, getParentDataContext, getTransformation, 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
-
DetailWindowClassBuilder
-
DetailWindowClassBuilder
-
-
Method Details
-
newEntity
Description copied from class:DetailWindowBuilderSetsDetailViewModetoCREATEand 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:
newEntityin classDetailWindowBuilder<E,V extends View<?> & DetailView<E>> - Returns:
- this instance for chaining
-
newEntity
Description copied from class:DetailWindowBuilderSetsDetailViewModetoCREATEand 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:
newEntityin 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:DetailWindowBuilderSetsDetailViewModetoEDITand the builder for chaining.- Overrides:
editEntityin 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:DetailWindowBuilderSets identifier of the opened view as specified in theViewControllerannotation.- Overrides:
withViewIdin classDetailWindowBuilder<E,V extends View<?> & DetailView<E>> - Parameters:
viewId- identifier of the opened view as specified in theViewControllerannotation- Returns:
- this instance for chaining
-
withInitializer
Description copied from class:DetailWindowBuilderSets callback to initialize a new entity instance.The initializer is invoked only when
DetailViewModeisCREATE, i.e. whenDetailWindowBuilder.newEntity()orDetailWindowBuilder.newEntity(Object)methods are invoked on the builder.- Overrides:
withInitializerin 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:DetailWindowBuilderSets code to transform the edited entity after detail view saved.Applied only if either field or container or listDataComponent is assigned.
- Overrides:
withTransformationin 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:DetailWindowBuilderSetsCollectionContainerto 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:
withContainerin 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:DetailWindowBuilderSets parentDataContextfor the detail view.The view will save data to the parent context instead of directly to
DataManager.- Overrides:
withParentDataContextin 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:DetailWindowBuilderSets list data component that is used to get thecontainerif it is not set explicitly byDetailWindowBuilder.withContainer(CollectionContainer)method.Usually, the list component is a
DataGriddisplaying the list of entities.- Overrides:
withListDataComponentin 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:DetailWindowBuilderSets the field in which the framework sets the saved entity after successful detail view saving.- Overrides:
withFieldin classDetailWindowBuilder<E,V extends View<?> & DetailView<E>> - Parameters:
field- the field to set- Returns:
- this instance for chaining
-
withAddFirst
Description copied from class:DetailWindowBuilderDefines 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:
withAddFirstin 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:AbstractWindowBuilderAddsDialogWindow.AfterOpenEventlistener to the dialog window.- Overrides:
withAfterOpenListenerin 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:AbstractWindowBuilderAddsDialogWindow.AfterCloseEventlistener to the dialog window.- Overrides:
withAfterCloseListenerin classDetailWindowBuilder<E,V extends View<?> & DetailView<E>> - Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
getViewClass
- Specified by:
getViewClassin interfaceDialogWindowClassBuilder<E>- Returns:
- opened view class
-