Class ResizeLayoutPanel

All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IsWidget, ProvidesResize, Iterable<Widget>

public class ResizeLayoutPanel extends SimplePanel implements ProvidesResize, HasResizeHandlers
A simple panel that ProvidesResize to its one child, but does not RequiresResize. Use this to embed layout panels in any location within your application.
  • Constructor Details

    • ResizeLayoutPanel

      public ResizeLayoutPanel()
  • Method Details

    • addResizeHandler

      public HandlerRegistration addResizeHandler(ResizeHandler handler)
      Description copied from interface: HasResizeHandlers
      Adds a ResizeEvent handler.
      Specified by:
      addResizeHandler in interface HasResizeHandlers
      Parameters:
      handler - the handler
      Returns:
      the handler registration
    • 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 SimplePanel
      Parameters:
      w - the panel's new widget, or null to clear the panel
    • onAttach

      protected 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

      protected 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: