com.vaadin.flow.component.confirmdialog.

Class ConfirmDialog

    • Method Detail

      • setCancelable

        public void setCancelable(boolean cancelable)

        Whether to show or hide Cancel button.

      • setRejectable

        public void setRejectable(boolean rejectable)

        Whether to show or hide Reject button.

      • setRejectButton

        public void setRejectButton(String buttonText,
                                    ComponentEventListener<ConfirmDialog.RejectEvent> rejectListener)

        Sets Reject button text and `reject` event listener. Makes Reject button visible

        Parameters:

        buttonText - the text inside Reject button

        rejectListener - the event listener for `reject` event

      • setRejectButton

        public void setRejectButton(String buttonText,
                                    ComponentEventListener<ConfirmDialog.RejectEvent> rejectListener,
                                    String theme)

        Sets Reject button text, `reject` event listener, Reject button theme. Makes Reject button visible

        Parameters:

        buttonText - the text inside Reject button

        rejectListener - the event listener for `reject` event

        theme - the theme applied for a Reject button

      • setRejectButton

        public void setRejectButton(Element element)

        Sets custom Reject button

        Parameters:

        element - the element to display instead of default Reject button

      • setCancelButton

        public void setCancelButton(String buttonText,
                                    ComponentEventListener<ConfirmDialog.CancelEvent> cancelListener)

        Sets Cancel button text and `cancel` event listener. Makes Cancel button visible

        Parameters:

        buttonText - the text inside Cancel button

        cancelListener - the event listener for `cancel` event

      • setCancelButton

        public void setCancelButton(String buttonText,
                                    ComponentEventListener<ConfirmDialog.CancelEvent> cancelListener,
                                    String theme)

        Sets Cancel button text, `cancel` event listener and Cancel button theme. Makes Cancel button visible

        Parameters:

        buttonText - the text inside Cancel button

        cancelListener - the event listener for `cancel` event

        theme - the theme applied for a Cancel button

      • setCancelButton

        public void setCancelButton(Element element)

        Sets custom cancel button

        Parameters:

        element - the element to display instead of default Cancel button

      • setConfirmButton

        public void setConfirmButton(String buttonText,
                                     ComponentEventListener<ConfirmDialog.ConfirmEvent> confirmListener)

        Sets Confirm button text and `confirm` event listener

        Parameters:

        buttonText - the text inside Confirm button

        confirmListener - the event listener for `confirm` event

      • setConfirmButton

        public void setConfirmButton(String buttonText,
                                     ComponentEventListener<ConfirmDialog.ConfirmEvent> confirmListener,
                                     String theme)

        Sets Confirm button text, `confirm` event listener and Confirm button theme

        Parameters:

        buttonText - the text inside Confirm button

        confirmListener - the event listener for `confirm` event

        theme - the theme applied for a Confirm button

      • setConfirmButton

        public void setConfirmButton(Element element)

        Sets custom confirm button

        Parameters:

        element - the element to display instead of default Confirm button

      • setText

        public void setText(String message)

        Sets confirmation message text

      • setText

        public void setText(Element element)

        Sets custom confirmation message element

        Parameters:

        element - the element to display instead of default confirmation text node

      • setConfirmText

        public void setConfirmText(String confirmText)

        Sets Confirm button text

      • setConfirmButtonTheme

        public void setConfirmButtonTheme(String confirmTheme)

        Sets Confirm button theme

      • setCancelText

        public void setCancelText(String cancelText)

        Sets Cancel button text

      • setCancelButtonTheme

        public void setCancelButtonTheme(String cancelTheme)

        Sets Cancel button theme

      • setRejectText

        public void setRejectText(String rejectText)

        Sets Reject button text

      • setRejectButtonTheme

        public void setRejectButtonTheme(String rejectTheme)

        Sets Reject button theme

      • setHeader

        public void setHeader(String header)

        Sets confirmation dialog header text

      • setHeader

        public void setHeader(Element element)

        Sets confirmation dialog custom header element

        Parameters:

        element - the element to display instead of default header text

      • open

        public void open()

        Opens the dialog.

        Note: You don't need to add the dialog component before opening it, cause opening a dialog will automatically add it to the <body> if it's not yet attached anywhere.

      • close

        public void close()

        Closes the dialog.

        Note: This method also removes the dialog component from the DOM after closing it, unless you have added the component manually.

      • setOpened

        public void setOpened(boolean opened)

        Opens or closes the dialog.

        Note: Confirm-dialog will be attached or detached from the DOM automatically, if it was not added manually.

        Parameters:

        opened - true to open the confirm-dialog, false to close it