Package io.jmix.flowui.view.builder
Class ReadWindowBuilder<E,V extends View<?>>
java.lang.Object
io.jmix.flowui.view.builder.AbstractWindowBuilder<V>
io.jmix.flowui.view.builder.ReadWindowBuilder<E,V>
- Type Parameters:
E- shown entity typeV- a view type which is opened in a dialog window
- All Implemented Interfaces:
DialogWindowBuilder<V>
- Direct Known Subclasses:
ReadWindowClassBuilder
Provides a fluent interface to configure and open a read view in a
DialogWindow.-
Field Summary
FieldsFields inherited from class io.jmix.flowui.view.builder.AbstractWindowBuilder
afterCloseListener, afterOpenListener, draggedListener, handler, origin, resizeListener, viewConfigurer, viewId -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReadWindowBuilder(ReadWindowBuilder<E, V> builder) ReadWindowBuilder(View<?> origin, Class<E> entityClass, Function<? extends ReadWindowBuilder<E, V>, DialogWindow<V>> handler) -
Method Summary
Modifier and TypeMethodDescriptionreadEntity(E entity) Sets the entity instance to show and returns the builder for chaining.withAfterCloseListener(@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.withDraggedListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener) AddsDialog.DialogDraggedEventlistener to the dialog window.withResizeListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener) AddsDialog.DialogResizeEventlistener to the dialog window.<T extends View<?> & ReadView<E>>
ReadWindowClassBuilder<E, T> withViewClass(Class<T> viewClass) Sets the opened view class.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.AbstractWindowBuilder
build, getAfterCloseListener, getAfterOpenListener, getDraggedListener, getOrigin, getResizeListener, getViewConfigurer, getViewId, open
-
Field Details
-
entityClass
-
entity
-
-
Constructor Details
-
ReadWindowBuilder
public ReadWindowBuilder(View<?> origin, Class<E> entityClass, Function<? extends ReadWindowBuilder<E, V>, DialogWindow<V>> handler) -
ReadWindowBuilder
-
-
Method Details
-
readEntity
Sets the entity instance to show and returns the builder for chaining.- Parameters:
entity- entity instance to show- Returns:
- this instance for chaining
-
withViewClass
public <T extends View<?> & ReadView<E>> ReadWindowClassBuilder<E,T> withViewClass(Class<T> viewClass) Sets the opened view class.- Type Parameters:
T- view type- Parameters:
viewClass- opened view class- Returns:
ReadWindowClassBuilderinstance for chaining
-
withViewId
Sets identifier of the opened view as specified in theViewControllerannotation.- Parameters:
viewId- identifier of the opened view as specified in theViewControllerannotation- Returns:
- this instance for chaining
-
withAfterOpenListener
public ReadWindowBuilder<E,V> withAfterOpenListener(@Nullable Consumer<DialogWindow.AfterOpenEvent<V>> listener) Description copied from class:AbstractWindowBuilderAddsDialogWindow.AfterOpenEventlistener to the dialog window.- Overrides:
withAfterOpenListenerin classAbstractWindowBuilder<V extends View<?>>- Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withAfterCloseListener
public ReadWindowBuilder<E,V> withAfterCloseListener(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> listener) Description copied from class:AbstractWindowBuilderAddsDialogWindow.AfterCloseEventlistener to the dialog window.- Overrides:
withAfterCloseListenerin classAbstractWindowBuilder<V extends View<?>>- Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withDraggedListener
public ReadWindowBuilder<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 classAbstractWindowBuilder<V extends View<?>>- Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withResizeListener
public ReadWindowBuilder<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 classAbstractWindowBuilder<V extends View<?>>- Parameters:
listener- the listener to add- Returns:
- this instance for chaining
-
withViewConfigurer
Description copied from class:AbstractWindowBuilderAdds configurer to the dialog window.- Overrides:
withViewConfigurerin classAbstractWindowBuilder<V extends View<?>>- Parameters:
configurer- the configurer to add- Returns:
- the instance for chaining
-
getEntityClass
- Returns:
- the class of the shown entity
-
getEntity
- Returns:
- the entity instance to show, or an empty
Optionalif it is not set
-