Package io.jmix.flowui.impl
Class DialogsImpl.InputDialogBuilderImpl
java.lang.Object
io.jmix.flowui.impl.DialogsImpl.InputDialogBuilderImpl
- All Implemented Interfaces:
- Dialogs.DialogBuilder<Dialogs.InputDialogBuilder>,- Dialogs.HasHeader<Dialogs.InputDialogBuilder>,- Dialogs.HasSize<Dialogs.InputDialogBuilder>,- Dialogs.InputDialogBuilder
- Enclosing class:
- DialogsImpl
public class DialogsImpl.InputDialogBuilderImpl
extends Object
implements Dialogs.InputDialogBuilder
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.jmix.flowui.Dialogs.InputDialogBuilderDialogs.InputDialogBuilder.LabelsPosition
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds the input dialog.List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep>getWidth()open()Opens the dialog.withActions(InputDialogAction... actions) Sets dialog actions.withActions(DialogActions actions) Sets predefined dialog actions.withActions(DialogActions actions, Consumer<InputDialog.InputDialogResult> resultHandler) Sets dialog actions and result handler.withCloseListener(com.vaadin.flow.component.ComponentEventListener<InputDialog.InputDialogCloseEvent> listener) Add close listener to the dialog.withHeader(String header) Sets a header text.withHeight(String height) Sets dialog height.withLabelsPosition(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) Sets labels position for default responsive steps.withParameter(InputParameter parameter) Adds input parameter to the dialog.withParameters(InputParameter... parameters) Sets input parameters.withResponsiveSteps(List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep> responsiveSteps) Sets responsive steps.Sets additional handler for field validation.Sets dialog width.
- 
Field Details- 
inputDialog
- 
dialogBuild
 
- 
- 
Constructor Details- 
InputDialogBuilderImpl
 
- 
- 
Method Details- 
withHeaderDescription copied from interface:Dialogs.HasHeaderSets a header text.- Specified by:
- withHeaderin interface- Dialogs.HasHeader<Dialogs.InputDialogBuilder>
- Parameters:
- header- header text
- Returns:
- builder
 
- 
getHeader- Specified by:
- getHeaderin interface- Dialogs.HasHeader<Dialogs.InputDialogBuilder>
- Returns:
- header text
 
- 
withWidthDescription copied from interface:Dialogs.HasSizeSets dialog width.- Specified by:
- withWidthin interface- Dialogs.HasSize<Dialogs.InputDialogBuilder>
- Parameters:
- width- width
- Returns:
- builder
 
- 
getWidth- Specified by:
- getWidthin interface- Dialogs.HasSize<Dialogs.InputDialogBuilder>
- Returns:
- dialog width value
 
- 
withHeightDescription copied from interface:Dialogs.HasSizeSets dialog height.- Specified by:
- withHeightin interface- Dialogs.HasSize<Dialogs.InputDialogBuilder>
- Parameters:
- height- height
- Returns:
- builder
 
- 
getHeight- Specified by:
- getHeightin interface- Dialogs.HasSize<Dialogs.InputDialogBuilder>
- Returns:
- dialog height value
 
- 
withParameterDescription copied from interface:Dialogs.InputDialogBuilderAdds input parameter to the dialog. InputParameter describes field which will be used in the input dialog.
 Example:dialogs.createInputDialog(this) .withParameter( entityParameter("userField", User.class) .withLabel("User field") .withRequired(true) ) .open();- Specified by:
- withParameterin interface- Dialogs.InputDialogBuilder
- Parameters:
- parameter- input parameter that will be added to the dialog
- Returns:
- builder
- See Also:
 
- 
withParametersDescription copied from interface:Dialogs.InputDialogBuilderSets input parameters. InputParameter describes field which will be used in the input dialog.
 Example:dialogs.createInputDialog(this) .withParameters( stringParameter("nameField") .withLabel("Name field label") .withDefaultValue("Default value"), intParameter("countField") .withLabel("Count field label") .withRequired(true)) .open();- Specified by:
- withParametersin interface- Dialogs.InputDialogBuilder
- Parameters:
- parameters- input parameters
- Returns:
- builder
- See Also:
 
- 
getParameters
- 
withResponsiveStepspublic Dialogs.InputDialogBuilder withResponsiveSteps(List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep> responsiveSteps) Description copied from interface:Dialogs.InputDialogBuilderSets responsive steps. Responsive steps used in describing the responsive layouting behavior of aFormLayout.- Specified by:
- withResponsiveStepsin interface- Dialogs.InputDialogBuilder
- Parameters:
- responsiveSteps- responsive steps
- Returns:
- builder
 
- 
getResponsiveSteps
- 
withLabelsPositionpublic Dialogs.InputDialogBuilder withLabelsPosition(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) Description copied from interface:Dialogs.InputDialogBuilderSets labels position for default responsive steps.- Specified by:
- withLabelsPositionin interface- Dialogs.InputDialogBuilder
- Parameters:
- labelsPosition- position of labels
- Returns:
- builder
- See Also:
 
- 
getLabelsPosition
- 
withCloseListenerpublic Dialogs.InputDialogBuilder withCloseListener(com.vaadin.flow.component.ComponentEventListener<InputDialog.InputDialogCloseEvent> listener) Description copied from interface:Dialogs.InputDialogBuilderAdd close listener to the dialog. See close actions forDialogActionsinInputDialog.- Specified by:
- withCloseListenerin interface- Dialogs.InputDialogBuilder
- Parameters:
- listener- close listener to add
- Returns:
- builder
 
- 
withActionsDescription copied from interface:Dialogs.InputDialogBuilderSets dialog actions.Note, if there is no actions are set input dialog will use Example:DialogActions.OK_CANCELby default.dialogs.createInputDialog(this) .withHeader("Dialog header") .withParameter(parameter("nameField").withLabel("Name")) .withActions( action("okAction") .withText("OK") .withIcon(VaadinIcon.CHECK.create()) .withHandler(event -> { InputDialogAction inputDialogAction = ((InputDialogAction) event.getSource()); InputDialog inputDialog = inputDialogAction.getInputDialog(); // do logic inputDialog.close(InputDialog.INPUT_DIALOG_OK_ACTION); }), action("cancelAction") .withText("Cancel") .withIcon(VaadinIcon.BAN.create()) .withValidationRequired(false) .withHandler(event -> { // do logic })) .open();- Specified by:
- withActionsin interface- Dialogs.InputDialogBuilder
- Parameters:
- actions- actions
- Returns:
- builder
- See Also:
 
- 
getActions
- 
withActionsDescription copied from interface:Dialogs.InputDialogBuilderSets predefined dialog actions. "OK" and "YES" actions always check fields validation before close the dialog. By default, if there is no actions are set input dialog will useDialogActions.OK_CANCEL.- Specified by:
- withActionsin interface- Dialogs.InputDialogBuilder
- Parameters:
- actions- actions
- Returns:
- builder
 
- 
withActionspublic Dialogs.InputDialogBuilder withActions(DialogActions actions, Consumer<InputDialog.InputDialogResult> resultHandler) Description copied from interface:Dialogs.InputDialogBuilderSets dialog actions and result handler. "OK" and "YES" actions always check fields validation before close the dialog. Handler is invoked after close event and can be used instead ofDialogs.InputDialogBuilder.withCloseListener(ComponentEventListener). Exampledialogs.createInputDialog(this) .withHeader("Dialog header") .withParameter(parameter("nameField").withLabel("Name")) .withActions(DialogActions.OK_CANCEL, result -> { switch (result.getCloseActionType()) { case OK -> { // do logic } case CANCEL -> { // do other logic } } }) .open();- Specified by:
- withActionsin interface- Dialogs.InputDialogBuilder
- Parameters:
- actions- dialog actions
- resultHandler- result handler
- Returns:
- builder
 
- 
getDialogActions
- 
getResultHandler
- 
withValidatorpublic Dialogs.InputDialogBuilder withValidator(Function<InputDialog.ValidationContext, ValidationErrors> validator) Description copied from interface:Dialogs.InputDialogBuilderSets additional handler for field validation. It receives input dialog context and must returnValidationErrorsinstance. Returned validation errors will be shown with another errors from fields. Exampledialogs.createInputDialog(this) .withParameters( stringParameter("phoneField").withLabel("Phone"), stringParameter("addressField").withLabel("Address")) .withValidator(context -> { String phone = context.getValue("phoneField"); String address = context.getValue("addressField"); if (Strings.isNullOrEmpty(phone) && Strings.isNullOrEmpty(address)) { return ValidationErrors.of("Phone or Address should be filled"); } return ValidationErrors.none(); }) .open();- Specified by:
- withValidatorin interface- Dialogs.InputDialogBuilder
- Parameters:
- validator- validator
- Returns:
- builder
 
- 
getValidator
- 
openDescription copied from interface:Dialogs.InputDialogBuilderOpens the dialog.- Specified by:
- openin interface- Dialogs.InputDialogBuilder
- Returns:
- opened input dialog
 
- 
buildDescription copied from interface:Dialogs.InputDialogBuilderBuilds the input dialog.- Specified by:
- buildin interface- Dialogs.InputDialogBuilder
- Returns:
- input dialog
 
 
-