Class ModalPopup<T extends ModalPopup<T>>


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

ModalPopup provides a lightweight modal dialog that displays content over a semi-transparent glass pane. Unlike Dialog, this class does not include a titlebar. Subclasses implement createContent(Content) to populate the popup body.

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

    • ModalPopup

      public ModalPopup()
      Creates a new ModalPopup 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).
    • setContentClass

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

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

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

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

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

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

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

      public final 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 ModalPopup<T>>
      Parameters:
      id - The callback identifier.
    • createContent

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