On Wednesday, July 10, 2013 5:54:19 AM UTC+2, Zak Linder wrote:
>
> I do not use UiBinder, but I have come across this problem as well, and 
> have found a solution that works for me.
>
> The problem is that HeaderPanel only sets the size of the 
> contentContainer, it does nothing with the contentContainer’s child widget 
> (HeaderPanel#getContentWidget()). Aiden’s suggestion of using 
> ResizeLayoutPanel as the content widget will not work for the same reason 
> (I tried :P). So, my fix is to always wrap the content widget in a 
> SimpleLayoutPanel that fills the contentContainer:
>
> public class HeaderLayoutPanel extends HeaderPanel implements 
> ProvidesResize{
>
>   @Override
>   public void setContentWidget(Widget w){
>     SimpleLayoutPanel panel = new SimpleLayoutPanel();
>     panel.setSize("100%", "100%");
>     panel.setWidget(w);
>     super.setContentWidget(panel);
>   }
> }
>
> setSize("100%", "100%") works because the contentContainer’s dimensions 
> are always set in px. Also, remember that this needs to be added to a 
> LayoutPanel for it to fill all available space.
>

Looking at HeaderPanel, it looks like it should use a Layout and put the 
content widget into a Layer, just like SimpleLayoutPanel and 
ResizeLayoutPanel do.
Could you please file an issue on the tracker? (linking to this thread)
 

> I called this class ‘HeaderLayoutPanel’ and had it implement the 
> ProvidesResize marker interface because I feel that the SimpleLayoutPanel 
> wrapper makes this a ‘true’ LayoutPanel, since it does fulfill the 
> onResize() contract for the content widget.
>

The reason HeaderPanel doesn't implement ProvidesResize is because it 
doesn't fulfill the contract for the header and footer widgets (that's the 
whole design goal of HeaderPanel).
We should probably add it to the javadoc.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to