GWT 2.0.3

com.google.gwt.user.client.ui
Class RootLayoutPanel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.google.gwt.user.client.ui.LayoutPanel
                      extended by com.google.gwt.user.client.ui.RootLayoutPanel
All Implemented Interfaces:
HasHandlers, EventListener, AnimatedLayout, HasWidgets, IndexedPanel, ProvidesResize, RequiresResize, java.lang.Iterable<Widget>

public class RootLayoutPanel
extends LayoutPanel

A singleton implementation of LayoutPanel that always attaches itself to the document body (i.e. RootPanel.get()).

This panel automatically calls RequiresResize.onResize() on itself when initially created, and whenever the window is resized.

NOTE: This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.

Example

public class LayoutPanelExample implements EntryPoint {

  public void onModuleLoad() {
    // Attach two child widgets to a LayoutPanel, laying them out horizontally,
    // splitting at 50%.
    Widget childOne = new HTML("left"), childTwo = new HTML("right");
    LayoutPanel p = new LayoutPanel();
    p.add(childOne);
    p.add(childTwo);

    p.setWidgetLeftWidth(childOne, 0, PCT, 50, PCT);
    p.setWidgetRightWidth(childTwo, 0, PCT, 50, PCT);

    // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for
    // resize events on the window to ensure that its children are informed of
    // possible size changes.
    RootLayoutPanel rp = RootLayoutPanel.get();
    rp.add(p);
  }
}


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Method Summary
static RootLayoutPanel get()
          Gets the singleton instance of RootLayoutPanel.
protected  void onLoad()
          A Panel's onLoad method will be called after all of its children are attached.
 
Methods inherited from class com.google.gwt.user.client.ui.LayoutPanel
add, animate, animate, forceLayout, getWidgetContainerElement, insert, onResize, onUnload, remove, setWidgetBottomHeight, setWidgetHorizontalPosition, setWidgetLeftRight, setWidgetLeftWidth, setWidgetRightWidth, setWidgetTopBottom, setWidgetTopHeight, setWidgetVerticalPosition
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

get

public static RootLayoutPanel get()
Gets the singleton instance of RootLayoutPanel. This instance will always be attached to the document body via RootPanel.get().

Note that, unlike RootPanel.get(String), this class provides no way to get an instance for any element on the page other than the document body. This is because we know of no way to get resize events for anything but the window.


onLoad

protected void onLoad()
Description copied from class: Panel
A Panel's onLoad method will be called after all of its children are attached.

Overrides:
onLoad in class LayoutPanel
See Also:
Widget.onLoad()

GWT 2.0.3