Problem with Mosaïc layout and FFplugin

0 views
Skip to first unread message

Nico

unread,
Aug 25, 2010, 3:20:39 AM8/25/10
to gwt-mosaic
Hello,

I work with GWT and Mosaïc for 2 years ago and today, for the first
time, I've got an error I don'r understand.

I currently use GWT 2.0.4, GWT Mosaïc 0.4.0 rc4 and FireFox 3.6.8
(with GWT plugin 1.0.7511).

I just try to create an application with source code from showcase:

public void onModuleLoad() {
// Create a layout panel to align the widgets
final LayoutPanel layoutPanel = new ScrollLayoutPanel();

((BoxLayout)layoutPanel.getLayout()).setAlignment(Alignment.CENTER);

final Button b1 = new Button("Width: float<br>Height: float");
final Button b2 = new Button("Width: 25%<br>Height: float");
final Button b3 = new Button("Width: 50%<br>Height: float");
final Button b4 = new Button("Width: 75%<br>Height: float");
final Button b5 = new Button("Width: 50%<br>Height: 50%");
final Button b6 = new Button("Width: 100px<br>Height: 100px");
final Button b7 = new Button("Width: fill<br>Height: float");

layoutPanel.add(b1);
layoutPanel.add(b2, new BoxLayoutData("25%", null));
layoutPanel.add(b3, new BoxLayoutData("50%", null));
layoutPanel.add(b4, new BoxLayoutData("75%", null));
layoutPanel.add(b5, new BoxLayoutData("50%", "50%"));
layoutPanel.add(b6, new BoxLayoutData("100%", "100%"));
layoutPanel.add(b7, new BoxLayoutData(FillStyle.HORIZONTAL));

// Attach the LayoutPanel to the RootLayoutPanel. The latter
will listen for
// resize events on the window to ensure that its children are
informed of
// possible size changes.
RootLayoutPanel rp = RootLayoutPanel.get();
rp.add(layoutPanel);
}

I parametrized my gwt.xml file by adding these lines :

<inherits name='org.gwt.mosaic.Mosaic' />
<inherits name='org.gwt.mosaic.actions.Actions' />
<inherits name='org.gwt.mosaic.forms.Forms' />
<inherits name='org.gwt.mosaic.pagebus.PageBus' />

<inherits name='org.gwt.mosaic.theme.standard.StandardResources' />

But when I launch my application, all the buttons are places on the
same line!
MoreHover, if launch FireBug on the web page, all the buttons move and
take the right place and the right size!

I've just got a warning inEclipse :

Warnings in 'jar:file:/D:/.../lib/gwt-mosaic-0.4.0-rc4.jar!/org/gwt/
mosaic/ui/client/impl/GlassPanelImpl.java'
Line 52: Referencing deprecated class
'com.google.gwt.user.client.impl.DocumentRootImpl
Line 60: Referencing deprecated class
'com.google.gwt.user.client.impl.DocumentRootImpl

Has anyone an idea about my problem?

Nicolas


Mike Warne

unread,
Aug 25, 2010, 3:10:11 PM8/25/10
to gwt-m...@googlegroups.com
Hi Nico,

I also have the deprecated message in GlassPanel.  However it seems to cause no harm (it's a warning, not an error).

My projects still work ok.

Thanks,
Mike.



--
You received this message because you are subscribed to the Google Groups "gwt-mosaic" group.
To post to this group, send email to gwt-m...@googlegroups.com.
To unsubscribe from this group, send email to gwt-mosaic+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-mosaic?hl=en.


Mike Warne

unread,
Aug 25, 2010, 3:14:59 PM8/25/10
to gwt-m...@googlegroups.com
Hi Nico,

When your application puts all the buttons on one line,  try resizing your browser window -- even just a small amount.... 

 (This forces a layout() to happen). 

If it corrects itself, you might need to execute layout() for your panel in a DeferredCommand. at the end of your code.

Example:

DeferredCommand.addCommand(new Command(){
    public void run() {
        layoutPanel.layout();
   }
};


On Tue, Aug 24, 2010 at 9:20 PM, Nico <mengin....@gmail.com> wrote:

Nico

unread,
Aug 26, 2010, 2:58:39 AM8/26/10
to gwt-mosaic
Hello,

Thank you for your answers.

Indeed, I just added a single .layout() on my parent panel, and all is
OK ;)

On 25 août, 21:14, Mike Warne <mike.wa...@gmail.com> wrote:
> Hi Nico,
>
> When your application puts all the buttons on one line,  try resizing your
> browser window -- even just a small amount....
>
>  (This forces a layout() to happen).
>
> If it corrects itself, you might need to execute layout() for your panel in
> a DeferredCommand. at the end of your code.
>
> Example:
>
> DeferredCommand.addCommand(new Command(){
>     public void run() {
>         layoutPanel.layout();
>    }
>
> };
> > gwt-mosaic+...@googlegroups.com<gwt-mosaic%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages