Class AbsolutePanel
- All Implemented Interfaces:
- HasAttachHandlers,- HasHandlers,- EventListener,- HasVisibility,- HasWidgets,- HasWidgets.ForIsWidget,- IndexedPanel,- IndexedPanel.ForIsWidget,- InsertPanel,- InsertPanel.ForIsWidget,- IsWidget,- Iterable<Widget>
- Direct Known Subclasses:
- RootPanel
Note that this panel will not automatically resize itself to allow enough room for its absolutely-positioned children. It must be explicitly sized in order to make room for them.
Once a widget has been added to an absolute panel, the panel effectively "owns" the positioning of the widget. Any existing positioning attributes on the widget may be modified by the panel.
Use in UiBinder Templates
 AbsolutePanel elements in UiBinder templates lay out their children with absolute position, using
 <g:at> elements. Each at element should have left and
 top attributes in pixels. They also can contain widget children
 directly, with no position specified.
 
 
For example:
 <g:AbsolutePanel>
   <g:at left='10' top='20'>
     <g:Label>Lorem ipsum...</g:Label>
   </g:at>
   <g:Label>...dolores est.</g:Label>
 </g:AbsolutePanel>
 - 
Nested Class SummaryNested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObjectUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgetsHasWidgets.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanelIndexedPanel.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanelInsertPanel.ForIsWidget
- 
Field SummaryFields inherited from class com.google.gwt.user.client.ui.WidgeteventsToSinkFields inherited from class com.google.gwt.user.client.ui.UIObjectDEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
- 
Constructor SummaryConstructorsModifierConstructorDescriptionCreates an empty absolute panel.protectedAbsolutePanel(Element elem) Creates an AbsolutePanel with the given element.
- 
Method SummaryModifier and TypeMethodDescriptionvoidOverloaded version for IsWidget.voidAdds a child widget.voidAdds a widget to the panel at the specified position.intGets the position of the left outer border edge of the widget relative to the left outer border edge of the panel.intGets the position of the top outer border edge of the widget relative to the top outer border edge of the panel.voidConvenience overload to allowIsWidgetto be used directly.voidInserts a child widget before the specified index.voidInserts a child widget at the specified position before the specified index.booleanOverridesComplexPanel.remove(Widget)to change the removed Widget's element back to static positioning.This is done so that any positioning changes to the widget that were done by the panel are undone when the widget is disowned from the panel.voidsetWidgetPosition(Widget w, int left, int top) Sets the position of the specified child widget.protected voidsetWidgetPositionImpl(Widget w, int left, int top) Methods inherited from class com.google.gwt.user.client.ui.ComplexPaneladd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, doLogicalClear, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, removeMethods inherited from class com.google.gwt.user.client.ui.Paneladd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeMethods inherited from class com.google.gwt.user.client.ui.WidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObjectaddStyleDependentName, 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, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.user.client.ui.IndexedPanelgetWidget, getWidgetCount, getWidgetIndex, removeMethods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidgetgetWidgetIndexMethods inherited from interface com.google.gwt.user.client.ui.InsertPanel.ForIsWidgetaddMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
AbsolutePanelpublic AbsolutePanel()Creates an empty absolute panel.
- 
AbsolutePanelCreates an AbsolutePanel with the given element. This is protected so that it can be used byRootPanelor a subclass that wants to substitute another element. The element is presumed to be a <div>.- Parameters:
- elem- the element to be used for this panel
 
 
- 
- 
Method Details- 
addDescription copied from class:PanelAdds a child widget.How to Override this Method There are several important things that must take place in the correct order to properly add or insert a Widget to a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered. - Validate: Perform any sanity checks to ensure the Panel can accept a new Widget. Examples: checking for a valid index on insertion; checking that the Panel is not full if there is a max capacity.
- Adjust for Reinsertion: Some Panels need to handle the case
 where the Widget is already a child of this Panel. Example: when performing
 a reinsert, the index might need to be adjusted to account for the Widget's
 removal. See ComplexPanel.adjustIndex(Widget, int).
- Detach Child: Remove the Widget from its existing parent, if
 any. Most Panels will simply call Widget.removeFromParent()on the Widget.
- Logical Attach: Any state variables of the Panel should be
 updated to reflect the addition of the new Widget. Example: the Widget is
 added to the Panel's WidgetCollectionat the appropriate index.
- Physical Attach: The Widget's Element must be physically attached to the Panel's Element, either directly or indirectly.
- Adopt: Call Panel.adopt(Widget)to finalize the add as the very last step.
 - Specified by:
- addin interface- HasWidgets
- Specified by:
- addin interface- InsertPanel
- Overrides:
- addin class- Panel
- Parameters:
- w- the widget to be added
- See Also:
 
- 
addAdds a widget to the panel at the specified position. Setting a position of(-1, -1)will cause the child widget to be positioned statically.- Parameters:
- w- the widget to be added
- left- the widget's left position
- top- the widget's top position
 
- 
addOverloaded version for IsWidget.- See Also:
 
- 
getWidgetLeftGets the position of the left outer border edge of the widget relative to the left outer border edge of the panel.- Parameters:
- w- the widget whose position is to be retrieved
- Returns:
- the widget's left position
 
- 
getWidgetTopGets the position of the top outer border edge of the widget relative to the top outer border edge of the panel.- Parameters:
- w- the widget whose position is to be retrieved
- Returns:
- the widget's top position
 
- 
insertDescription copied from interface:InsertPanelInserts a child widget before the specified index. If the widget is already a child of this panel, it will be moved to the specified index.- Specified by:
- insertin interface- InsertPanel
- Parameters:
- w- the child widget to be inserted
- beforeIndex- the index before which it will be inserted
 
- 
insertConvenience overload to allowIsWidgetto be used directly.- Specified by:
- insertin interface- InsertPanel.ForIsWidget
 
- 
insertInserts a child widget at the specified position before the specified index. Setting a position of(-1, -1)will cause the child widget to be positioned statically. If the widget is already a child of this panel, it will be moved to the specified index.- Parameters:
- w- the child widget to be inserted
- left- the widget's left position
- top- the widget's top position
- beforeIndex- the index before which it will be inserted
- Throws:
- IndexOutOfBoundsException- if- beforeIndexis out of range
 
- 
removeOverridesComplexPanel.remove(Widget)to change the removed Widget's element back to static positioning.This is done so that any positioning changes to the widget that were done by the panel are undone when the widget is disowned from the panel.- Specified by:
- removein interface- HasWidgets
- Overrides:
- removein class- ComplexPanel
- Parameters:
- w- the widget to be removed
- Returns:
- trueif the child was present
 
- 
setWidgetPositionSets the position of the specified child widget. Setting a position of(-1, -1)will cause the child widget to be positioned statically.- Parameters:
- w- the child widget to be positioned
- left- the widget's left position
- top- the widget's top position
 
- 
setWidgetPositionImpl
 
-