public class RootLayoutPanel extends LayoutPanel
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.
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); } }
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
IndexedPanel.ForIsWidget
HasWidgets.ForIsWidget
eventsToSink
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
Modifier and Type | Method and Description |
---|---|
static RootLayoutPanel |
get()
Gets the singleton instance of RootLayoutPanel.
|
protected void |
onLoad()
This method is called immediately after a widget becomes attached to the
browser's document.
|
add, animate, animate, forceLayout, getLayout, getWidgetContainerElement, insert, onAttach, onDetach, onResize, remove, setWidgetBottomHeight, setWidgetBottomHeight, setWidgetHorizontalPosition, setWidgetLeftRight, setWidgetLeftRight, setWidgetLeftWidth, setWidgetLeftWidth, setWidgetRightWidth, setWidgetRightWidth, setWidgetTopBottom, setWidgetTopBottom, setWidgetTopHeight, setWidgetTopHeight, setWidgetVerticalPosition, setWidgetVisible
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, doLogicalClear, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
public static RootLayoutPanel get()
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.