public class ResizableWidgetCollection extends Object implements com.google.gwt.user.client.WindowResizeListener
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.
|
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.
|
void |
onWindowResized(int width,
int height)
Called when the browser window is resized.
|
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.
|
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)
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 int getResizeCheckDelay()
public boolean isResizeCheckingEnabled()
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 timerCopyright © 2017. All Rights Reserved.