Usage Example:
AbstractDialog dialog = new AbstractDialog()
.setTitle("Example Dialog")
.appendChild(new Text("This is a sample dialog box."))
.setAutoClose(true)
.open();
T
The concrete subclass of the AbstractDialog .
See also :
Sample usage:
AlertMessageDialog dialog = AlertMessageDialog.create("Confirmation", "Are you sure you want to proceed?")
.onConfirm(alert -> {
// Handle the confirmation logic here
})
.open();
This dialog allows you to display a confirmation message to the user and get their response (either confirmation or rejection). It provides buttons for confirming and rejecting the action and can be customized with a title and message.
Usage example:
ConfirmationDialog.create("Delete Item", "Are you sure you want to delete this item?")
.onConfirm(dialog -> {
// Handle the confirmation logic here
dialog.close();
})
.onReject(dialog -> dialog.close())
.open();
Usage:
MessageDialog.create("Title", "This is the message")
.onConfirm(dialog -> {
// handle confirmation
})
.open();
public void AbstractDialog()
AbstractDialog .
public Transition getOpenTransition()
The open transition.
public T setOpenTransition(Transition openTransition)
openTransition
The open transition to set.
This dialog instance for method chaining.
public Transition getCloseTransition()
The close transition.
public T setCloseTransition(Transition closeTransition)
closeTransition
The close transition to set.
This dialog instance for method chaining.
public int getTransitionDuration()
The transition duration in milliseconds.
public T setTransitionDuration(int transitionDuration)
transitionDuration
The transition duration in milliseconds to set.
This dialog instance for method chaining.
public boolean isAnimate()
true if animations are enabled, false otherwise.
public T setAnimate(boolean animate)
animate
true to enable animations, false to disable.
This dialog instance for method chaining.
public T setAutoClose(boolean autoClose)
autoClose
true to enable auto-closing, false to disable.
This dialog instance for method chaining.
public T setAutoAppendAndRemove(boolean autoAppendAndRemove)
autoAppendAndRemove
true to enable auto-append and auto-remove, false to disable.
This dialog instance for method chaining.
public T open()
This dialog instance for method chaining.
public T close()
This dialog instance for method chaining.
public boolean isAutoClose()
true if auto-close is enabled, false otherwise.
public T setStretchWidth(IsDialogWidth size)
size
The dialog width size.
This dialog instance for method chaining.
public T setStretchHeight(IsDialogHeight size)
size
The dialog height size.
This dialog instance for method chaining.
public boolean isModal()
true if the dialog is modal, false otherwise.
public T setModal(boolean modal)
modal
true to make the dialog modal, false otherwise.
This dialog instance for method chaining.
public boolean isAutoFocus()
true if auto-focus is enabled, false otherwise.
public T setAutoFocus(boolean autoFocus)
autoFocus
true to enable auto-focus, false to disable.
This dialog instance for method chaining.
public HTMLElement getAppendTarget()
public HTMLElement getStyleTarget()
public HTMLDivElement element()
public T appendChild(HeaderContent<?> element)
element
The child element to append.
This dialog instance for method chaining.
public T appendChild(FooterContent<?> element)
element
The child element to append.
This dialog instance for method chaining.
public DivElement getModalElement()
The modal element.
public T withHeader(ChildHandler<T, DivElement> handler)
ChildHandler .
handler
The handler for customizing the header.
This dialog instance for method chaining.
public DivElement getHeader()
The header element.
public T setIcon(Icon<?> icon)
icon
The icon to set.
This dialog instance for method chaining.
public T withContentBody(ChildHandler<T, DivElement> handler)
ChildHandler .
handler
The handler for customizing the content body.
This dialog instance for method chaining.
public DivElement getContentBody()
The body element.
public T withContentElement(ChildHandler<T, DivElement> handler)
ChildHandler .
handler
The handler for customizing the content element.
This dialog instance for method chaining.
public DivElement getContentElement()
The content element.
public T withContentHeader(ChildHandler<T, DivElement> handler)
ChildHandler .
handler
The handler for customizing the content header.
This dialog instance for method chaining.
public DivElement getContentHeader()
The content header element.
public T withContentFooter(ChildHandler<T, DivElement> handler)
ChildHandler .
handler
The handler for customizing the content footer.
This dialog instance for method chaining.
public DivElement getContentFooter()
The content footer element.
public Element getDefaultFocusElement()
The default focus element.
public T setDefaultFocusElement(Element defaultFocusElement)
defaultFocusElement
The default focus element to set.
This dialog instance for method chaining.
public T setDefaultFocusElement(IsElement<?> defaultFocusElement)
defaultFocusElement
The default focus element to set.
This dialog instance for method chaining.
public T withMainElement(ChildHandler<T, DivElement> handler)
handler
same dialog instance
public boolean isOpen()
true if the dialog is open, false otherwise.
public void AlertMessageDialog()
public void AlertMessageDialog(String title)
title
The title of the dialog.
public void AlertMessageDialog(String title, String message)
title
The title of the dialog.
message
The message to display in the dialog.
public static AlertMessageDialog create()
A new AlertMessageDialog instance with no title or message.
public static AlertMessageDialog create(String title)
title
The title for the dialog.
A new AlertMessageDialog instance with the specified title and no message.
public static AlertMessageDialog create(String title, String message)
title
The title for the dialog.
message
The message to display in the dialog.
A new AlertMessageDialog instance with the specified title and message.
public AlertMessageDialog setTitle(String title)
title
The title to set.
This AlertMessageDialog instance.
public AlertMessageDialog setMessage(String message)
message
The message to set.
This AlertMessageDialog instance.
public AlertMessageDialog onConfirm(MessageHandler handler)
handler
The handler to be invoked when the confirmation button is clicked.
This AlertMessageDialog instance.
public Button getConfirmButton()
The confirmation Button.
public AlertMessageDialog withConfirmButton(ChildHandler<AlertMessageDialog, Button> handler)
handler
The handler for customizing the confirmation button.
This AlertMessageDialog instance.
public Transition getIconStartTransition()
The start Transition.
public AlertMessageDialog setIconStartTransition(Transition transition)
transition
The start Transition to set.
This AlertMessageDialog instance.
public Transition getIconEndTransition()
The end Transition.
public AlertMessageDialog setIconEndTransition(Transition transition)
transition
The end Transition to set.
This AlertMessageDialog instance.
public int getIconAnimationDuration()
The animation duration in milliseconds.
public AlertMessageDialog setIconAnimationDuration(int duration)
duration
The animation duration to set in milliseconds.
This AlertMessageDialog instance.
public Icon<?> getAlertIcon()
The alert Icon.
public AlertMessageDialog setAlertIcon(Icon<?> alertIcon)
alertIcon
The alert Icon to set.
This AlertMessageDialog instance.
public AlertMessageDialog withNavHeader(ChildHandler<AlertMessageDialog, NavBar> handler)
handler
The handler for customizing the navigation header.
This AlertMessageDialog instance.
public void ConfirmationDialog()
ConfirmationDialog instance.
public void ConfirmationDialog(String title)
ConfirmationDialog instance with the specified title.
title
The title to set for the dialog.
public void ConfirmationDialog(String title, String message)
ConfirmationDialog instance with the specified title and message.
title
The title to set for the dialog.
message
The message to display in the dialog.
public static ConfirmationDialog create()
public static ConfirmationDialog create(String title)
title
The title of the confirmation dialog.
public static ConfirmationDialog create(String title, String message)
title
The title of the confirmation dialog.
message
The message to display in the dialog.
public ConfirmationDialog setTitle(String title)
title
The title to set for the dialog.
This ConfirmationDialog instance for method chaining.
public ConfirmationDialog setMessage(String message)
message
The message to display in the dialog.
This ConfirmationDialog instance for method chaining.
public ConfirmationDialog onConfirm(ConfirmHandler confirmHandler)
confirmHandler
The action to be executed on confirmation.
This ConfirmationDialog instance for method chaining.
public ConfirmationDialog onReject(RejectHandler rejectHandler)
rejectHandler
The action to be executed on rejection.
This ConfirmationDialog instance for method chaining.
public Button getConfirmButton()
The confirm button.
public Button getRejectButton()
The reject button.
public ConfirmationDialog withConfirmButton(ChildHandler<ConfirmationDialog, Button> handler)
handler
The handler to customize the confirm button.
This ConfirmationDialog instance for method chaining.
public ConfirmationDialog withRejectButton(ChildHandler<ConfirmationDialog, Button> handler)
handler
The handler to customize the reject button.
This ConfirmationDialog instance for method chaining.
public ConfirmationDialog withNavHeader(ChildHandler<ConfirmationDialog, NavBar> handler)
handler
The handler to customize the dialog header.
This ConfirmationDialog instance for method chaining.
public void MessageDialog()
public void MessageDialog(String title)
title
The title of the dialog
public void MessageDialog(String title, String message)
title
The title of the dialog
message
The message to display in the dialog
public static MessageDialog create()
A new instance of MessageDialog
public static MessageDialog create(String title)
title
The title of the dialog
A new instance of MessageDialog
public static MessageDialog create(String title, String message)
title
The title of the dialog
message
The message to display in the dialog
A new instance of MessageDialog
public MessageDialog setTitle(String title)
title
The title of the dialog
Current instance for chaining
public MessageDialog setMessage(String message)
message
The message to display in the dialog
Current instance for chaining
public MessageDialog onConfirm(MessageHandler handler)
handler
The MessageHandler to handle the confirmation event
Current instance for chaining
public Button getConfirmButton()
public MessageDialog withConfirmButton(ChildHandler<MessageDialog, Button> handler)
handler
The handler to modify the confirm button
Current instance for chaining
public MessageDialog withNavHeader(ChildHandler<MessageDialog, NavBar> handler)
handler
The handler to modify the navigation header
Current instance for chaining