I have a composite which extends ResizeComposite and has a DockLayoutPanel as its root. I can stick it directly into RootLayoutPanel and it works because DockLayoutPanel ProvidesResize.
However, I'm wanting to use the MVP facilities in GWT 2.2, and RootLayoutPanel can't be passed to ActivityManager#setDiplay(AcceptsOneWidget) (since it's a multi-widget container).
At first glance, ScrollPanel appears to meet the dual requirement of implementing AcceptsOneWidget and both ProvidesResize and RequiresResize.
But I am finding that when I put my widget into a ScrollPanel, that it has a 'zero size', and I have to size it manually in order to see it, and I'm having trouble knowing what size to give it. I'd rather a Panel that didn't necessarily scroll.
You can add
ProvidesResizeto any widget by implementing it yourself, which is relatively simple - you just pass along all of the resize notifications you get to every sub-child thatRequiresResize.Alternatively, if you just want your panel to take up all of the available space, you might try setting the width and height on the
ScrollPanelto"100%".Finally, here's my implementation of a LayoutPanel that
AcceptsOneWidget:I've been using this in my commercial app for months without any problems, and it's easy to swap views in and out of it. Feel free to use this code yourself.