public class ResizableWidgetCollection extends java.lang.Object implements com.google.gwt.user.client.WindowResizeListener, java.lang.Iterable<ResizableWidget>
ResizableWidget that periodically checks the outer
dimensions of a widget and redraws it as necessary. Every
ResizableWidgetCollection uses a timer, so consider the cost when
adding one.
Typically, a ResizableWidgetCollection is only needed if you expect
your widgets to resize based on window resizing or other events. Fixed sized
Widgets do not need to be added to a ResizableWidgetCollection as
they cannot be resized.| Modifier | Constructor and Description |
|---|---|
|
ResizableWidgetCollection()
Create a ResizableWidget.
|
|
ResizableWidgetCollection(boolean resizeCheckingEnabled)
Constructor.
|
|
ResizableWidgetCollection(int resizeCheckDelay)
Constructor.
|
protected |
ResizableWidgetCollection(int resizeCheckDelay,
boolean resizeCheckingEnabled)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ResizableWidget widget)
Add a resizable widget to the collection.
|
void |
checkWidgetSize()
Check to see if any Widgets have been resized and call their handlers
appropriately.
|
static ResizableWidgetCollection |
get()
Get the globally accessible
ResizableWidgetCollection. |
int |
getResizeCheckDelay()
Get the delay between resize checks in milliseconds.
|
boolean |
isResizeCheckingEnabled()
Check whether or not resize checking is enabled.
|
java.util.Iterator<ResizableWidget> |
iterator() |
void |
onWindowResized(int width,
int height)
Deprecated.
|
void |
remove(ResizableWidget widget)
Remove a
ResizableWidget from the collection. |
void |
setResizeCheckDelay(int resizeCheckDelay)
Set the delay between resize checks in milliseconds.
|
void |
setResizeCheckingEnabled(boolean enabled)
Set whether or not resize checking is enabled.
|
void |
updateWidgetSize(ResizableWidget widget)
Inform the
ResizableWidgetCollection that the size of a widget has
changed and already been redrawn. |
public ResizableWidgetCollection()
public ResizableWidgetCollection(boolean resizeCheckingEnabled)
resizeCheckingEnabled - false to disable resize checkingpublic ResizableWidgetCollection(int resizeCheckDelay)
resizeCheckDelay - the delay between checks in millisecondsprotected ResizableWidgetCollection(int resizeCheckDelay,
boolean resizeCheckingEnabled)
resizeCheckDelay - The resize check delay.resizeCheckingEnabled - If the resize checking is enabled or not.public static ResizableWidgetCollection get()
ResizableWidgetCollection. In most
cases, the global collection can be used for all ResizableWidgets.ResizableWidgetCollectionpublic void add(ResizableWidget widget)
widget - the resizable widget to addpublic void checkWidgetSize()
public int getResizeCheckDelay()
public boolean isResizeCheckingEnabled()
public java.util.Iterator<ResizableWidget> iterator()
iterator in interface java.lang.Iterable<ResizableWidget>@Deprecated
public void onWindowResized(int width,
int height)
onWindowResized in interface com.google.gwt.user.client.WindowResizeListenerwidth - the width of the window's client area.height - the height of the window's client area.public void remove(ResizableWidget widget)
ResizableWidget from the collection.widget - the widget to removepublic void setResizeCheckDelay(int resizeCheckDelay)
resizeCheckDelay - the new delaypublic void setResizeCheckingEnabled(boolean enabled)
enabled - true to enable the resize checking timerpublic void updateWidgetSize(ResizableWidget widget)
ResizableWidgetCollection that the size of a widget has
changed and already been redrawn. This will prevent the widget from being
redrawn on the next loop.widget - the widget's size that changed