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 org.springframework.beans.factory.ObjectProvider<OpenedDialogWindows>
protected WindowBuilderProcessor
-
Constructor Summary
ConstructorDescriptionDialogWindows
(WindowBuilderProcessor windowBuilderProcessor, DetailWindowBuilderProcessor detailBuilderProcessor, LookupWindowBuilderProcessor lookupBuilderProcessor, org.springframework.beans.factory.ObjectProvider<OpenedDialogWindows> openedDialogWindows) -
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
(EntityMultiPickerComponent<E> picker) protected <E> Class<E>
getBeanType
(EntityPickerComponent<E> picker) protected <E> Class<E>
getBeanType
(ListDataComponent<E> listDataComponent) <E,
V extends View<?>>
LookupWindowBuilder<E,V> lookup
(EntityMultiPickerComponent<E> picker) Creates a lookup view builder to select an entities and set it to the multi-value picker 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
-
openedDialogWindows
-
-
Constructor Details
-
DialogWindows
public DialogWindows(WindowBuilderProcessor windowBuilderProcessor, DetailWindowBuilderProcessor detailBuilderProcessor, LookupWindowBuilderProcessor lookupBuilderProcessor, @Autowired(required=false) org.springframework.beans.factory.ObjectProvider<OpenedDialogWindows> openedDialogWindows)
-
-
Method Details
-
detail
Creates a detail view builder for entity class.Example of opening a view for editing an entity:
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();
Example of opening a view for creating a new entity instance:
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:
-
lookup
Creates a lookup view builder to select an entities and set it to the multi-value picker component.- Parameters:
picker
- the multi-value picker component- See Also:
-
view
Creates a view builder.- Parameters:
origin
- calling viewviewClass
- opened view class
-
getOpenedDialogWindows
- Returns:
- the object that provides information about opened dialogs
- Throws:
IllegalStateException
- ifOpenedDialogWindows
is not available
-
view
Creates a view builder.- Parameters:
origin
- calling viewviewId
- id of the opened view (as set in theViewController
annotation)
-
getBeanType
-
getBeanType
-
getBeanType
-