Package io.jmix.flowui
Class DialogWindows
java.lang.Object
io.jmix.flowui.DialogWindows
Provides fluent interface for opening views in dialog windows.
-
Field Summary
Modifier and TypeFieldDescriptionprotected DetailWindowBuilderProcessor
protected LookupWindowBuilderProcessor
protected WindowBuilderProcessor
-
Constructor Summary
ConstructorDescriptionDialogWindows
(WindowBuilderProcessor windowBuilderProcessor, DetailWindowBuilderProcessor detailBuilderProcessor, LookupWindowBuilderProcessor lookupBuilderProcessor) -
Method Summary
Modifier and TypeMethodDescription<E,
V extends View<?>>
DetailWindowBuilder<E,V> detail
(EntityPickerComponent<E> picker) Creates a detail view builder to edit an entity selected in the picker component.<E,
V extends View<?>>
DetailWindowBuilder<E,V> detail
(ListDataComponent<E> listDataComponent) Creates a detail view builder to edit an entity selected in the list component.<E,
V extends View<?>>
DetailWindowBuilder<E,V> Creates a detail view builder for entity class.protected <E> Class<E>
getBeanType
(EntityPickerComponent<E> picker) protected <E> Class<E>
getBeanType
(ListDataComponent<E> listDataComponent) protected View<?>
getView
(com.vaadin.flow.component.Component component) <E,
V extends View<?>>
LookupWindowBuilder<E,V> lookup
(EntityPickerComponent<E> picker) Creates a lookup view builder to select an entity and set it to the picker component.<E,
V extends View<?>>
LookupWindowBuilder<E,V> lookup
(ListDataComponent<E> listDataComponent) Creates a lookup view builder to select entities and add them to the data container of the list component.<E,
V extends View<?>>
LookupWindowBuilder<E,V> Creates a lookup view builder for an entity class.<V extends View<?>>
WindowBuilder<V>Creates a view builder.WindowBuilder<View<?>>
Creates a view builder.
-
Field Details
-
windowBuilderProcessor
-
detailBuilderProcessor
-
lookupBuilderProcessor
-
-
Constructor Details
-
DialogWindows
public DialogWindows(WindowBuilderProcessor windowBuilderProcessor, DetailWindowBuilderProcessor detailBuilderProcessor, LookupWindowBuilderProcessor lookupBuilderProcessor)
-
-
Method Details
-
detail
Creates a detail view builder for entity class.Example of opening a view for editing an entity:
Example of opening a view for creating a new entity instance:DialogWindow<CustomerDetailView> dialogWindow = dialogWindows.detail(this, Customer.class) .withViewClass(CustomerDetailView.class) .editEntity(customer) .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { Customer editedCustomer = closeEvent.getView().getEditedEntity(); // ... } }) .open();
DialogWindow<CustomerDetailView> dialogWindow = dialogWindows.detail(this, Customer.class) .withViewClass(CustomerDetailView.class) .newEntity() .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { Customer newCustomer = closeEvent.getView().getEditedEntity(); // ... } }) .open();
- Parameters:
origin
- calling viewentityClass
- edited entity class
-
detail
public <E,V extends View<?>> DetailWindowBuilder<E,V> detail(ListDataComponent<E> listDataComponent) Creates a detail view builder to edit an entity selected in the list component.- Parameters:
listDataComponent
- the component which provides a selected entity to edit- See Also:
-
detail
Creates a detail view builder to edit an entity selected in the picker component.- Parameters:
picker
- the component which provides an entity to edit- See Also:
-
lookup
Creates a lookup view builder for an entity class.Example of opening a view for selecting an entity:
DialogWindow<CustomerListView> dialogWindow = dialogWindows.lookup(this, Customer.class) .withViewClass(CustomerListView.class) .withSelectHandler(customers -> { // ... }) .open();
- Parameters:
origin
- calling viewentityClass
- entity class
-
lookup
public <E,V extends View<?>> LookupWindowBuilder<E,V> lookup(ListDataComponent<E> listDataComponent) Creates a lookup view builder to select entities and add them to the data container of the list component.- Parameters:
listDataComponent
- the list component- See Also:
-
lookup
Creates a lookup view builder to select an entity and set it to the picker component.- Parameters:
picker
- the picker component- See Also:
-
view
Creates a view builder.- Parameters:
origin
- calling viewviewClass
- opened view class
-
view
Creates a view builder.- Parameters:
origin
- calling viewviewId
- id of the opened view (as set in theViewController
annotation)
-
getView
-
getBeanType
-
getBeanType
-