Class DecoratedPopupPanel

All Implemented Interfaces:
HasAttachHandlers, HasCloseHandlers<PopupPanel>, HasHandlers, EventListener, EventPreview, AcceptsOneWidget, HasAnimation, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IsWidget, SourcesPopupEvents, Iterable<Widget>
Direct Known Subclasses:
DialogBox

public class DecoratedPopupPanel extends PopupPanel

A PopupPanel that wraps its content in a 3x3 grid, which allows users to add rounded corners.

Setting the Size:

If you set the width or height of the DecoratedPopupPanel, you need to set the height and width of the middleCenter cell to 100% so that the middleCenter cell takes up all of the available space. If you do not set the width and height of the DecoratedPopupPanel, it will wrap its contents tightly.

 .gwt-DecoratedPopupPanel .popupMiddleCenter {
   height: 100%;
   width: 100%;
 }
 

CSS Style Rules

  • .gwt-DecoratedPopupPanel { the outside of the popup }
  • .gwt-DecoratedPopupPanel .popupContent { the wrapper around the content }
  • .gwt-DecoratedPopupPanel .popupTopLeft { the top left cell }
  • .gwt-DecoratedPopupPanel .popupTopLeftInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupTopCenter { the top center cell }
  • .gwt-DecoratedPopupPanel .popupTopCenterInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupTopRight { the top right cell }
  • .gwt-DecoratedPopupPanel .popupTopRightInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupMiddleLeft { the middle left cell }
  • .gwt-DecoratedPopupPanel .popupMiddleLeftInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupMiddleCenter { the middle center cell }
  • .gwt-DecoratedPopupPanel .popupMiddleCenterInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupMiddleRight { the middle right cell }
  • .gwt-DecoratedPopupPanel .popupMiddleRightInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupBottomLeft { the bottom left cell }
  • .gwt-DecoratedPopupPanel .popupBottomLeftInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupBottomCenter { the bottom center cell }
  • .gwt-DecoratedPopupPanel .popupBottomCenterInner { the inner element of the cell }
  • .gwt-DecoratedPopupPanel .popupBottomRight { the bottom right cell }
  • .gwt-DecoratedPopupPanel .popupBottomRightInner { the inner element of the cell }
  • Constructor Details

    • DecoratedPopupPanel

      public DecoratedPopupPanel()
      Creates an empty decorated popup panel. A child widget must be added to it before it is shown.
    • DecoratedPopupPanel

      public DecoratedPopupPanel(boolean autoHide)
      Creates an empty decorated popup panel, specifying its "auto-hide" property.
      Parameters:
      autoHide - true if the popup should be automatically hidden when the user clicks outside of it
    • DecoratedPopupPanel

      public DecoratedPopupPanel(boolean autoHide, boolean modal)
      Creates an empty decorated popup panel, specifying its "auto-hide" and "modal" properties.
      Parameters:
      autoHide - true if the popup should be automatically hidden when the user clicks outside of it
      modal - true if keyboard or mouse events that do not target the PopupPanel or its children should be ignored
    • DecoratedPopupPanel

      DecoratedPopupPanel(boolean autoHide, boolean modal, String prefix)
      Creates an empty decorated popup panel using the specified style names.
      Parameters:
      autoHide - true if the popup should be automatically hidden when the user clicks outside of it
      modal - true if keyboard or mouse events that do not target the PopupPanel or its children should be ignored
      prefix - the prefix applied to child style names
  • Method Details

    • clear

      public void clear()
      Description copied from interface: HasWidgets
      Removes all child widgets.
      Specified by:
      clear in interface HasWidgets
      Overrides:
      clear in class Panel
    • getWidget

      public Widget getWidget()
      Description copied from class: SimplePanel
      Gets the panel's child widget.
      Specified by:
      getWidget in interface HasOneWidget
      Overrides:
      getWidget in class SimplePanel
      Returns:
      the child widget, or null if none is present
    • iterator

      public Iterator<Widget> iterator()
      Description copied from interface: HasWidgets
      Gets an iterator for the contained widgets. This iterator is required to implement Iterator.remove().
      Specified by:
      iterator in interface HasWidgets
      Specified by:
      iterator in interface Iterable<Widget>
      Overrides:
      iterator in class SimplePanel
    • remove

      public boolean remove(Widget w)
      Description copied from class: Panel
      Removes a child widget.

      How to Override this Method

      There are several important things that must take place in the correct order to properly remove a Widget from a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.

      1. Validate: Make sure this Panel is actually the parent of the child Widget; return false if it is not.
      2. Orphan: Call Panel.orphan(Widget) first while the child Widget is still attached.
      3. Physical Detach: Adjust the DOM to account for the removal of the child Widget. The Widget's Element must be physically removed from the DOM.
      4. Logical Detach: Update the Panel's state variables to reflect the removal of the child Widget. Example: the Widget is removed from the Panel's WidgetCollection.

      Specified by:
      remove in interface HasWidgets
      Overrides:
      remove in class SimplePanel
      Parameters:
      w - the widget to be removed
      Returns:
      true if the child was present
    • setWidget

      public void setWidget(Widget w)
      Description copied from class: SimplePanel
      Sets this panel's widget. Any existing child widget will be removed.
      Specified by:
      setWidget in interface HasOneWidget
      Overrides:
      setWidget in class PopupPanel
      Parameters:
      w - the panel's new widget, or null to clear the panel
    • doAttachChildren

      protected void doAttachChildren()
      Description copied from class: Widget
      If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onAttach() for each of its child widgets.
      Overrides:
      doAttachChildren in class Panel
      See Also:
    • doDetachChildren

      protected void doDetachChildren()
      Description copied from class: Widget
      If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onDetach() for each of its child widgets.
      Overrides:
      doDetachChildren in class Panel
      See Also:
    • getCellElement

      protected Element getCellElement(int row, int cell)
      Get a specific Element from the panel.
      Parameters:
      row - the row index
      cell - the cell index
      Returns:
      the Element at the given row and cell