Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
how to resize a DockLayoutPanel pane using gwt 2.0 and uibinder
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gkb  
View profile  
 More options Nov 6, 8:00 am
From: gkb <gkb...@gmail.com>
Date: Fri, 6 Nov 2009 05:00:39 -0800 (PST)
Local: Fri, Nov 6 2009 8:00 am
Subject: how to resize a DockLayoutPanel pane using gwt 2.0 and uibinder
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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jd  
View profile  
 More options Nov 7, 4:08 am
From: jd <jdpatter...@gmail.com>
Date: Sat, 7 Nov 2009 01:08:12 -0800 (PST)
Local: Sat, Nov 7 2009 4:08 am
Subject: Re: how to resize a DockLayoutPanel pane using gwt 2.0 and uibinder
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 <gkb...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mortenmo@gmail.com  
View profile  
 More options Dec 11, 12:07 pm
From: "morte...@gmail.com" <morte...@gmail.com>
Date: Fri, 11 Dec 2009 09:07:40 -0800 (PST)
Local: Fri, Dec 11 2009 12:07 pm
Subject: Re: how to resize a DockLayoutPanel pane using gwt 2.0 and uibinder
I just tried this (in 2.0GA), and I get errors in the generated code:

ui.xml looks something like this:

<trinity:ResizableDockLayoutPanel ui:field="rootPanel" unit="PX">
        <trinity:south size="0">
<trinity:ContentPanel ui:field="bottomPanel"></trinity:ContentPanel>
        </trinity:south>
...

it complains about a type mismatch, when looking at the generated code
it is obvious why but not how to fix it:

 public Widget createAndBindUi(final Trinity owner) {

    bam.trinity.client.Trinity_BinderImpl_GenBundle
clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
(bam.trinity.client.Trinity_BinderImpl_GenBundle) GWT.create
(bam.trinity.client.Trinity_BinderImpl_GenBundle.class);
    bam.trinity.client.Trinity_BinderImpl_GenCss_style style =
clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style
();
    bam.trinity.client.ui.ContentPanel bottomPanel =
(bam.trinity.client.ui.ContentPanel) GWT.create
(bam.trinity.client.ui.ContentPanel.class);
    com.google.gwt.user.client.ui.HTML left =
(com.google.gwt.user.client.ui.HTML) GWT.create
(com.google.gwt.user.client.ui.HTML.class);
    com.google.gwt.user.client.ui.HTML right =
(com.google.gwt.user.client.ui.HTML) GWT.create
(com.google.gwt.user.client.ui.HTML.class);
    com.google.gwt.dom.client.SpanElement headerspan = null;
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get
().createUniqueId();
    com.google.gwt.user.client.ui.HTML f_HTML1 =
(com.google.gwt.user.client.ui.HTML) GWT.create
(com.google.gwt.user.client.ui.HTML.class);
    bam.trinity.client.ui.ContentPanel content =
(bam.trinity.client.ui.ContentPanel) GWT.create
(bam.trinity.client.ui.ContentPanel.class);
    bam.trinity.client.ui.ResizableDockLayoutPanel rootPanel = new
com.google.gwt.user.client.ui.DockLayoutPanel
(com.google.gwt.dom.client.Style.Unit.PX);

On the last line here, the ResizableDockLayoutPanel is for some reason
set to "new DockLayoutPanel" and not ResizableDockLayoutPanel..

Maybe I did something dumb, but I can't really find it :)

On Nov 7, 3:08 am, jd <jdpatter...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google