SUPPORT: BorderLayout problem

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

SUPPORT: BorderLayout problem

Postby mturilin » Fri Jul 02, 2004 4:35 am

I have a problem with swing2swt Borderlayout in 2.0.1 compiled on 2004.06.27 on Eclipse 3.0 Release.

Composite descendant with BorderLayout as layout manager doesn't display any internal component after construction. When it get resized everything becomes fine. Any ideas?
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am

Re: SUPPORT: BorderLayout problem

Postby Eric Clayberg » Fri Jul 02, 2004 5:41 am

mturilin wrote:I have a problem with swing2swt Borderlayout in 2.0.1 compiled on 2004.06.27 on Eclipse 3.0 Release. Composite descendant with BorderLayout as layout manager doesn't display any internal component after construction. When it get resized everything becomes fine. Any ideas?

This was caused by a bug in the actual implementation of the swing2swt BorderLayout class itself. We have already corrected the problem for the next build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: SUPPORT: BorderLayout problem

Postby Eric Clayberg » Fri Jul 02, 2004 1:18 pm

Eric Clayberg wrote:We have already corrected the problem for the next build.

A new 2004.07.2 build includes the fix.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: SUPPORT: BorderLayout problem

Postby mturilin » Mon Jul 05, 2004 5:55 am

Eric Clayberg wrote:
Eric Clayberg wrote:We have already corrected the problem for the next build.

A new 2004.07.2 build includes the fix.


I have downloaded this build and installed. Then I've deleted swing2swt generated package and created new form with BorderLayout to force SWT-designer re-generate this package. The problem is still persists.
When am I wrong?

Turilin Michael (registered user)
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am

Re: SUPPORT: BorderLayout problem

Postby Eric Clayberg » Mon Jul 05, 2004 9:12 am

mturilin wrote:When am I wrong?

I don't know. When I try it on my end, it looks fine. Can you send the source for your window and a screen shot of what you see in Designer to support@swt-designer.com?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby mturilin » Wed Jul 07, 2004 4:40 am

The behaviour of the layout is wery strange. It work in the SWT Application and does not work in th Composite/ Here's the examples.
Working Application:
Code: Select all

package ru.microtest.test.gl.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;

import swing2swt.layout.BorderLayout;


public class BorderTest {

    public static void main(String[] args) {
        BorderTest window = new BorderTest();
        window.open();
    }

    public void open() {
        final Display display = new Display();
        final Shell shell = new Shell();
        shell.setText("SWT Application");
        {
            Tree tree;
            Table table;
            Text text;
            shell.setLayout(new BorderLayout(0, 0));
            {
                final Composite composite = new Composite(shell, SWT.NONE);
                final org.eclipse.swt.layout.GridLayout gridLayout = new GridLayout();
                gridLayout.numColumns = 5;
                composite.setLayout(gridLayout);
                composite.setLayoutData(BorderLayout.SOUTH);
                {
                    final Button button = new Button(composite, SWT.NONE);
                    button.setText("button");
                }
                {
                    text = new Text(composite, SWT.BORDER);
                }
            }
            {
                table = new Table(shell, SWT.BORDER);
                table.setLayoutData(BorderLayout.CENTER);
                table.setLinesVisible(true);
                table.setHeaderVisible(true);
            }
            {
                final ToolBar toolBar = new ToolBar(shell, SWT.NONE);
                toolBar.setLayoutData(BorderLayout.NORTH);
                {
                    final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
                    toolItem.setText("New item");
                }
                {
                    final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
                    toolItem.setText("New item");
                }
                {
                    final ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
                    toolItem.setText("New item");
                }
            }
            {
                tree = new Tree(shell, SWT.BORDER);
                tree.setLayoutData(BorderLayout.WEST);
            }
        }
        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) display.sleep();
        }
    }
}


Non working composite:
Code: Select all
package ru.microtest.test.gl.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;

import swing2swt.layout.BorderLayout;

/**
* @author barnes
*/
public class BordelLayoutPanel extends Composite {

    private Tree tree;
    private Table table;
    private Text text;
    public BordelLayoutPanel(Composite parent, int style) {
        super(parent, style);
        setLayout(new BorderLayout(0, 0));
        {
            final Composite composite = new Composite(this, SWT.NONE);
            final GridLayout gridLayout = new GridLayout();
            gridLayout.numColumns = 5;
            composite.setLayout(gridLayout);
            composite.setLayoutData(BorderLayout.SOUTH);
            {
                final Button button = new Button(composite, SWT.NONE);
                button.setText("button");
            }
            {
                text = new Text(composite, SWT.BORDER);
            }
        }
        {
            table = new Table(this, SWT.BORDER);
            table.setLayoutData(BorderLayout.CENTER);
            table.setLinesVisible(true);
            table.setHeaderVisible(true);
        }
        {
            final ToolBar toolBar = new ToolBar(this, SWT.NONE);
            toolBar.setLayoutData(BorderLayout.NORTH);
            {
                final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
                toolItem.setText("New item");
            }
            {
                final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
                toolItem.setText("New item");
            }
            {
                final ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
                toolItem.setText("New item");
            }
        }
        {
            tree = new Tree(this, SWT.BORDER);
            tree.setLayoutData(BorderLayout.WEST);
        }
        //
    }

    public void dispose() {
        super.dispose();
    }

    protected void checkSubclass() {
    }
}



Any clues?
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am

Postby admin » Wed Jul 07, 2004 8:37 am

Both Shell and Composite with BorderLayout displayed correctly in Designer, but when I press "Test..." in Designer for Composite, I really see empty Composite until first resize.

I've fixed this problem. I am not sure what do you mean under not working, and hope that this fixed problem was your one.
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Postby bs » Wed Jul 07, 2004 12:13 pm

Is this only BorderLayout?

On Linux no window shows up either in Designer or Run for any SWTWindows.

A simple example: Try running the FakeEclipse demo. You will see nothing till you resize.
bs
 
Posts: 16
Joined: Mon Jun 28, 2004 7:57 pm
Location: boston

Postby admin » Wed Jul 07, 2004 7:55 pm

I don't have any problem with FakeEclipse on Windows nor in Designer, nor when I run it. Plus it does not use any AWT layout, only SWT. Can you run with success any SWT application from Eclipse?
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Postby bs » Wed Jul 07, 2004 8:41 pm

Did you try it on Linux?
bs
 
Posts: 16
Joined: Mon Jun 28, 2004 7:57 pm
Location: boston

Postby mturilin » Thu Jul 08, 2004 12:44 am

admin wrote:Both Shell and Composite with BorderLayout displayed correctly in Designer, but when I press "Test..." in Designer for Composite, I really see empty Composite until first resize.

I've fixed this problem. I am not sure what do you mean under not working, and hope that this fixed problem was your one.


This is exactly the problem. But empty (before resizing) Composite appears not only in Designer's test window but also in runnig application.

So when the patched version will be available?
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am

Postby admin » Thu Jul 08, 2004 9:22 am

I need snippets for exact indetifying of problem. Can you send sample Composite and application which show Composite content only after Shell resize (as I understand this is problem, right?)?

In general keep in mind that each component inside of BorderLayout should be visible when you add it, plus don't forget to call layout() to force components displaying as in case of resize, if you add component dynamically.

I've just tested sample Composite wit BorderLayout and Shell with this Composite - it works. So, I need your example.

I can not promise when new version will be uploaded (this is not my task), but hope that this will happen in near days.
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Postby Eric Clayberg » Sat Jul 10, 2004 10:20 am

admin wrote:I can not promise when new version will be uploaded (this is not my task), but hope that this will happen in near days.

That would be my task and it is now done. :-)

A new 2004.07.10 build is available that should help with this problem.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby mturilin » Thu Jul 15, 2004 1:01 am

Eric Clayberg wrote:
admin wrote:I can not promise when new version will be uploaded (this is not my task), but hope that this will happen in near days.

That would be my task and it is now done. :-)


Thanx, Eric!
Everything is working. :lol:
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am

Postby mturilin » Thu Jul 15, 2004 5:27 am

mturilin wrote:Thanx, Eric!
Everything is working. :lol:


It's pity but I found the problem still persists. :(
I'll send my example project by email to support.
mturilin
 
Posts: 7
Joined: Fri Jul 02, 2004 4:28 am


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest