Class Dialog<T extends Dialog<T>>


public class Dialog<T extends Dialog<T>> extends StyledContainerElement<T>
Represents an HTML <dialog> element for dialog boxes or modals.

The Dialog element defines a dialog box or modal window. It can be used to create popup dialogs, confirmation boxes, or other interactive overlays that require user interaction.

Features:

  • Creates modal or non-modal dialog boxes
  • Can be shown or hidden programmatically
  • Built-in browser dialog functionality
  • Open attribute controls visibility
  • Useful for alerts, forms, and confirmations

Usage:


 Dialog dialog = new Dialog();
 dialog.setId("myDialog");
 dialog.addChild(new Paragraph("Dialog content"));
 // Use JavaScript to show: document.getElementById('myDialog').showModal();
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • invalid reference
    StyledElement
  • Constructor Details

    • Dialog

      public Dialog()
      Constructs a <dialog> element in hidden state.
    • Dialog

      public Dialog(boolean open)
      Constructs a <dialog> element with specified visibility.
      Parameters:
      open - true to show dialog initially, false to hide it
  • Method Details

    • setOpen

      public final T setOpen(boolean open)
      Sets whether the dialog is currently visible.

      When true, the dialog is active and displayed. When false, the dialog is hidden.

      Parameters:
      open - True to show the dialog, false to hide it.
      Returns:
      This element for method chaining.