Class ResizeLayoutPanel
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.ResizeLayoutPanel
-
- All Implemented Interfaces:
HasAttachHandlers
,HasResizeHandlers
,HasHandlers
,EventListener
,AcceptsOneWidget
,HasOneWidget
,HasVisibility
,HasWidgets
,HasWidgets.ForIsWidget
,IsWidget
,ProvidesResize
,java.lang.Iterable<Widget>
public class ResizeLayoutPanel extends SimplePanel implements ProvidesResize, HasResizeHandlers
A simple panel thatProvidesResize
to its one child, but does notRequiresResize
. Use this to embed layout panels in any location within your application.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ResizeLayoutPanel.Impl
Implementation of resize event.(package private) static class
ResizeLayoutPanel.ImplStandard
Implementation of resize event.(package private) static class
ResizeLayoutPanel.ImplTrident
Implementation of resize event used by IE.-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
-
-
Field Summary
-
Fields inherited from class com.google.gwt.user.client.ui.SimplePanel
widget
-
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
-
Constructor Summary
Constructors Constructor Description ResizeLayoutPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandlerRegistration
addResizeHandler(ResizeHandler handler)
Adds aResizeEvent
handler.protected void
onAttach()
This method is called when a widget is attached to the browser's document.protected void
onDetach()
This method is called when a widget is detached from the browser's document.boolean
remove(Widget w)
Removes a child widget.void
setWidget(Widget w)
Sets this panel's widget.-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
-
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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
-
-
-
Method Detail
-
addResizeHandler
public HandlerRegistration addResizeHandler(ResizeHandler handler)
Description copied from interface:HasResizeHandlers
Adds aResizeEvent
handler.- Specified by:
addResizeHandler
in interfaceHasResizeHandlers
- 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.
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
false
if it is not. - Orphan: Call
Panel.orphan(Widget)
first while the child Widget is still attached. - 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.
- 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 interfaceHasWidgets
- Overrides:
remove
in classSimplePanel
- Parameters:
w
- the widget to be removed- Returns:
true
if the child was present
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
-
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 interfaceHasOneWidget
- Overrides:
setWidget
in classSimplePanel
- Parameters:
w
- the panel's new widget, ornull
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 useWidget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler)
.It is strongly recommended that you override
Widget.onLoad()
orWidget.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 classWidget
- See Also:
Widget.onLoad()
,Widget.doAttachChildren()
-
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 useWidget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler)
.It is strongly recommended that you override
Widget.onUnload()
orWidget.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 classWidget
- See Also:
Widget.onUnload()
,Widget.doDetachChildren()
-
-