Class HeaderPanel

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IsWidget, RequiresResize, Iterable<Widget>

public class HeaderPanel extends Panel implements RequiresResize
A panel that includes a header (top), footer (bottom), and content (middle) area. The header and footer areas resize naturally. The content area is allocated all of the remaining space between the header and footer area.
  • Constructor Details

    • HeaderPanel

      public HeaderPanel()
  • Method Details

    • add

      public void add(Widget w)
      Adds a widget to this panel.
      Specified by:
      add in interface HasWidgets
      Overrides:
      add in class Panel
      Parameters:
      w - the child widget to be added
      See Also:
    • getContentWidget

      public Widget getContentWidget()
      Get the content widget that appears between the header and footer.
      Returns:
      the content Widget
    • getFooterWidget

      public Widget getFooterWidget()
      Get the footer widget at the bottom of the panel.
      Returns:
      the footer Widget
    • getHeaderWidget

      public Widget getHeaderWidget()
      Get the header widget at the top of the panel.
      Returns:
      the header Widget
    • 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>
    • onAttach

      public void onAttach()
      Description copied from class: Widget

      This method is called when a widget is attached to the browser's document. To receive notification after a Widget has been added to the document, override the Widget.onLoad() method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).

      It is strongly recommended that you override Widget.onLoad() or Widget.doAttachChildren() instead of this method to avoid inconsistencies between logical and physical attachment states.

      Subclasses that override this method must call super.onAttach() to ensure that the Widget has been attached to its underlying Element.

      Overrides:
      onAttach in class Widget
      See Also:
    • onDetach

      public void onDetach()
      Description copied from class: Widget

      This method is called when a widget is detached from the browser's document. To receive notification before a Widget is removed from the document, override the Widget.onUnload() method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).

      It is strongly recommended that you override Widget.onUnload() or Widget.doDetachChildren() instead of this method to avoid inconsistencies between logical and physical attachment states.

      Subclasses that override this method must call super.onDetach() to ensure that the Widget has been detached from the underlying Element. Failure to do so will result in application memory leaks due to circular references between DOM Elements and JavaScript objects.

      Overrides:
      onDetach in class Widget
      See Also:
    • onResize

      public void onResize()
      Description copied from interface: RequiresResize
      This method must be called whenever the implementor's size has been modified.
      Specified by:
      onResize in interface RequiresResize
    • 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
      Specified by:
      remove in class Panel
      Parameters:
      w - the widget to be removed
      Returns:
      true if the child was present
    • setContentWidget

      public void setContentWidget(Widget w)
      Set the widget in the content portion between the header and footer.
      Parameters:
      w - the widget to use as the content
    • setFooterWidget

      public void setFooterWidget(Widget w)
      Set the widget in the footer portion at the bottom of the panel.
      Parameters:
      w - the widget to use as the footer
    • setHeaderWidget

      public void setHeaderWidget(Widget w)
      Set the widget in the header portion at the top of the panel.
      Parameters:
      w - the widget to use as the header