Here is a subclass I made to expose some functionality that might help
you
class ResizableDockLayoutPanel extends DockLayoutPanel
{
public ResizableDockLayoutPanel(Unit unit)
{
super(unit);
}
public double getWidgetSize(Widget widget)
{
return ((LayoutData) widget.getLayoutData()).size;
}
public void setWidgetSize(Widget widget, double size)
{
((LayoutData) widget.getLayoutData()).size = size;
}
@Override
public void insert(Widget widget, Direction direction, double
size,
Widget before)
{
super.insert(widget, direction, size, before);
}
}
On Nov 6, 8:00 pm, gkb <[email protected]> wrote:
> Hello all.
>
> I have a question concerning how to access/modify the size of a
> DockLayoutPanel's widget outside of the *.ui.xml file in the java
> code.
>
> For instance, say I have a DockLayoutPanel with a West widget and a
> Center widget as follows:
> {{{
> <g:DockLayoutPanel unit='EM'>
> <g:west size='20'>
> <layouts:WestWidget ui:field='westWidget' />
> </g:west>
> <g:center>
> <layouts:CenterWidget ui:field='centerWidget' />
> </g:center>
> </g:DockLayoutPanel>}}}
>
> Is it possible to dynamically change the width of the westWidget
> somewhere in the associated java code, or can it only by modified in
> the *.ui.xml file.
>
> The problem is, I would like to be able to hide/show the westWidget
> and have the centerWidget fill the remaining space dynamically when
> the app is running,
> but changing the width of westWidget in the java code has no effect on
> the width of the West Pane of the DockLayoutPanel that was hard-coded
> in, there is a disconnect between them.
>
> Any help would be greatly appreciated.
>
> Sincerely,
>
> George.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---