Package io.jmix.flowui.view.builder
Class AbstractWindowBuilder<V extends View<?>>
java.lang.Object
io.jmix.flowui.view.builder.AbstractWindowBuilder<V>
- All Implemented Interfaces:
DialogWindowBuilder<V>
- Direct Known Subclasses:
DetailWindowBuilder
,LookupWindowBuilder
,WindowBuilder
public class AbstractWindowBuilder<V extends View<?>>
extends Object
implements DialogWindowBuilder<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<DialogWindow.AfterCloseEvent<V>>
protected Consumer<DialogWindow.AfterOpenEvent<V>>
protected com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent>
protected final Function<AbstractWindowBuilder<V>,
DialogWindow<V>> protected final View<?>
protected com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent>
protected String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractWindowBuilder
(View<?> origin, Function<? extends AbstractWindowBuilder<V>, DialogWindow<V>> handler) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the dialog window.Optional<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent>>
View<?>
Optional<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent>>
open()
Opens built dialog window.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.withDraggedListener
(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener) AddsDialog.DialogDraggedEvent
listener to the dialog window.withResizeListener
(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener) AddsDialog.DialogResizeEvent
listener to the dialog window.withViewConfigurer
(Consumer<V> configurer) Adds configurer to the dialog window.
-
Field Details
-
origin
-
handler
protected final Function<AbstractWindowBuilder<V extends View<?>>,DialogWindow<V extends View<?>>> handler -
viewId
-
afterOpenListener
-
afterCloseListener
-
draggedListener
protected com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> draggedListener -
resizeListener
protected com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> resizeListener -
viewConfigurer
-
-
Constructor Details
-
AbstractWindowBuilder
protected AbstractWindowBuilder(View<?> origin, Function<? extends AbstractWindowBuilder<V>, DialogWindow<V>> handler)
-
-
Method Details
-
withAfterOpenListener
public AbstractWindowBuilder<V> withAfterOpenListener(@Nullable Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEvent
listener to the dialog window.- Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withAfterCloseListener
public AbstractWindowBuilder<V> withAfterCloseListener(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> listener) AddsDialogWindow.AfterCloseEvent
listener to the dialog window.- Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withDraggedListener
public AbstractWindowBuilder<V> withDraggedListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener) AddsDialog.DialogDraggedEvent
listener to the dialog window.- Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withResizeListener
public AbstractWindowBuilder<V> withResizeListener(@Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener) AddsDialog.DialogResizeEvent
listener to the dialog window.- Parameters:
listener
- the listener to add- Returns:
- this instance for chaining
-
withViewConfigurer
Adds configurer to the dialog window.- Parameters:
configurer
- the configurer to add- Returns:
- the instance for chaining
-
getOrigin
- Specified by:
getOrigin
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- invoking view
-
getViewId
- Specified by:
getViewId
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- identifier of the opened view as specified in the
ViewController
annotation
-
getAfterOpenListener
- Specified by:
getAfterOpenListener
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- after open dialog listener
-
getAfterCloseListener
- Specified by:
getAfterCloseListener
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- after close dialog listener
-
getDraggedListener
public Optional<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent>> getDraggedListener()- Specified by:
getDraggedListener
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- dialog dragged listener
-
getResizeListener
public Optional<com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent>> getResizeListener()- Specified by:
getResizeListener
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- dialog resize listener
-
getViewConfigurer
- Specified by:
getViewConfigurer
in interfaceDialogWindowBuilder<V extends View<?>>
- Returns:
- dialog view configurer
-
build
Builds the dialog window. Dialog window should be shown usingDialogWindow.open()
.- Returns:
- built dialog window
-
open
Opens built dialog window.- Returns:
- built dialog window
-