public class ResizeInterceptor extends Composite implements RequiresResize, HasWidgets
Simple wrapper widget that can be used between a ProvidesResize
widget (such as a ScrollPanel
or LayoutPanel
) and other
widgets in a Composite
panel to allow you to get notifications when
it is resized.
Implements HasWidgets
so it can contain any number of child widgets
(can be used as a replacement for a FlowPanel
).
A use case would be where you have a Composite
panel containing a
SplitLayoutPanel
which in turn contains a ScrollPanel
containing some elements which you need to base manual positioning logic on.
You can then place this ResizeInterceptor
inside the
ScrollPanel
, set a listener implementation on it using
setListener(Listener)
, and implement your repositioning logic in the
ResizeInterceptor.Listener.onResize()
method.
Modifier and Type | Class and Description |
---|---|
static interface |
ResizeInterceptor.Listener |
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
Constructor and Description |
---|
ResizeInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
add(Widget w) |
void |
clear() |
Iterator<Widget> |
iterator() |
void |
onResize() |
boolean |
remove(Widget w) |
void |
setListener(ResizeInterceptor.Listener listener) |
claimElement, initializeClaimedElement, isAttached, onBrowserEvent, render, render
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public void setListener(ResizeInterceptor.Listener listener)
public void onResize()
onResize
in interface RequiresResize
public void add(Widget w)
add
in interface HasWidgets
public void clear()
clear
in interface HasWidgets
public Iterator<Widget> iterator()
iterator
in interface HasWidgets
iterator
in interface Iterable<Widget>
public boolean remove(Widget w)
remove
in interface HasWidgets