Class Dialog<T extends Dialog<T>>


public abstract class Dialog<T extends Dialog<T>> extends Div<T>
Abstract base class for modal dialog components with a glass pane overlay.

Dialog provides a customizable modal dialog that displays over a semi-transparent glass pane. Subclasses implement createContent(Content) to populate the dialog body. The dialog includes a configurable titlebar, content area with scrolling, and optional close-on-click behavior.

Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Dialog

      public Dialog()
      Creates a new Dialog with default settings.
  • Method Details

    • setPaneColor

      public final void setPaneColor(Color color)
      Sets the background color of the glass pane overlay.
      Parameters:
      color - The pane background color.
    • setPaneColor

      public final void setPaneColor(Color color, int opacity)
      Sets the background color and opacity of the glass pane overlay.
      Parameters:
      color - The pane background color.
      opacity - The pane opacity (0-100).
    • setPaneOpacity

      public final void setPaneOpacity(int opacity)
      Sets the opacity of the glass pane overlay.
      Parameters:
      opacity - The pane opacity (0-100).
    • setCloseOnClickPane

      public final void setCloseOnClickPane(boolean closeOnClickPane)
      Sets whether clicking the glass pane closes the dialog.
      Parameters:
      closeOnClickPane - true to close on pane click, false otherwise.
    • setTitlebarClass

      public final void setTitlebarClass(String titlebarClass)
      Sets the CSS class for the titlebar element.
      Parameters:
      titlebarClass - The CSS class name.
    • setContentClass

      public final void setContentClass(String contentClass)
      Sets the CSS class for the content area element.
      Parameters:
      contentClass - The CSS class name.
    • open

      public final void open(HtmlPage page)
      Opens this dialog on the specified page.

      Adds the glass pane to the page body, builds the dialog structure, calls createContent(Content), and makes the dialog visible.

      Parameters:
      page - The page on which to display the dialog.
    • close

      public void close()
      Closes this dialog and removes it from the page.
    • close

      public void close(long delay)
      Closes this dialog after the specified delay.
      Parameters:
      delay - The delay in milliseconds before closing.
    • onCallback

      public void onCallback(String id)
      Description copied from class: Element
      Callback method invoked when a client callback is received.

      Override this method to handle callbacks requested via Element.requestCallback(String).

      Overrides:
      onCallback in class Element<T extends Dialog<T>>
      Parameters:
      id - The callback identifier.
    • getTitlebar

      public final Div getTitlebar()
      Returns the titlebar element for customization.
      Returns:
      The titlebar Div element.
    • getPane

      public final GlassPane getPane()
      Returns the glass pane overlay element.
      Returns:
      The GlassPane element.
    • createContent

      protected abstract void createContent(Dialog<T>.Content content)
      Creates the content of this dialog. Subclasses must implement this to populate the dialog body.
      Parameters:
      content - The content area to populate.
    • onOpen

      protected void onOpen()